* [PATCH] pinctrl: at91: fix get_pullup/down function return
@ 2013-08-27 13:19 Boris BREZILLON
2013-08-27 14:56 ` Nicolas Ferre
2013-08-28 19:22 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: Boris BREZILLON @ 2013-08-27 13:19 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Linus Walleij, Stephen Warren,
Nicolas Ferre
Cc: linux-arm-kernel, linux-kernel, Boris BREZILLON
In PIO_PUSR and PIO_PPDSR register if a given bit is set 1 this means the
pullup/down for this pin (pin is represented as a bit position) is
disabled.
Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
drivers/pinctrl/pinctrl-at91.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index b90a3a0..19afb9a 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -325,7 +325,7 @@ static void at91_mux_disable_interrupt(void __iomem *pio, unsigned mask)
static unsigned at91_mux_get_pullup(void __iomem *pio, unsigned pin)
{
- return (readl_relaxed(pio + PIO_PUSR) >> pin) & 0x1;
+ return !((readl_relaxed(pio + PIO_PUSR) >> pin) & 0x1);
}
static void at91_mux_set_pullup(void __iomem *pio, unsigned mask, bool on)
@@ -445,7 +445,7 @@ static void at91_mux_pio3_set_debounce(void __iomem *pio, unsigned mask,
static bool at91_mux_pio3_get_pulldown(void __iomem *pio, unsigned pin)
{
- return (__raw_readl(pio + PIO_PPDSR) >> pin) & 0x1;
+ return !((__raw_readl(pio + PIO_PPDSR) >> pin) & 0x1);
}
static void at91_mux_pio3_set_pulldown(void __iomem *pio, unsigned mask, bool is_on)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] pinctrl: at91: fix get_pullup/down function return
2013-08-27 13:19 [PATCH] pinctrl: at91: fix get_pullup/down function return Boris BREZILLON
@ 2013-08-27 14:56 ` Nicolas Ferre
2013-08-28 19:22 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Ferre @ 2013-08-27 14:56 UTC (permalink / raw)
To: Boris BREZILLON, Linus Walleij
Cc: Jean-Christophe Plagniol-Villard, Stephen Warren,
linux-arm-kernel, linux-kernel
On 27/08/2013 15:19, Boris BREZILLON :
> In PIO_PUSR and PIO_PPDSR register if a given bit is set 1 this means the
> pullup/down for this pin (pin is represented as a bit position) is
> disabled.
>
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
Indeed.
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
and even:
Cc: stable <stable@vger.kernel.org> # 3.8+
Thanks for fixing this Boris.
> ---
> drivers/pinctrl/pinctrl-at91.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
> index b90a3a0..19afb9a 100644
> --- a/drivers/pinctrl/pinctrl-at91.c
> +++ b/drivers/pinctrl/pinctrl-at91.c
> @@ -325,7 +325,7 @@ static void at91_mux_disable_interrupt(void __iomem *pio, unsigned mask)
>
> static unsigned at91_mux_get_pullup(void __iomem *pio, unsigned pin)
> {
> - return (readl_relaxed(pio + PIO_PUSR) >> pin) & 0x1;
> + return !((readl_relaxed(pio + PIO_PUSR) >> pin) & 0x1);
> }
>
> static void at91_mux_set_pullup(void __iomem *pio, unsigned mask, bool on)
> @@ -445,7 +445,7 @@ static void at91_mux_pio3_set_debounce(void __iomem *pio, unsigned mask,
>
> static bool at91_mux_pio3_get_pulldown(void __iomem *pio, unsigned pin)
> {
> - return (__raw_readl(pio + PIO_PPDSR) >> pin) & 0x1;
> + return !((__raw_readl(pio + PIO_PPDSR) >> pin) & 0x1);
> }
>
> static void at91_mux_pio3_set_pulldown(void __iomem *pio, unsigned mask, bool is_on)
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] pinctrl: at91: fix get_pullup/down function return
2013-08-27 13:19 [PATCH] pinctrl: at91: fix get_pullup/down function return Boris BREZILLON
2013-08-27 14:56 ` Nicolas Ferre
@ 2013-08-28 19:22 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2013-08-28 19:22 UTC (permalink / raw)
To: Boris BREZILLON
Cc: Jean-Christophe Plagniol-Villard, Stephen Warren, Nicolas Ferre,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
On Tue, Aug 27, 2013 at 3:19 PM, Boris BREZILLON
<b.brezillon@overkiz.com> wrote:
> In PIO_PUSR and PIO_PPDSR register if a given bit is set 1 this means the
> pullup/down for this pin (pin is represented as a bit position) is
> disabled.
>
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
Patch applied, tagged for stable.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-28 19:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-27 13:19 [PATCH] pinctrl: at91: fix get_pullup/down function return Boris BREZILLON
2013-08-27 14:56 ` Nicolas Ferre
2013-08-28 19:22 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox