[ARM] 5575/1: ep93xx: Show gpio interrupt type in debugfs output.
ep93xx: Show gpio interrupt type in debugfs output. EP93xx uses a private implementation for the debugfs output. Modify this output so it includes the interrupt type when the gpio is configured as an interrupt Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-by: Ryan Mallon <ryan@bluewatersys.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
ddf4f3d994
commit
f04989bbf4
|
@ -111,15 +111,61 @@ static void ep93xx_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
|
|||
{
|
||||
struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip);
|
||||
u8 data_reg, data_dir_reg;
|
||||
int i;
|
||||
int gpio, i;
|
||||
|
||||
data_reg = __raw_readb(ep93xx_chip->data_reg);
|
||||
data_dir_reg = __raw_readb(ep93xx_chip->data_dir_reg);
|
||||
|
||||
for (i = 0; i < chip->ngpio; i++)
|
||||
seq_printf(s, "GPIO %s%d: %s %s\n", chip->label, i,
|
||||
(data_reg & (1 << i)) ? "set" : "clear",
|
||||
(data_dir_reg & (1 << i)) ? "out" : "in");
|
||||
gpio = ep93xx_chip->chip.base;
|
||||
for (i = 0; i < chip->ngpio; i++, gpio++) {
|
||||
int is_out = data_dir_reg & (1 << i);
|
||||
|
||||
seq_printf(s, " %s%d gpio-%-3d (%-12s) %s %s",
|
||||
chip->label, i, gpio,
|
||||
gpiochip_is_requested(chip, i) ? : "",
|
||||
is_out ? "out" : "in ",
|
||||
(data_reg & (1 << i)) ? "hi" : "lo");
|
||||
|
||||
if (!is_out) {
|
||||
int irq = gpio_to_irq(gpio);
|
||||
struct irq_desc *desc = irq_desc + irq;
|
||||
|
||||
if (irq >= 0 && desc->action) {
|
||||
char *trigger;
|
||||
|
||||
switch (desc->status & IRQ_TYPE_SENSE_MASK) {
|
||||
case IRQ_TYPE_NONE:
|
||||
trigger = "(default)";
|
||||
break;
|
||||
case IRQ_TYPE_EDGE_FALLING:
|
||||
trigger = "edge-falling";
|
||||
break;
|
||||
case IRQ_TYPE_EDGE_RISING:
|
||||
trigger = "edge-rising";
|
||||
break;
|
||||
case IRQ_TYPE_EDGE_BOTH:
|
||||
trigger = "edge-both";
|
||||
break;
|
||||
case IRQ_TYPE_LEVEL_HIGH:
|
||||
trigger = "level-high";
|
||||
break;
|
||||
case IRQ_TYPE_LEVEL_LOW:
|
||||
trigger = "level-low";
|
||||
break;
|
||||
default:
|
||||
trigger = "?trigger?";
|
||||
break;
|
||||
}
|
||||
|
||||
seq_printf(s, " irq-%d %s%s",
|
||||
irq, trigger,
|
||||
(desc->status & IRQ_WAKEUP)
|
||||
? " wakeup" : "");
|
||||
}
|
||||
}
|
||||
|
||||
seq_printf(s, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
#define EP93XX_GPIO_BANK(name, dr, ddr, base_gpio) \
|
||||
|
|
Loading…
Reference in a new issue