if (((pdata && pdata->irq_base) || client->irq)
&& has_irq != INT_NONE) {
+ struct gpio_irq_chip *girq;
+
if (pdata)
irq_base = pdata->irq_base;
chip->irq_features = has_irq;
client->irq);
return ret;
}
- ret = gpiochip_irqchip_add_nested(&chip->gpio_chip,
- &max732x_irq_chip,
- irq_base,
- handle_simple_irq,
- IRQ_TYPE_NONE);
- if (ret) {
- dev_err(&client->dev,
- "could not connect irqchip to gpiochip\n");
- return ret;
- }
- gpiochip_set_nested_irqchip(&chip->gpio_chip,
- &max732x_irq_chip,
- client->irq);
+
+ girq = &chip->gpio_chip.irq;
+ girq->chip = &max732x_irq_chip;
+ /* This will let us handle the parent IRQ in the driver */
+ girq->parent_handler = NULL;
+ girq->num_parents = 0;
+ girq->parents = NULL;
+ girq->default_type = IRQ_TYPE_NONE;
+ girq->handler = handle_simple_irq;
+ girq->threaded = true;
+ girq->first = irq_base; /* FIXME: get rid of this */
}
return 0;
return ret;
}
- ret = devm_gpiochip_add_data(&client->dev, &chip->gpio_chip, chip);
+ ret = max732x_irq_setup(chip, id);
if (ret)
return ret;
- ret = max732x_irq_setup(chip, id);
+ ret = devm_gpiochip_add_data(&client->dev, &chip->gpio_chip, chip);
if (ret)
return ret;