All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] pinctrl: sunxi: Honor GPIO output initial vaules
@ 2014-01-16  6:34 Chen-Yu Tsai
  2014-01-16  9:25 ` Maxime Ripard
  2014-01-20  8:20 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Chen-Yu Tsai @ 2014-01-16  6:34 UTC (permalink / raw
  To: linux-arm-kernel

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

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---

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(-)

diff --git a/drivers/pinctrl/pinctrl-sunxi.c b/drivers/pinctrl/pinctrl-sunxi.c
index 119d2dd..6ebf306 100644
--- a/drivers/pinctrl/pinctrl-sunxi.c
+++ b/drivers/pinctrl/pinctrl-sunxi.c
@@ -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)
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2] pinctrl: sunxi: Honor GPIO output initial vaules
  2014-01-16  6:34 [PATCH v2] pinctrl: sunxi: Honor GPIO output initial vaules Chen-Yu Tsai
@ 2014-01-16  9:25 ` Maxime Ripard
  2014-01-20  8:20 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2014-01-16  9:25 UTC (permalink / raw
  To: linux-arm-kernel

On Thu, Jan 16, 2014 at 02:34:23PM +0800, Chen-Yu Tsai wrote:
> Some GPIO users, such as fixed-regulator, request GPIO output with
> initial value of 1. This was ignored by sunxi driver.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Could you also send it to stable please?

Thanks,
Maxime

-- 
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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] pinctrl: sunxi: Honor GPIO output initial vaules
  2014-01-16  6:34 [PATCH v2] pinctrl: sunxi: Honor GPIO output initial vaules Chen-Yu Tsai
  2014-01-16  9:25 ` Maxime Ripard
@ 2014-01-20  8:20 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2014-01-20  8:20 UTC (permalink / raw
  To: linux-arm-kernel

On Thu, Jan 16, 2014 at 7:34 AM, Chen-Yu Tsai <wens@csie.org> wrote:

> Some GPIO users, such as fixed-regulator, request GPIO output with
> initial value of 1. This was ignored by sunxi driver.
>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-20  8:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-16  6:34 [PATCH v2] pinctrl: sunxi: Honor GPIO output initial vaules Chen-Yu Tsai
2014-01-16  9:25 ` Maxime Ripard
2014-01-20  8:20 ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.