aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-10-11 13:32:16 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-10-16 03:59:52 -0400
commitb551b023bdeb28fe81ab522b25e89f85c6418198 (patch)
treea9eac1671a3cd3286d1fca79c696c7834fd72910 /drivers/gpio
parentba519dd46c46fb923b531ef833aac074cb0114b3 (diff)
gpio: lynxpoint: drop references to "virtual" IRQ
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. Take this opportunity to sink a variable into a loop. Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-lynxpoint.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/gpio/gpio-lynxpoint.c b/drivers/gpio/gpio-lynxpoint.c
index 2d9ca6055e5e..21603e6aceaf 100644
--- a/drivers/gpio/gpio-lynxpoint.c
+++ b/drivers/gpio/gpio-lynxpoint.c
@@ -242,26 +242,27 @@ static int lp_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
242 return irq_create_mapping(lg->domain, offset); 242 return irq_create_mapping(lg->domain, offset);
243} 243}
244 244
245static void lp_gpio_irq_handler(unsigned irq, struct irq_desc *desc) 245static void lp_gpio_irq_handler(unsigned hwirq, struct irq_desc *desc)
246{ 246{
247 struct irq_data *data = irq_desc_get_irq_data(desc); 247 struct irq_data *data = irq_desc_get_irq_data(desc);
248 struct lp_gpio *lg = irq_data_get_irq_handler_data(data); 248 struct lp_gpio *lg = irq_data_get_irq_handler_data(data);
249 struct irq_chip *chip = irq_data_get_irq_chip(data); 249 struct irq_chip *chip = irq_data_get_irq_chip(data);
250 u32 base, pin, mask; 250 u32 base, pin, mask;
251 unsigned long reg, pending; 251 unsigned long reg, pending;
252 unsigned virq;
253 252
254 /* check from GPIO controller which pin triggered the interrupt */ 253 /* check from GPIO controller which pin triggered the interrupt */
255 for (base = 0; base < lg->chip.ngpio; base += 32) { 254 for (base = 0; base < lg->chip.ngpio; base += 32) {
256 reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT); 255 reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT);
257 256
258 while ((pending = inl(reg))) { 257 while ((pending = inl(reg))) {
258 unsigned irq;
259
259 pin = __ffs(pending); 260 pin = __ffs(pending);
260 mask = BIT(pin); 261 mask = BIT(pin);
261 /* Clear before handling so we don't lose an edge */ 262 /* Clear before handling so we don't lose an edge */
262 outl(mask, reg); 263 outl(mask, reg);
263 virq = irq_find_mapping(lg->domain, base + pin); 264 irq = irq_find_mapping(lg->domain, base + pin);
264 generic_handle_irq(virq); 265 generic_handle_irq(irq);
265 } 266 }
266 } 267 }
267 chip->irq_eoi(data); 268 chip->irq_eoi(data);
@@ -324,15 +325,15 @@ static void lp_gpio_irq_init_hw(struct lp_gpio *lg)
324 } 325 }
325} 326}
326 327
327static int lp_gpio_irq_map(struct irq_domain *d, unsigned int virq, 328static int lp_gpio_irq_map(struct irq_domain *d, unsigned int irq,
328 irq_hw_number_t hw) 329 irq_hw_number_t hwirq)
329{ 330{
330 struct lp_gpio *lg = d->host_data; 331 struct lp_gpio *lg = d->host_data;
331 332
332 irq_set_chip_and_handler_name(virq, &lp_irqchip, handle_simple_irq, 333 irq_set_chip_and_handler_name(irq, &lp_irqchip, handle_simple_irq,
333 "demux"); 334 "demux");
334 irq_set_chip_data(virq, lg); 335 irq_set_chip_data(irq, lg);
335 irq_set_irq_type(virq, IRQ_TYPE_NONE); 336 irq_set_irq_type(irq, IRQ_TYPE_NONE);
336 337
337 return 0; 338 return 0;
338} 339}