diff mbox

[RESEND] pinctrl: bcm2835: Fix initial value for direction_output

Message ID 1449511825-6156-1-git-send-email-stefan.wahren@i2se.com
State New
Headers show

Commit Message

Stefan Wahren Dec. 7, 2015, 6:10 p.m. UTC
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.

Suggested-by: Martin Sperl <kernel@martin.sperl.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Fixes: e1b2dc70cd5b ("pinctrl: add bcm2835 driver")
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Eric Anholt <eric@anholt.net>
---

This patch was inspired by this discussion [1].

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

Changes:
- added suggested-by, fixes and acked-by tag since first submit

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

Comments

Stefan Wahren Dec. 10, 2015, 11:05 a.m. UTC | #1
Hi Linus,

> Stefan Wahren <stefan.wahren@i2se.com> hat am 7. Dezember 2015 um 19:10
> geschrieben:
>
>
> 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.
>
> Suggested-by: Martin Sperl <kernel@martin.sperl.org>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> Fixes: e1b2dc70cd5b ("pinctrl: add bcm2835 driver")
> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
> Acked-by: Eric Anholt <eric@anholt.net>
> ---

on Nov 30 you wrote that you want Stephen's ACK and now it's there.

But your current patch "[PATCH 092/182] pinctrl: bcm2835: use gpiochip data
pointer" seems to conflict with my?

Any wishes?

Stefan

>
> This patch was inspired by this discussion [1].
>
> [1] -
> http://lists.infradead.org/pipermail/linux-rpi-kernel/2015-April/001499.html
>
> Changes:
> - added suggested-by, fixes and acked-by tag since first submit
>
> drivers/pinctrl/bcm/pinctrl-bcm2835.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij Dec. 14, 2015, 10:33 a.m. UTC | #2
On Thu, Dec 10, 2015 at 12:05 PM, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> Hi Linus,
>
>> Stefan Wahren <stefan.wahren@i2se.com> hat am 7. Dezember 2015 um 19:10
>> geschrieben:
>>
>>
>> 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.
>>
>> Suggested-by: Martin Sperl <kernel@martin.sperl.org>
>> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
>> Fixes: e1b2dc70cd5b ("pinctrl: add bcm2835 driver")
>> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
>> Acked-by: Eric Anholt <eric@anholt.net>
>> ---
>
> on Nov 30 you wrote that you want Stephen's ACK and now it's there.

Yeal already applied it for fixes. Added the Fixes: tag now.

> But your current patch "[PATCH 092/182] pinctrl: bcm2835: use gpiochip data
> pointer" seems to conflict with my?

No problem. I will merge the next release candidate into the GPIO tree
and fix the conflicts after this fix is merged.

Fixing conflicts is all subsystem maintainers do some days :D

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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