linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: bcm2835: Fix initial value for direction_output
@ 2015-11-19  0:32 Stefan Wahren
  2015-11-30  8:29 ` Linus Walleij
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Stefan Wahren @ 2015-11-19  0:32 UTC (permalink / raw)
  To: Linus Walleij, Stephen Warren, Lee Jones, Eric Anholt
  Cc: linux-gpio, linux-rpi-kernel, linux-arm-kernel, Stefan Wahren,
	Martin Sperl

Currently the provided initial value for bcm2835_gpio_direction_output
has no effect. So fix this issue by changing the value before
changing the GPIO direction. As a result we need to move the function below
bcm2835_gpio_set.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
CC: Martin Sperl <kernel@martin.sperl.org>
CC: Stephen Warren <swarren@wwwdotorg.org>
---

This patch was inspired by this discussion [1].

[1] - http://lists.infradead.org/pipermail/linux-rpi-kernel/2015-April/001499.html

 drivers/pinctrl/bcm/pinctrl-bcm2835.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
index 8efa235..fd1441b 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
@@ -352,12 +352,6 @@ static int bcm2835_gpio_get(struct gpio_chip *chip, unsigned offset)
 	return bcm2835_gpio_get_bit(pc, GPLEV0, offset);
 }
 
-static int bcm2835_gpio_direction_output(struct gpio_chip *chip,
-		unsigned offset, int value)
-{
-	return pinctrl_gpio_direction_output(chip->base + offset);
-}
-
 static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
 {
 	struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev);
@@ -365,6 +359,13 @@ static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
 	bcm2835_gpio_set_bit(pc, value ? GPSET0 : GPCLR0, offset);
 }
 
+static int bcm2835_gpio_direction_output(struct gpio_chip *chip,
+		unsigned offset, int value)
+{
+	bcm2835_gpio_set(chip, offset, value);
+	return pinctrl_gpio_direction_output(chip->base + offset);
+}
+
 static int bcm2835_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
 {
 	struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev);
-- 
1.7.9.5


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

* Re: [PATCH] pinctrl: bcm2835: Fix initial value for direction_output
  2015-11-19  0:32 [PATCH] pinctrl: bcm2835: Fix initial value for direction_output Stefan Wahren
@ 2015-11-30  8:29 ` Linus Walleij
  2015-11-30 17:17 ` Eric Anholt
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2015-11-30  8:29 UTC (permalink / raw)
  To: Stefan Wahren, Stephen Warren
  Cc: Lee Jones, Eric Anholt, linux-gpio@vger.kernel.org,
	linux-rpi-kernel, linux-arm-kernel@lists.infradead.org,
	Martin Sperl

On Thu, Nov 19, 2015 at 1:32 AM, Stefan Wahren <stefan.wahren@i2se.com> wrote:

> Currently the provided initial value for bcm2835_gpio_direction_output
> has no effect. So fix this issue by changing the value before
> changing the GPIO direction. As a result we need to move the function below
> bcm2835_gpio_set.
>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> CC: Martin Sperl <kernel@martin.sperl.org>
> CC: Stephen Warren <swarren@wwwdotorg.org>

Waiting for Stephen's ACK on this.

Yours,
Linus Walleij

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

* Re: [PATCH] pinctrl: bcm2835: Fix initial value for direction_output
  2015-11-19  0:32 [PATCH] pinctrl: bcm2835: Fix initial value for direction_output Stefan Wahren
  2015-11-30  8:29 ` Linus Walleij
@ 2015-11-30 17:17 ` Eric Anholt
  2015-12-02  3:53 ` Stephen Warren
  2015-12-10 18:07 ` Linus Walleij
  3 siblings, 0 replies; 7+ messages in thread
From: Eric Anholt @ 2015-11-30 17:17 UTC (permalink / raw)
  To: Linus Walleij, Stephen Warren, Lee Jones
  Cc: linux-gpio, linux-rpi-kernel, linux-arm-kernel, Stefan Wahren,
	Martin Sperl

[-- Attachment #1: Type: text/plain, Size: 472 bytes --]

Stefan Wahren <stefan.wahren@i2se.com> writes:

> Currently the provided initial value for bcm2835_gpio_direction_output
> has no effect. So fix this issue by changing the value before
> changing the GPIO direction. As a result we need to move the function below
> bcm2835_gpio_set.
>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> CC: Martin Sperl <kernel@martin.sperl.org>
> CC: Stephen Warren <swarren@wwwdotorg.org>

Acked-by: Eric Anholt <eric@anholt.net>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

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

* Re: [PATCH] pinctrl: bcm2835: Fix initial value for direction_output
  2015-11-19  0:32 [PATCH] pinctrl: bcm2835: Fix initial value for direction_output Stefan Wahren
  2015-11-30  8:29 ` Linus Walleij
  2015-11-30 17:17 ` Eric Anholt
@ 2015-12-02  3:53 ` Stephen Warren
  2015-12-02 14:26   ` Stefan Wahren
  2015-12-10 18:07 ` Linus Walleij
  3 siblings, 1 reply; 7+ messages in thread
From: Stephen Warren @ 2015-12-02  3:53 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Linus Walleij, Lee Jones, Eric Anholt, linux-gpio,
	linux-rpi-kernel, linux-arm-kernel, Martin Sperl

On 11/18/2015 05:32 PM, Stefan Wahren wrote:
> Currently the provided initial value for bcm2835_gpio_direction_output
> has no effect. So fix this issue by changing the value before
> changing the GPIO direction. As a result we need to move the function below
> bcm2835_gpio_set.

Acked-by: Stephen Warren <swarren@wwwdotorg.org>

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

* Re: [PATCH] pinctrl: bcm2835: Fix initial value for direction_output
  2015-12-02  3:53 ` Stephen Warren
@ 2015-12-02 14:26   ` Stefan Wahren
  2015-12-10 18:08     ` Linus Walleij
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Wahren @ 2015-12-02 14:26 UTC (permalink / raw)
  To: Stephen Warren
  Cc: linux-gpio, Linus Walleij, Lee Jones, Eric Anholt,
	linux-rpi-kernel, Martin Sperl, linux-arm-kernel

Am 02.12.2015 um 04:53 schrieb Stephen Warren:
> On 11/18/2015 05:32 PM, Stefan Wahren wrote:
>> Currently the provided initial value for bcm2835_gpio_direction_output
>> has no effect. So fix this issue by changing the value before
>> changing the GPIO direction. As a result we need to move the function below
>> bcm2835_gpio_set.
> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
>

Should i resend the patch with

Suggested-by: Martin Sperl <kernel@martin.sperl.org>

?

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

* Re: [PATCH] pinctrl: bcm2835: Fix initial value for direction_output
  2015-11-19  0:32 [PATCH] pinctrl: bcm2835: Fix initial value for direction_output Stefan Wahren
                   ` (2 preceding siblings ...)
  2015-12-02  3:53 ` Stephen Warren
@ 2015-12-10 18:07 ` Linus Walleij
  3 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2015-12-10 18:07 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Stephen Warren, Lee Jones, Eric Anholt,
	linux-gpio@vger.kernel.org, linux-rpi-kernel,
	linux-arm-kernel@lists.infradead.org, Martin Sperl

On Thu, Nov 19, 2015 at 1:32 AM, Stefan Wahren <stefan.wahren@i2se.com> wrote:

> Currently the provided initial value for bcm2835_gpio_direction_output
> has no effect. So fix this issue by changing the value before
> changing the GPIO direction. As a result we need to move the function below
> bcm2835_gpio_set.
>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> CC: Martin Sperl <kernel@martin.sperl.org>
> CC: Stephen Warren <swarren@wwwdotorg.org>

Patch applied for fixes.

Yours,
Linus Walleij

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

* Re: [PATCH] pinctrl: bcm2835: Fix initial value for direction_output
  2015-12-02 14:26   ` Stefan Wahren
@ 2015-12-10 18:08     ` Linus Walleij
  0 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2015-12-10 18:08 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Stephen Warren, linux-gpio@vger.kernel.org, Lee Jones,
	Eric Anholt, linux-rpi-kernel, Martin Sperl,
	linux-arm-kernel@lists.infradead.org

On Wed, Dec 2, 2015 at 3:26 PM, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> Am 02.12.2015 um 04:53 schrieb Stephen Warren:
>> On 11/18/2015 05:32 PM, Stefan Wahren wrote:
>>> Currently the provided initial value for bcm2835_gpio_direction_output
>>> has no effect. So fix this issue by changing the value before
>>> changing the GPIO direction. As a result we need to move the function below
>>> bcm2835_gpio_set.
>> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
>>
>
> Should i resend the patch with
>
> Suggested-by: Martin Sperl <kernel@martin.sperl.org>

No, I added this when applying the patch.

Yours,
Linus Walleij

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

end of thread, other threads:[~2015-12-10 18:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-19  0:32 [PATCH] pinctrl: bcm2835: Fix initial value for direction_output Stefan Wahren
2015-11-30  8:29 ` Linus Walleij
2015-11-30 17:17 ` Eric Anholt
2015-12-02  3:53 ` Stephen Warren
2015-12-02 14:26   ` Stefan Wahren
2015-12-10 18:08     ` Linus Walleij
2015-12-10 18:07 ` 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).