diff options
-rw-r--r-- | drivers/gpio/gpio-davinci.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c index df0d59570a84..a6777e5e0ced 100644 --- a/drivers/gpio/gpio-davinci.c +++ b/drivers/gpio/gpio-davinci.c | |||
@@ -313,10 +313,16 @@ static int gpio_to_irq_unbanked(struct gpio_chip *chip, unsigned offset) | |||
313 | return -ENODEV; | 313 | return -ENODEV; |
314 | } | 314 | } |
315 | 315 | ||
316 | static int gpio_irq_type_unbanked(struct irq_data *d, unsigned trigger) | 316 | static int gpio_irq_type_unbanked(struct irq_data *data, unsigned trigger) |
317 | { | 317 | { |
318 | struct davinci_gpio_regs __iomem *g = irq2regs(d->irq); | 318 | struct davinci_gpio_controller *d; |
319 | u32 mask = (u32) irq_data_get_irq_handler_data(d); | 319 | struct davinci_gpio_regs __iomem *g; |
320 | struct davinci_soc_info *soc_info = &davinci_soc_info; | ||
321 | u32 mask; | ||
322 | |||
323 | d = (struct davinci_gpio_controller *)data->handler_data; | ||
324 | g = (struct davinci_gpio_regs __iomem *)d->regs; | ||
325 | mask = __gpio_mask(data->irq - soc_info->gpio_irq); | ||
320 | 326 | ||
321 | if (trigger & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) | 327 | if (trigger & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) |
322 | return -EINVAL; | 328 | return -EINVAL; |
@@ -400,8 +406,7 @@ static int __init davinci_gpio_irq_setup(void) | |||
400 | /* set the direct IRQs up to use that irqchip */ | 406 | /* set the direct IRQs up to use that irqchip */ |
401 | for (gpio = 0; gpio < soc_info->gpio_unbanked; gpio++, irq++) { | 407 | for (gpio = 0; gpio < soc_info->gpio_unbanked; gpio++, irq++) { |
402 | irq_set_chip(irq, &gpio_irqchip_unbanked); | 408 | irq_set_chip(irq, &gpio_irqchip_unbanked); |
403 | irq_set_handler_data(irq, (void *)__gpio_mask(gpio)); | 409 | irq_set_handler_data(irq, &chips[gpio / 32]); |
404 | irq_set_chip_data(irq, (__force void *)g); | ||
405 | irq_set_status_flags(irq, IRQ_TYPE_EDGE_BOTH); | 410 | irq_set_status_flags(irq, IRQ_TYPE_EDGE_BOTH); |
406 | } | 411 | } |
407 | 412 | ||