Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: Slightly more helpful debugfs

This at least makes debugfs print if the line is active
high or low. That is pretty helpful as what we display
as "lo" or "hi" is the raw physical level of the line.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

+7 -4
+7 -4
drivers/gpio/gpiolib.c
··· 4584 4584 struct gpio_chip *chip = gdev->chip; 4585 4585 unsigned gpio = gdev->base; 4586 4586 struct gpio_desc *gdesc = &gdev->descs[0]; 4587 - int is_out; 4588 - int is_irq; 4587 + bool is_out; 4588 + bool is_irq; 4589 + bool active_low; 4589 4590 4590 4591 for (i = 0; i < gdev->ngpio; i++, gpio++, gdesc++) { 4591 4592 if (!test_bit(FLAG_REQUESTED, &gdesc->flags)) { ··· 4600 4599 gpiod_get_direction(gdesc); 4601 4600 is_out = test_bit(FLAG_IS_OUT, &gdesc->flags); 4602 4601 is_irq = test_bit(FLAG_USED_AS_IRQ, &gdesc->flags); 4603 - seq_printf(s, " gpio-%-3d (%-20.20s|%-20.20s) %s %s %s", 4602 + active_low = test_bit(FLAG_ACTIVE_LOW, &gdesc->flags); 4603 + seq_printf(s, " gpio-%-3d (%-20.20s|%-20.20s) %s %s %s%s", 4604 4604 gpio, gdesc->name ? gdesc->name : "", gdesc->label, 4605 4605 is_out ? "out" : "in ", 4606 4606 chip->get ? (chip->get(chip, i) ? "hi" : "lo") : "? ", 4607 - is_irq ? "IRQ" : " "); 4607 + is_irq ? "IRQ " : "", 4608 + active_low ? "ACTIVE LOW" : ""); 4608 4609 seq_printf(s, "\n"); 4609 4610 } 4610 4611 }