aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-stmpe.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-10-11 13:51:38 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-10-16 03:59:53 -0400
commited05e204af5a2a7814858407bfd698d51e31f938 (patch)
treef13c8d098a36c5e375f75c5c77afe55e2f723227 /drivers/gpio/gpio-stmpe.c
parentc0d6c1ad0ad8fa1b7c2148ba918fd5d64a51166a (diff)
gpio: stmpe: drop references to "virtual" IRQ, fix bug
Rename the argument "virq" to just "irq", this IRQ isn't any more "virtual" than any other Linux IRQ number, we use "hwirq" for the actual hw-numbers, "virq" is just bogus. When doing this I see that the hwirq argument is used for mapping rather than the Linux IRQ in the map function. This doesn't look right. Use the Linux IRQ instead. I cannot test this patch so I don't know if the mapping change is correct, however since absolutely every other driver does it the other way around this doesn't look sound at all. Please help out with review. Cc: Vipul Kumar Samar <vipulkumar.samar@st.com> Cc: Lee Jones <lee.jones@linaro.org> Cc: Gabriel Fernandez <gabriel.fernandez@st.com> Cc: Jean-Nicolas Graux <jean-nicolas.graux@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-stmpe.c')
-rw-r--r--drivers/gpio/gpio-stmpe.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c
index b33bad1bb4df..2647e243d471 100644
--- a/drivers/gpio/gpio-stmpe.c
+++ b/drivers/gpio/gpio-stmpe.c
@@ -254,9 +254,10 @@ static irqreturn_t stmpe_gpio_irq(int irq, void *dev)
254 while (stat) { 254 while (stat) {
255 int bit = __ffs(stat); 255 int bit = __ffs(stat);
256 int line = bank * 8 + bit; 256 int line = bank * 8 + bit;
257 int virq = irq_find_mapping(stmpe_gpio->domain, line); 257 int child_irq = irq_find_mapping(stmpe_gpio->domain,
258 line);
258 259
259 handle_nested_irq(virq); 260 handle_nested_irq(child_irq);
260 stat &= ~(1 << bit); 261 stat &= ~(1 << bit);
261 } 262 }
262 263
@@ -271,7 +272,7 @@ static irqreturn_t stmpe_gpio_irq(int irq, void *dev)
271 return IRQ_HANDLED; 272 return IRQ_HANDLED;
272} 273}
273 274
274static int stmpe_gpio_irq_map(struct irq_domain *d, unsigned int virq, 275static int stmpe_gpio_irq_map(struct irq_domain *d, unsigned int irq,
275 irq_hw_number_t hwirq) 276 irq_hw_number_t hwirq)
276{ 277{
277 struct stmpe_gpio *stmpe_gpio = d->host_data; 278 struct stmpe_gpio *stmpe_gpio = d->host_data;
@@ -279,26 +280,26 @@ static int stmpe_gpio_irq_map(struct irq_domain *d, unsigned int virq,
279 if (!stmpe_gpio) 280 if (!stmpe_gpio)
280 return -EINVAL; 281 return -EINVAL;
281 282
282 irq_set_chip_data(hwirq, stmpe_gpio); 283 irq_set_chip_data(irq, stmpe_gpio);
283 irq_set_chip_and_handler(hwirq, &stmpe_gpio_irq_chip, 284 irq_set_chip_and_handler(irq, &stmpe_gpio_irq_chip,
284 handle_simple_irq); 285 handle_simple_irq);
285 irq_set_nested_thread(hwirq, 1); 286 irq_set_nested_thread(irq, 1);
286#ifdef CONFIG_ARM 287#ifdef CONFIG_ARM
287 set_irq_flags(hwirq, IRQF_VALID); 288 set_irq_flags(irq, IRQF_VALID);
288#else 289#else
289 irq_set_noprobe(hwirq); 290 irq_set_noprobe(irq);
290#endif 291#endif
291 292
292 return 0; 293 return 0;
293} 294}
294 295
295static void stmpe_gpio_irq_unmap(struct irq_domain *d, unsigned int virq) 296static void stmpe_gpio_irq_unmap(struct irq_domain *d, unsigned int irq)
296{ 297{
297#ifdef CONFIG_ARM 298#ifdef CONFIG_ARM
298 set_irq_flags(virq, 0); 299 set_irq_flags(irq, 0);
299#endif 300#endif
300 irq_set_chip_and_handler(virq, NULL, NULL); 301 irq_set_chip_and_handler(irq, NULL, NULL);
301 irq_set_chip_data(virq, NULL); 302 irq_set_chip_data(irq, NULL);
302} 303}
303 304
304static const struct irq_domain_ops stmpe_gpio_irq_simple_ops = { 305static const struct irq_domain_ops stmpe_gpio_irq_simple_ops = {