diff options
author | Matthieu Crapet <mcrapet@gmail.com> | 2014-11-18 15:43:45 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-12-03 12:23:10 +0100 |
commit | 853b6bf044dcced57c523dbddabf8942e907be6e (patch) | |
tree | a1074b99dabb6b6e713a30b5844fc63ae27dd3bd /drivers/pinctrl/pinctrl-at91.c | |
parent | ae76f13b9b4931cf143670524a6c68b891fd30bc (diff) | |
download | op-kernel-dev-853b6bf044dcced57c523dbddabf8942e907be6e.zip op-kernel-dev-853b6bf044dcced57c523dbddabf8942e907be6e.tar.gz |
pinctrl: at91: enhance (debugfs) at91_gpio_dbg_show
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>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-at91.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-at91.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index 94643bb..66db984 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c @@ -1342,7 +1342,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) @@ -1351,11 +1350,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); |