aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/gpio/driver.h
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2017-11-07 13:15:46 -0500
committerLinus Walleij <linus.walleij@linaro.org>2017-11-08 07:59:24 -0500
commitda80ff81a8f54611b834d73149f8ac0d59151c87 (patch)
tree2c902035b3cf4945a17715440691fcaf6faacdb6 /include/linux/gpio/driver.h
parentc44eafd79be666e7c81d22e215c945b27f2785f7 (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.h14
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;
25 */ 25 */
26struct gpio_irq_chip { 26struct gpio_irq_chip {
27 /** 27 /**
28 * @chip:
29 *
30 * GPIO IRQ chip implementation, provided by GPIO driver.
31 */
32 struct irq_chip *chip;
33
34 /**
28 * @domain_ops: 35 * @domain_ops:
29 * 36 *
30 * Table of interrupt domain operations for this IRQ chip. 37 * Table of interrupt domain operations for this IRQ chip.
@@ -47,6 +54,11 @@ struct gpio_irq_chip {
47 */ 54 */
48 void *parent_handler_data; 55 void *parent_handler_data;
49}; 56};
57
58static inline struct gpio_irq_chip *to_gpio_irq_chip(struct irq_chip *chip)
59{
60 return container_of(chip, struct gpio_irq_chip, chip);
61}
50#endif 62#endif
51 63
52/** 64/**
@@ -112,7 +124,6 @@ struct gpio_irq_chip {
112 * safely. 124 * safely.
113 * @bgpio_dir: shadowed direction register for generic GPIO to clear/set 125 * @bgpio_dir: shadowed direction register for generic GPIO to clear/set
114 * direction safely. 126 * direction safely.
115 * @irqchip: GPIO IRQ chip impl, provided by GPIO driver
116 * @irqdomain: Interrupt translation domain; responsible for mapping 127 * @irqdomain: Interrupt translation domain; responsible for mapping
117 * between GPIO hwirq number and linux irq number 128 * between GPIO hwirq number and linux irq number
118 * @irq_handler: the irq handler to use (often a predefined irq core function) 129 * @irq_handler: the irq handler to use (often a predefined irq core function)
@@ -197,7 +208,6 @@ struct gpio_chip {
197 * With CONFIG_GPIOLIB_IRQCHIP we get an irqchip inside the gpiolib 208 * With CONFIG_GPIOLIB_IRQCHIP we get an irqchip inside the gpiolib
198 * to handle IRQs for most practical cases. 209 * to handle IRQs for most practical cases.
199 */ 210 */
200 struct irq_chip *irqchip;
201 struct irq_domain *irqdomain; 211 struct irq_domain *irqdomain;
202 irq_flow_handler_t irq_handler; 212 irq_flow_handler_t irq_handler;
203 unsigned int irq_default_type; 213 unsigned int irq_default_type;