diff options
author | Thierry Reding <treding@nvidia.com> | 2017-11-07 19:15:46 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-11-08 13:59:24 +0100 |
commit | da80ff81a8f54611b834d73149f8ac0d59151c87 (patch) | |
tree | 2c902035b3cf4945a17715440691fcaf6faacdb6 /include/linux/gpio/driver.h | |
parent | c44eafd79be666e7c81d22e215c945b27f2785f7 (diff) |
gpio: Move irqchip into struct gpio_irq_chip
In order to consolidate the multiple ways to associate an IRQ chip with
a GPIO chip, move more fields into the new struct gpio_irq_chip.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Acked-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/linux/gpio/driver.h')
-rw-r--r-- | include/linux/gpio/driver.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 36a065521fa0..a79b3b18fadd 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -25,6 +25,13 @@ struct module; */ struct gpio_irq_chip { /** + * @chip: + * + * GPIO IRQ chip implementation, provided by GPIO driver. + */ + struct irq_chip *chip; + + /** * @domain_ops: * * Table of interrupt domain operations for this IRQ chip. @@ -47,6 +54,11 @@ struct gpio_irq_chip { */ void *parent_handler_data; }; + +static inline struct gpio_irq_chip *to_gpio_irq_chip(struct irq_chip *chip) +{ + return container_of(chip, struct gpio_irq_chip, chip); +} #endif /** @@ -112,7 +124,6 @@ struct gpio_irq_chip { * safely. * @bgpio_dir: shadowed direction register for generic GPIO to clear/set * direction safely. - * @irqchip: GPIO IRQ chip impl, provided by GPIO driver * @irqdomain: Interrupt translation domain; responsible for mapping * between GPIO hwirq number and linux irq number * @irq_handler: the irq handler to use (often a predefined irq core function) @@ -197,7 +208,6 @@ struct gpio_chip { * With CONFIG_GPIOLIB_IRQCHIP we get an irqchip inside the gpiolib * to handle IRQs for most practical cases. */ - struct irq_chip *irqchip; struct irq_domain *irqdomain; irq_flow_handler_t irq_handler; unsigned int irq_default_type; |