Skip to content

Commit 782967a

Browse files
ydamigosnashif
authored andcommitted
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 <[email protected]>
1 parent 82d17f1 commit 782967a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

drivers/gpio/gpio_smartbond.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ static int gpio_smartbond_port_set_masked_raw(const struct device *dev,
164164
{
165165
const struct gpio_smartbond_config *config = dev->config;
166166

167-
config->data_regs->data = value & mask;
167+
config->data_regs->set = value & mask;
168+
config->data_regs->reset = ~value & mask;
168169

169170
return 0;
170171
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
resources {
9+
compatible = "test-gpio-basic-api";
10+
out-gpios = <&gpio0 2 0>;
11+
in-gpios = <&gpio0 3 0>;
12+
};
13+
};

0 commit comments

Comments
 (0)