gpio_smartbond: Fix port_set_masked_raw
Writing directly to Px_DATA_REG modifies pins which are not indicated by mask, causing gpio_basic_api test to fail. Use Px_SET_DATA_REG and Px_RESET_DATA_REG to modify only pins indicated by mask. Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
This commit is contained in:
parent
82d17f1f2c
commit
782967a1e3
2 changed files with 15 additions and 1 deletions
|
@ -164,7 +164,8 @@ static int gpio_smartbond_port_set_masked_raw(const struct device *dev,
|
|||
{
|
||||
const struct gpio_smartbond_config *config = dev->config;
|
||||
|
||||
config->data_regs->data = value & mask;
|
||||
config->data_regs->set = value & mask;
|
||||
config->data_regs->reset = ~value & mask;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* Copyright (c) 2024 Renesas Electronics Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/ {
|
||||
resources {
|
||||
compatible = "test-gpio-basic-api";
|
||||
out-gpios = <&gpio0 2 0>;
|
||||
in-gpios = <&gpio0 3 0>;
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue