From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pinctrl: at91: disable Pull-Down or Pull-Up property before enabling Pull-Up or Pull-Down.
Date: Thu, 11 Sep 2014 18:27:07 +0200 [thread overview]
Message-ID: <5411CD5B.4080705@atmel.com> (raw)
In-Reply-To: <1410446415-29410-1-git-send-email-alexandre.belloni@free-electrons.com>
On 11/09/2014 16:40, Alexandre Belloni :
> From: Wenyou Yang <wenyou.yang@atmel.com>
>
> Because the pin's Pull-Up and Pull-Down property is mutually exclusive.
>
> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Yes, indeed:
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> drivers/pinctrl/pinctrl-at91.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
> index a3d8902438c7..ee9c0b7aad14 100644
> --- a/drivers/pinctrl/pinctrl-at91.c
> +++ b/drivers/pinctrl/pinctrl-at91.c
> @@ -371,6 +371,9 @@ static unsigned at91_mux_get_pullup(void __iomem *pio, unsigned pin)
>
> static void at91_mux_set_pullup(void __iomem *pio, unsigned mask, bool on)
> {
> + if (on)
> + writel_relaxed(mask, pio + PIO_PPDDR);
> +
> writel_relaxed(mask, pio + (on ? PIO_PUER : PIO_PUDR));
> }
>
> @@ -499,6 +502,9 @@ static bool at91_mux_pio3_get_pulldown(void __iomem *pio, unsigned pin)
>
> static void at91_mux_pio3_set_pulldown(void __iomem *pio, unsigned mask, bool is_on)
> {
> + if (is_on)
> + __raw_writel(mask, pio + PIO_PUDR);
> +
> __raw_writel(mask, pio + (is_on ? PIO_PPDER : PIO_PPDDR));
> }
>
>
--
Nicolas Ferre
next prev parent reply other threads:[~2014-09-11 16:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-11 14:40 [PATCH] pinctrl: at91: disable Pull-Down or Pull-Up property before enabling Pull-Up or Pull-Down Alexandre Belloni
2014-09-11 16:27 ` Nicolas Ferre [this message]
2014-09-23 15:00 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5411CD5B.4080705@atmel.com \
--to=nicolas.ferre@atmel.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).