From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pinctrl: at91: enhance (debugfs) at91_gpio_dbg_show
Date: Tue, 2 Dec 2014 15:58:11 +0100 [thread overview]
Message-ID: <547DD383.3030307@atmel.com> (raw)
In-Reply-To: <1416321825-17776-1-git-send-email-nicolas.ferre@atmel.com>
Le 18/11/2014 15:43, Nicolas Ferre a ?crit :
> From: Matthieu Crapet <mcrapet@gmail.com>
>
> When a pin is configured as GPIO, print also direction (input or output).
>
> Signed-off-by: Matthieu Crapet <mcrapet@gmail.com>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> drivers/pinctrl/pinctrl-at91.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
Linus, ping?
> diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
> index 354a81d40925..a6b29ebc3cc3 100644
> --- a/drivers/pinctrl/pinctrl-at91.c
> +++ b/drivers/pinctrl/pinctrl-at91.c
> @@ -1344,7 +1344,6 @@ static void at91_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
> for (i = 0; i < chip->ngpio; i++) {
> unsigned mask = pin_to_mask(i);
> const char *gpio_label;
> - u32 pdsr;
>
> gpio_label = gpiochip_is_requested(chip, i);
> if (!gpio_label)
> @@ -1353,11 +1352,13 @@ static void at91_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
> seq_printf(s, "[%s] GPIO%s%d: ",
> gpio_label, chip->label, i);
> if (mode == AT91_MUX_GPIO) {
> - pdsr = readl_relaxed(pio + PIO_PDSR);
> -
> - seq_printf(s, "[gpio] %s\n",
> - pdsr & mask ?
> - "set" : "clear");
> + seq_printf(s, "[gpio] ");
> + seq_printf(s, "%s ",
> + readl_relaxed(pio + PIO_OSR) & mask ?
> + "output" : "input");
> + seq_printf(s, "%s\n",
> + readl_relaxed(pio + PIO_PDSR) & mask ?
> + "set" : "clear");
> } else {
> seq_printf(s, "[periph %c]\n",
> mode + 'A' - 1);
>
--
Nicolas Ferre
next prev parent reply other threads:[~2014-12-02 14:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-18 14:43 [PATCH] pinctrl: at91: enhance (debugfs) at91_gpio_dbg_show Nicolas Ferre
2014-12-02 14:58 ` Nicolas Ferre [this message]
2014-12-03 11:23 ` 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=547DD383.3030307@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).