LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] pinctrl: ocelot: fix gpio direction
@ 2018-03-22 12:35 Alexandre Belloni
2018-03-22 15:29 ` Gregory CLEMENT
2018-03-26 9:05 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: Alexandre Belloni @ 2018-03-22 12:35 UTC (permalink / raw)
To: Linus Walleij
Cc: Gregory Clement, linux-gpio, linux-kernel, Alexandre Belloni
Bits have to be cleared in DEVCPU_GCB:GPIO:GPIO_OE for input and set for
output. ocelot_gpio_set_direction() got it wrong and this went unnoticed
when the driver was reworked.
Reported-by: Gregory Clement <gregory.clement@bootlin.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/pinctrl/pinctrl-ocelot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c
index a9423238471e..b5b3547fdcb2 100644
--- a/drivers/pinctrl/pinctrl-ocelot.c
+++ b/drivers/pinctrl/pinctrl-ocelot.c
@@ -252,7 +252,7 @@ static int ocelot_gpio_set_direction(struct pinctrl_dev *pctldev,
struct ocelot_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
regmap_update_bits(info->map, OCELOT_GPIO_OE, BIT(pin),
- input ? BIT(pin) : 0);
+ input ? 0 : BIT(pin));
return 0;
}
--
2.16.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] pinctrl: ocelot: fix gpio direction
2018-03-22 12:35 [PATCH] pinctrl: ocelot: fix gpio direction Alexandre Belloni
@ 2018-03-22 15:29 ` Gregory CLEMENT
2018-03-26 9:05 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Gregory CLEMENT @ 2018-03-22 15:29 UTC (permalink / raw)
To: Alexandre Belloni; +Cc: Linus Walleij, linux-gpio, linux-kernel
Hi Alexandre,
On jeu., mars 22 2018, Alexandre Belloni <alexandre.belloni@bootlin.com> wrote:
> Bits have to be cleared in DEVCPU_GCB:GPIO:GPIO_OE for input and set for
> output. ocelot_gpio_set_direction() got it wrong and this went unnoticed
> when the driver was reworked.
>
> Reported-by: Gregory Clement <gregory.clement@bootlin.com>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Thanks,
Gregory
> ---
> drivers/pinctrl/pinctrl-ocelot.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c
> index a9423238471e..b5b3547fdcb2 100644
> --- a/drivers/pinctrl/pinctrl-ocelot.c
> +++ b/drivers/pinctrl/pinctrl-ocelot.c
> @@ -252,7 +252,7 @@ static int ocelot_gpio_set_direction(struct pinctrl_dev *pctldev,
> struct ocelot_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
>
> regmap_update_bits(info->map, OCELOT_GPIO_OE, BIT(pin),
> - input ? BIT(pin) : 0);
> + input ? 0 : BIT(pin));
>
> return 0;
> }
> --
> 2.16.2
>
--
Gregory Clement, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] pinctrl: ocelot: fix gpio direction
2018-03-22 12:35 [PATCH] pinctrl: ocelot: fix gpio direction Alexandre Belloni
2018-03-22 15:29 ` Gregory CLEMENT
@ 2018-03-26 9:05 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2018-03-26 9:05 UTC (permalink / raw)
To: Alexandre Belloni; +Cc: Gregory Clement, open list:GPIO SUBSYSTEM, linux-kernel
On Thu, Mar 22, 2018 at 1:35 PM, Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
> Bits have to be cleared in DEVCPU_GCB:GPIO:GPIO_OE for input and set for
> output. ocelot_gpio_set_direction() got it wrong and this went unnoticed
> when the driver was reworked.
>
> Reported-by: Gregory Clement <gregory.clement@bootlin.com>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-03-26 9:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-22 12:35 [PATCH] pinctrl: ocelot: fix gpio direction Alexandre Belloni
2018-03-22 15:29 ` Gregory CLEMENT
2018-03-26 9:05 ` 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).