aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorMatthieu Crapet <mcrapet@gmail.com>2014-11-18 09:43:45 -0500
committerLinus Walleij <linus.walleij@linaro.org>2014-12-03 06:23:10 -0500
commit853b6bf044dcced57c523dbddabf8942e907be6e (patch)
treea1074b99dabb6b6e713a30b5844fc63ae27dd3bd /drivers/pinctrl
parentae76f13b9b4931cf143670524a6c68b891fd30bc (diff)
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')
-rw-r--r--drivers/pinctrl/pinctrl-at91.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 94643bbaee37..66db9849aca8 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)
1342 for (i = 0; i < chip->ngpio; i++) { 1342 for (i = 0; i < chip->ngpio; i++) {
1343 unsigned mask = pin_to_mask(i); 1343 unsigned mask = pin_to_mask(i);
1344 const char *gpio_label; 1344 const char *gpio_label;
1345 u32 pdsr;
1346 1345
1347 gpio_label = gpiochip_is_requested(chip, i); 1346 gpio_label = gpiochip_is_requested(chip, i);
1348 if (!gpio_label) 1347 if (!gpio_label)
@@ -1351,11 +1350,13 @@ static void at91_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
1351 seq_printf(s, "[%s] GPIO%s%d: ", 1350 seq_printf(s, "[%s] GPIO%s%d: ",
1352 gpio_label, chip->label, i); 1351 gpio_label, chip->label, i);
1353 if (mode == AT91_MUX_GPIO) { 1352 if (mode == AT91_MUX_GPIO) {
1354 pdsr = readl_relaxed(pio + PIO_PDSR); 1353 seq_printf(s, "[gpio] ");
1355 1354 seq_printf(s, "%s ",
1356 seq_printf(s, "[gpio] %s\n", 1355 readl_relaxed(pio + PIO_OSR) & mask ?
1357 pdsr & mask ? 1356 "output" : "input");
1358 "set" : "clear"); 1357 seq_printf(s, "%s\n",
1358 readl_relaxed(pio + PIO_PDSR) & mask ?
1359 "set" : "clear");
1359 } else { 1360 } else {
1360 seq_printf(s, "[periph %c]\n", 1361 seq_printf(s, "[periph %c]\n",
1361 mode + 'A' - 1); 1362 mode + 'A' - 1);