Skip to contentSkip to conversation

gpio: da8xx_gpio: Fix the _gpio_direction_output function

PATCH New Keerthy 2 participants 2 messages Oct 24, 2019 – Nov 1, 2019 GPIO

lore
Share & tools
lore

Keerthy

author
#0 lore raw

PATCH 1/1 gpio: da8xx_gpio: Fix the _gpio_direction_output function

_gpio_direction_output function currently calls gpio_set_value with the wrong gpio number. gpio_set_value in the uclass driver expects a different gpio number and the _gpio_direction_output is currently providing the number specific to the bank.

Hence fix it by calling the _gpio_set_value function instead.

Fixes 8e51c0f254 ("dm: gpio: Add DM compatibility to GPIO driver for Davinci")
---
 drivers/gpio/da8xx_gpio.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpio/da8xx_gpio.c +7 -7
index 0deb034504..86203307db 100644
@@ -342,13 +342,6 @@ int gpio_free(unsigned int gpio)
 }
 #endif
 
-static int _gpio_direction_output(struct davinci_gpio *bank, unsigned int gpio, int value)
-{
-	clrbits_le32(&bank->dir, 1U << GPIO_BIT(gpio));
-	gpio_set_value(gpio, value);
-	return 0;
-}
-
 static int _gpio_direction_input(struct davinci_gpio *bank, unsigned int gpio)
 {
 	setbits_le32(&bank->dir, 1U << GPIO_BIT(gpio));
@@ -377,6 +370,13 @@ static int _gpio_get_dir(struct davinci_gpio *bank, unsigned int gpio)
 	return in_le32(&bank->dir) & (1U << GPIO_BIT(gpio));
 }
 
+static int _gpio_direction_output(struct davinci_gpio *bank, unsigned int gpio,
+				  int value)
+{
+	clrbits_le32(&bank->dir, 1U << GPIO_BIT(gpio));
+	_gpio_set_value(bank, gpio, value);
+	return 0;
+}
 #ifndef CONFIG_DM_GPIO
 
 void gpio_info(void)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 gpio: da8xx_gpio: Fix the _gpio_direction_output function

Quoted 10 lines · Keerthy

_gpio_direction_output function currently calls gpio_set_value with the wrong gpio number. gpio_set_value in the uclass driver expects a different gpio number and the _gpio_direction_output is currently providing the number specific to the bank.

Hence fix it by calling the _gpio_set_value function instead.

Fixes 8e51c0f254 ("dm: gpio: Add DM compatibility to GPIO driver for Davinci")

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191101/2ab0a3ab/attachment.sig>