Thread (5 messages) 5 messages, 2 authors, 2025-10-01
STALE273d

[PATCH v3 3/3] gpio: rda: Use bidirectional GPIO register for direction input

From: Dang Huynh <hidden>
Date: 2025-09-27 05:02:36
Also in: linux-devicetree, linux-gpio, lkml
Subsystem: arm/rda micro architecture, gpio subsystem, the rest · Maintainers: Manivannan Sadhasivam, Linus Walleij, Bartosz Golaszewski, Linus Torvalds

The current implementation uses both DIRIN and DIROUT registers, but
the bgpio library expects 1 to be output direction, which on this IP
is reversed (0 = output, 1 = input).

To fix this, use GPIO_OEN_VAL for input direction register which
expects 1 = input, 0 = output.

This change should not affect any mainline users as none of them have
any peripherals hooked up to a GPIO.

Signed-off-by: Dang Huynh <redacted>
---
 drivers/gpio/gpio-rda.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-rda.c b/drivers/gpio/gpio-rda.c
index 7d20dbbb6ec41149a1dbf4d9ef9ac86449773c35..145b61fc83fb6eee2415e979a144616d81595736 100644
--- a/drivers/gpio/gpio-rda.c
+++ b/drivers/gpio/gpio-rda.c
@@ -243,8 +243,7 @@ static int rda_gpio_probe(struct platform_device *pdev)
 		.dat = rda_gpio->base + RDA_GPIO_VAL,
 		.set = rda_gpio->base + RDA_GPIO_SET,
 		.clr = rda_gpio->base + RDA_GPIO_CLR,
-		.dirout = rda_gpio->base + RDA_GPIO_OEN_SET_OUT,
-		.dirin = rda_gpio->base + RDA_GPIO_OEN_SET_IN,
+		.dirin = rda_gpio->base + RDA_GPIO_OEN_VAL,
 		.flags = BGPIOF_READ_OUTPUT_REG_SET,
 	};
 
-- 
2.51.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help