Commit b551b023 authored by Linus Walleij's avatar Linus Walleij

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: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent ba519dd4
...@@ -242,26 +242,27 @@ static int lp_gpio_to_irq(struct gpio_chip *chip, unsigned offset) ...@@ -242,26 +242,27 @@ static int lp_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
return irq_create_mapping(lg->domain, offset); return irq_create_mapping(lg->domain, offset);
} }
static void lp_gpio_irq_handler(unsigned irq, struct irq_desc *desc) static void lp_gpio_irq_handler(unsigned hwirq, struct irq_desc *desc)
{ {
struct irq_data *data = irq_desc_get_irq_data(desc); struct irq_data *data = irq_desc_get_irq_data(desc);
struct lp_gpio *lg = irq_data_get_irq_handler_data(data); struct lp_gpio *lg = irq_data_get_irq_handler_data(data);
struct irq_chip *chip = irq_data_get_irq_chip(data); struct irq_chip *chip = irq_data_get_irq_chip(data);
u32 base, pin, mask; u32 base, pin, mask;
unsigned long reg, pending; unsigned long reg, pending;
unsigned virq;
/* check from GPIO controller which pin triggered the interrupt */ /* check from GPIO controller which pin triggered the interrupt */
for (base = 0; base < lg->chip.ngpio; base += 32) { for (base = 0; base < lg->chip.ngpio; base += 32) {
reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT); reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT);
while ((pending = inl(reg))) { while ((pending = inl(reg))) {
unsigned irq;
pin = __ffs(pending); pin = __ffs(pending);
mask = BIT(pin); mask = BIT(pin);
/* Clear before handling so we don't lose an edge */ /* Clear before handling so we don't lose an edge */
outl(mask, reg); outl(mask, reg);
virq = irq_find_mapping(lg->domain, base + pin); irq = irq_find_mapping(lg->domain, base + pin);
generic_handle_irq(virq); generic_handle_irq(irq);
} }
} }
chip->irq_eoi(data); chip->irq_eoi(data);
...@@ -324,15 +325,15 @@ static void lp_gpio_irq_init_hw(struct lp_gpio *lg) ...@@ -324,15 +325,15 @@ static void lp_gpio_irq_init_hw(struct lp_gpio *lg)
} }
} }
static int lp_gpio_irq_map(struct irq_domain *d, unsigned int virq, static int lp_gpio_irq_map(struct irq_domain *d, unsigned int irq,
irq_hw_number_t hw) irq_hw_number_t hwirq)
{ {
struct lp_gpio *lg = d->host_data; struct lp_gpio *lg = d->host_data;
irq_set_chip_and_handler_name(virq, &lp_irqchip, handle_simple_irq, irq_set_chip_and_handler_name(irq, &lp_irqchip, handle_simple_irq,
"demux"); "demux");
irq_set_chip_data(virq, lg); irq_set_chip_data(irq, lg);
irq_set_irq_type(virq, IRQ_TYPE_NONE); irq_set_irq_type(irq, IRQ_TYPE_NONE);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment