stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpiolib: wm8994: Pay attention to the value set when enabling as output
@ 2012-06-05 17:12 Mark Brown
  2012-06-07 11:11 ` Linus Walleij
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2012-06-05 17:12 UTC (permalink / raw)
  To: Grant Likely, Linus Walleij; +Cc: linux-kernel, Mark Brown, stable

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
---
 drivers/gpio/gpio-wm8994.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-wm8994.c b/drivers/gpio/gpio-wm8994.c
index f2b3d19..1c764e7 100644
--- a/drivers/gpio/gpio-wm8994.c
+++ b/drivers/gpio/gpio-wm8994.c
@@ -90,8 +90,11 @@ static int wm8994_gpio_direction_out(struct gpio_chip *chip,
 	struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip);
 	struct wm8994 *wm8994 = wm8994_gpio->wm8994;
 
+	if (value)
+		value = WM8994_GPN_LVL;
+
 	return wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset,
-			       WM8994_GPN_DIR, 0);
+			       WM8994_GPN_DIR | WM8994_GPN_LVL, value);
 }
 
 static void wm8994_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
-- 
1.7.10


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

* Re: [PATCH] gpiolib: wm8994: Pay attention to the value set when enabling as output
  2012-06-05 17:12 [PATCH] gpiolib: wm8994: Pay attention to the value set when enabling as output Mark Brown
@ 2012-06-07 11:11 ` Linus Walleij
  2012-06-07 21:53   ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2012-06-07 11:11 UTC (permalink / raw)
  To: Mark Brown; +Cc: Grant Likely, Linus Walleij, linux-kernel, stable

On Tue, Jun 5, 2012 at 7:12 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:

> + � � � if (value)
> + � � � � � � � value = WM8994_GPN_LVL;
> +
> � � � �return wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset,
> - � � � � � � � � � � � � � � �WM8994_GPN_DIR, 0);
> + � � � � � � � � � � � � � � �WM8994_GPN_DIR | WM8994_GPN_LVL, value);
> �}

The commit message is so terse compared to what the code does that
I cannot claim to understand what this patch is doing.

Could you elaborate on the problem ans symptoms, just for a nice
commit log?

Yours,
Linus Walleij

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

* Re: [PATCH] gpiolib: wm8994: Pay attention to the value set when enabling as output
  2012-06-07 11:11 ` Linus Walleij
@ 2012-06-07 21:53   ` Mark Brown
  2012-06-08  8:57     ` Linus Walleij
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2012-06-07 21:53 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Grant Likely, Linus Walleij, linux-kernel, stable

On Thu, Jun 07, 2012 at 01:11:20PM +0200, Linus Walleij wrote:
> <broonie@opensource.wolfsonmicro.com> wrote:

> > + ? ? ? if (value)
> > + ? ? ? ? ? ? ? value = WM8994_GPN_LVL;

> > ? ? ? ?return wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset,
> > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?WM8994_GPN_DIR, 0);
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?WM8994_GPN_DIR | WM8994_GPN_LVL, value);
> > ?}

> The commit message is so terse compared to what the code does that
> I cannot claim to understand what this patch is doing.

> Could you elaborate on the problem ans symptoms, just for a nice
> commit log?

I'm not really sure what more there is to say...  previously we were
ignoring the value that's set as part of setting output mode so if
someone wanted to set a value different to the one the chip happened to
have that wouldn't happen.  Ignoring the vaue that the user is trying to
set seems like an obvious enough bug in itself.

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

* Re: [PATCH] gpiolib: wm8994: Pay attention to the value set when enabling as output
  2012-06-07 21:53   ` Mark Brown
@ 2012-06-08  8:57     ` Linus Walleij
  0 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2012-06-08  8:57 UTC (permalink / raw)
  To: Mark Brown; +Cc: Grant Likely, Linus Walleij, linux-kernel, stable

On Thu, Jun 7, 2012 at 11:53 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:

>> Could you elaborate on the problem ans symptoms, just for a nice
>> commit log?
>
> I'm not really sure what more there is to say...

But you do ;-)

> previously we were
> ignoring the value that's set as part of setting output mode so if
> someone wanted to set a value different to the one the chip happened to
> have that wouldn't happen. �Ignoring the vaue that the user is trying to
> set seems like an obvious enough bug in itself.

Throw that into the commit message and I'm in for it!
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* [PATCH] gpiolib: wm8994: Pay attention to the value set when enabling as output
@ 2012-06-09  3:07 Mark Brown
  2012-06-11 20:51 ` Linus Walleij
  2012-07-05 12:45 ` Linus Walleij
  0 siblings, 2 replies; 7+ messages in thread
From: Mark Brown @ 2012-06-09  3:07 UTC (permalink / raw)
  To: Grant Likely, Linus Walleij; +Cc: linux-kernel, Mark Brown, stable

Not paying attention to the value being set is a bad thing because it
means that we'll not set the hardware up to reflect what was requested.
Not setting the hardware up to reflect what was requested means that the
caller won't get the results they wanted.
`
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
---
 drivers/gpio/gpio-wm8994.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-wm8994.c b/drivers/gpio/gpio-wm8994.c
index f2b3d19..1c764e7 100644
--- a/drivers/gpio/gpio-wm8994.c
+++ b/drivers/gpio/gpio-wm8994.c
@@ -90,8 +90,11 @@ static int wm8994_gpio_direction_out(struct gpio_chip *chip,
 	struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip);
 	struct wm8994 *wm8994 = wm8994_gpio->wm8994;
 
+	if (value)
+		value = WM8994_GPN_LVL;
+
 	return wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset,
-			       WM8994_GPN_DIR, 0);
+			       WM8994_GPN_DIR | WM8994_GPN_LVL, value);
 }
 
 static void wm8994_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
-- 
1.7.10


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

* Re: [PATCH] gpiolib: wm8994: Pay attention to the value set when enabling as output
  2012-06-09  3:07 Mark Brown
@ 2012-06-11 20:51 ` Linus Walleij
  2012-07-05 12:45 ` Linus Walleij
  1 sibling, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2012-06-11 20:51 UTC (permalink / raw)
  To: Mark Brown; +Cc: Grant Likely, Linus Walleij, linux-kernel, stable

On Sat, Jun 9, 2012 at 5:07 AM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:

> Not paying attention to the value being set is a bad thing because it
> means that we'll not set the hardware up to reflect what was requested.
> Not setting the hardware up to reflect what was requested means that the
> caller won't get the results they wanted.
> `
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> Cc: stable@vger.kernel.org

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH] gpiolib: wm8994: Pay attention to the value set when enabling as output
  2012-06-09  3:07 Mark Brown
  2012-06-11 20:51 ` Linus Walleij
@ 2012-07-05 12:45 ` Linus Walleij
  1 sibling, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2012-07-05 12:45 UTC (permalink / raw)
  To: Mark Brown; +Cc: Grant Likely, Linus Walleij, linux-kernel, stable

On Sat, Jun 9, 2012 at 5:07 AM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:

> Not paying attention to the value being set is a bad thing because it
> means that we'll not set the hardware up to reflect what was requested.
> Not setting the hardware up to reflect what was requested means that the
> caller won't get the results they wanted.
> `

I removed this "`"

> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> Cc: stable@vger.kernel.org

Applied.

Yours,
Linus Walleij

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

end of thread, other threads:[~2012-07-05 12:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-05 17:12 [PATCH] gpiolib: wm8994: Pay attention to the value set when enabling as output Mark Brown
2012-06-07 11:11 ` Linus Walleij
2012-06-07 21:53   ` Mark Brown
2012-06-08  8:57     ` Linus Walleij
  -- strict thread matches above, loose matches on Subject: below --
2012-06-09  3:07 Mark Brown
2012-06-11 20:51 ` Linus Walleij
2012-07-05 12:45 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).