aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHartley Sweeten <hartleys@visionengravers.com>2009-06-26 16:40:34 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-06-27 05:41:14 -0400
commitf04989bbf4a40077dc7ddcc3dccde11a5f3e91f2 (patch)
tree6a7c93b9d465dd88d1eec7fbf923b11b086397a0 /arch
parentddf4f3d994651ee2924432a618d9caefed411dc1 (diff)
[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>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-ep93xx/gpio.c56
1 files changed, 51 insertions, 5 deletions
diff --git a/arch/arm/mach-ep93xx/gpio.c b/arch/arm/mach-ep93xx/gpio.c
index 7b7a564916f3..2d83d69e2eed 100644
--- a/arch/arm/mach-ep93xx/gpio.c
+++ b/arch/arm/mach-ep93xx/gpio.c
@@ -111,15 +111,61 @@ static void ep93xx_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
111{ 111{
112 struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip); 112 struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip);
113 u8 data_reg, data_dir_reg; 113 u8 data_reg, data_dir_reg;
114 int i; 114 int gpio, i;
115 115
116 data_reg = __raw_readb(ep93xx_chip->data_reg); 116 data_reg = __raw_readb(ep93xx_chip->data_reg);
117 data_dir_reg = __raw_readb(ep93xx_chip->data_dir_reg); 117 data_dir_reg = __raw_readb(ep93xx_chip->data_dir_reg);
118 118
119 for (i = 0; i < chip->ngpio; i++) 119 gpio = ep93xx_chip->chip.base;
120 seq_printf(s, "GPIO %s%d: %s %s\n", chip->label, i, 120 for (i = 0; i < chip->ngpio; i++, gpio++) {
121 (data_reg & (1 << i)) ? "set" : "clear", 121 int is_out = data_dir_reg & (1 << i);
122 (data_dir_reg & (1 << i)) ? "out" : "in"); 122
123 seq_printf(s, " %s%d gpio-%-3d (%-12s) %s %s",
124 chip->label, i, gpio,
125 gpiochip_is_requested(chip, i) ? : "",
126 is_out ? "out" : "in ",
127 (data_reg & (1 << i)) ? "hi" : "lo");
128
129 if (!is_out) {
130 int irq = gpio_to_irq(gpio);
131 struct irq_desc *desc = irq_desc + irq;
132
133 if (irq >= 0 && desc->action) {
134 char *trigger;
135
136 switch (desc->status & IRQ_TYPE_SENSE_MASK) {
137 case IRQ_TYPE_NONE:
138 trigger = "(default)";
139 break;
140 case IRQ_TYPE_EDGE_FALLING:
141 trigger = "edge-falling";
142 break;
143 case IRQ_TYPE_EDGE_RISING:
144 trigger = "edge-rising";
145 break;
146 case IRQ_TYPE_EDGE_BOTH:
147 trigger = "edge-both";
148 break;
149 case IRQ_TYPE_LEVEL_HIGH:
150 trigger = "level-high";
151 break;
152 case IRQ_TYPE_LEVEL_LOW:
153 trigger = "level-low";
154 break;
155 default:
156 trigger = "?trigger?";
157 break;
158 }
159
160 seq_printf(s, " irq-%d %s%s",
161 irq, trigger,
162 (desc->status & IRQ_WAKEUP)
163 ? " wakeup" : "");
164 }
165 }
166
167 seq_printf(s, "\n");
168 }
123} 169}
124 170
125#define EP93XX_GPIO_BANK(name, dr, ddr, base_gpio) \ 171#define EP93XX_GPIO_BANK(name, dr, ddr, base_gpio) \