Skip to contentSkip to conversation

pinctrl: bcm2835: Fix initial value for direction_output

PATCH New Stefan Wahren 4 participants 7 messages Nov 19, 2015 – Dec 10, 2015

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

PATCH 1/1 pinctrl: bcm2835: Fix initial value for direction_output

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.

CC Martin Sperl <[email protected]>
CC Stephen Warren <[email protected]>

---

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(-)
drivers/pinctrl/bcm/pinctrl-bcm2835.c +7 -6
index 8efa235..fd1441b 100644
@@ -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);
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 pinctrl: bcm2835: Fix initial value for direction_output

Quoted 8 lines · Stefan Wahren

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.

CC Martin Sperl <[email protected]>
CC Stephen Warren <[email protected]>

Waiting for Stephen's ACK on this.

Yours,
Linus Walleij

#2 lore raw

PATCH 1/1 pinctrl: bcm2835: Fix initial value for direction_output

In reply to Stefan Wahren
Quoted 8 lines · Stefan Wahren

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.

CC Martin Sperl <[email protected]>
CC Stephen Warren <[email protected]>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151130/0a065946/attachment.sig>

#3 lore raw

PATCH 1/1 pinctrl: bcm2835: Fix initial value for direction_output

In reply to Stefan Wahren
Quoted 4 lines · Stefan Wahren

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.

#4 lore raw

PATCH 1/1 pinctrl: bcm2835: Fix initial value for direction_output

Am 02.12.2015 um 04:53 schrieb Stephen Warren:

Quoted 7 lines · Stefan Wahren
Quoted 4 lines

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.

Should i resend the patch with

?

#5 lore raw

PATCH 1/1 pinctrl: bcm2835: Fix initial value for direction_output

Quoted 6 lines · Stefan Wahren

Am 02.12.2015 um 04:53 schrieb Stephen Warren:

Quoted 5 lines · Stefan Wahren
Quoted 4 lines

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.

Quoted 6 lines
Quoted 2 lines

Should i resend the patch with

No, I added this when applying the patch.

Yours,
Linus Walleij

#6 lore raw

PATCH 1/1 pinctrl: bcm2835: Fix initial value for direction_output

In reply to Stefan Wahren
Quoted 8 lines · Stefan Wahren

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.

CC Martin Sperl <[email protected]>
CC Stephen Warren <[email protected]>

Patch applied for fixes.

Yours,
Linus Walleij