Skip to contentSkip to conversation

pinctrl: sunxi: Honor GPIO output initial vaules

PATCH Superseded Chen-Yu Tsai 3 participants 3 messages Jan 16, 2014 – Jan 20, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 pinctrl: sunxi: Honor GPIO output initial vaules

Some GPIO users, such as fixed-regulator, request GPIO output with initial value of 1. This was ignored by sunxi driver.

---

Changes since v2:

* Set output value before setting the pin function to avoid a glitch.

 drivers/pinctrl/pinctrl-sunxi.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/pinctrl/pinctrl-sunxi.c +7 -6
index 119d2dd..6ebf306 100644
@@ -469,12 +469,6 @@ static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset)
 	return val;
 }
 
-static int sunxi_pinctrl_gpio_direction_output(struct gpio_chip *chip,
-					unsigned offset, int value)
-{
-	return pinctrl_gpio_direction_output(chip->base + offset);
-}
-
 static void sunxi_pinctrl_gpio_set(struct gpio_chip *chip,
 				unsigned offset, int value)
 {
@@ -498,6 +492,13 @@ static void sunxi_pinctrl_gpio_set(struct gpio_chip *chip,
 	spin_unlock_irqrestore(&pctl->lock, flags);
 }
 
+static int sunxi_pinctrl_gpio_direction_output(struct gpio_chip *chip,
+					unsigned offset, int value)
+{
+	sunxi_pinctrl_gpio_set(chip, offset, value);
+	return pinctrl_gpio_direction_output(chip->base + offset);
+}
+
 static int sunxi_pinctrl_gpio_of_xlate(struct gpio_chip *gc,
 				const struct of_phandle_args *gpiospec,
 				u32 *flags)
Signature · 1 line
1.8.5.2
#1 lore raw

PATCH v2 1/1 pinctrl: sunxi: Honor GPIO output initial vaules

Quoted 4 lines · Chen-Yu Tsai

Some GPIO users, such as fixed-regulator, request GPIO output with initial value of 1. This was ignored by sunxi driver.

Could you also send it to stable please?

Thanks,
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140116/90959b8b/attachment.sig>
#2 lore raw

PATCH v2 1/1 pinctrl: sunxi: Honor GPIO output initial vaules

In reply to Chen-Yu Tsai
Quoted 9 lines · Chen-Yu Tsai

Some GPIO users, such as fixed-regulator, request GPIO output with initial value of 1. This was ignored by sunxi driver.

---

Changes since v2:

* Set output value before setting the pin function to avoid a glitch.

Patch applied with Maxime's ACK and tagged for stable.

Yours,
Linus Walleij