mirror of
https://github.com/torvalds/linux.git
synced 2024-11-05 03:21:32 +00:00
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>
This commit is contained in:
parent
ae76f13b9b
commit
853b6bf044
@ -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++) {
|
for (i = 0; i < chip->ngpio; i++) {
|
||||||
unsigned mask = pin_to_mask(i);
|
unsigned mask = pin_to_mask(i);
|
||||||
const char *gpio_label;
|
const char *gpio_label;
|
||||||
u32 pdsr;
|
|
||||||
|
|
||||||
gpio_label = gpiochip_is_requested(chip, i);
|
gpio_label = gpiochip_is_requested(chip, i);
|
||||||
if (!gpio_label)
|
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: ",
|
seq_printf(s, "[%s] GPIO%s%d: ",
|
||||||
gpio_label, chip->label, i);
|
gpio_label, chip->label, i);
|
||||||
if (mode == AT91_MUX_GPIO) {
|
if (mode == AT91_MUX_GPIO) {
|
||||||
pdsr = readl_relaxed(pio + PIO_PDSR);
|
seq_printf(s, "[gpio] ");
|
||||||
|
seq_printf(s, "%s ",
|
||||||
seq_printf(s, "[gpio] %s\n",
|
readl_relaxed(pio + PIO_OSR) & mask ?
|
||||||
pdsr & mask ?
|
"output" : "input");
|
||||||
"set" : "clear");
|
seq_printf(s, "%s\n",
|
||||||
|
readl_relaxed(pio + PIO_PDSR) & mask ?
|
||||||
|
"set" : "clear");
|
||||||
} else {
|
} else {
|
||||||
seq_printf(s, "[periph %c]\n",
|
seq_printf(s, "[periph %c]\n",
|
||||||
mode + 'A' - 1);
|
mode + 'A' - 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user