pinctrl-baytrail: show pin label with the reset of the gpio debug data
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 22 Nov 2013 12:01:23 +0000 (14:01 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 3 Dec 2013 09:08:46 +0000 (10:08 +0100)
The default gpiolib debug output shows pin labels.
We want baytrail custom debug output to have the same functionality.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-baytrail.c

index 2832576d8b12ee7c99e24896c3fe333dd8cffadc..1174ea86b6e964272d05167b4590c47abd47cac6 100644 (file)
@@ -286,13 +286,19 @@ static void byt_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
        spin_lock_irqsave(&vg->lock, flags);
 
        for (i = 0; i < vg->chip.ngpio; i++) {
+               const char *label;
                offs = vg->range->pins[i] * 16;
                conf0 = readl(vg->reg_base + offs + BYT_CONF0_REG);
                val = readl(vg->reg_base + offs + BYT_VAL_REG);
 
+               label = gpiochip_is_requested(chip, i);
+               if (!label)
+                       label = "Unrequested";
+
                seq_printf(s,
-                          " gpio-%-3d %s %s %s pad-%-3d offset:0x%03x mux:%d %s%s%s\n",
+                          " gpio-%-3d (%-20.20s) %s %s %s pad-%-3d offset:0x%03x mux:%d %s%s%s\n",
                           i,
+                          label,
                           val & BYT_INPUT_EN ? "  " : "in",
                           val & BYT_OUTPUT_EN ? "   " : "out",
                           val & BYT_LEVEL ? "hi" : "lo",