Skip to contentSkip to conversation

gpio: mvebu_gpio: Add missing out value set to gpio_direction_output()

PATCH New Stefan Roese 2 participants 2 messages Apr 7, 2016 – Apr 8, 2016 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: mvebu_gpio: Add missing out value set to gpio_direction_output()

This patch adds the missing configuration of the output value to the gpio_direction_output() function. Without this, calling gpio_direction_output() does not set the out-value at all and only configures the gpio as output.

---
 drivers/gpio/mvebu_gpio.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpio/mvebu_gpio.c +4 -0
index 9564ce2..75dc73e 100644
@@ -43,6 +43,10 @@ static int mvebu_gpio_direction_output(struct udevice *dev, unsigned gpio,
 	struct mvebu_gpio_priv *priv = dev_get_priv(dev);
 	struct mvebu_gpio_regs *regs = priv->regs;
 
+	if (value)
+		setbits_le32(&regs->data_out, BIT(gpio));
+	else
+		clrbits_le32(&regs->data_out, BIT(gpio));
 	clrbits_le32(&regs->io_conf, BIT(gpio));
 
 	return 0;
Signature · 1 line
2.8.1
#1 lore raw

PATCH 1/1 gpio: mvebu_gpio: Add missing out value set to gpio_direction_output()

Quoted 16 lines · Stefan Roese

This patch adds the missing configuration of the output value to the gpio_direction_output() function. Without this, calling gpio_direction_output() does not set the out-value at all and only configures the gpio as output.

---
  drivers/gpio/mvebu_gpio.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpio/mvebu_gpio.c +0 -0
index 9564ce2..75dc73e 100644

drivers/gpio/mvebu_gpio.c static int mvebu_gpio_direction_output(struct udevice *dev, unsigned gpio, · line 52

Quoted 10 lines
drivers/gpio/mvebu_gpio.c +4 -0
@@ -43,6 +43,10 @@ static int mvebu_gpio_direction_output(struct udevice *dev, unsigned gpio,
  	struct mvebu_gpio_priv *priv = dev_get_priv(dev);
  	struct mvebu_gpio_regs *regs = priv->regs;
 
+	if (value)
+		setbits_le32(&regs->data_out, BIT(gpio));
+	else
+		clrbits_le32(&regs->data_out, BIT(gpio));
  	clrbits_le32(&regs->io_conf, BIT(gpio));
 
  	return 0;