diff options
author | Thierry Reding <treding@nvidia.com> | 2017-11-07 13:15:45 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-11-08 07:58:19 -0500 |
commit | c44eafd79be666e7c81d22e215c945b27f2785f7 (patch) | |
tree | 865222fa8bc1007b289c94cb09a2cd444802f8be /include/linux/gpio | |
parent | b53b8300bf8ef8acfb604e07d818ead723be6ea3 (diff) |
gpio: Introduce struct gpio_irq_chip
This new structure will be used to group all fields related to interrupt
handling in a GPIO chip. Doing so will properly namespace these fields
and make it easier to distinguish which fields are used for IRQ support.
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')
-rw-r--r-- | include/linux/gpio/driver.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index ed04fa2a00a8..36a065521fa0 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h | |||
@@ -19,6 +19,36 @@ struct module; | |||
19 | 19 | ||
20 | #ifdef CONFIG_GPIOLIB | 20 | #ifdef CONFIG_GPIOLIB |
21 | 21 | ||
22 | #ifdef CONFIG_GPIOLIB_IRQCHIP | ||
23 | /** | ||
24 | * struct gpio_irq_chip - GPIO interrupt controller | ||
25 | */ | ||
26 | struct gpio_irq_chip { | ||
27 | /** | ||
28 | * @domain_ops: | ||
29 | * | ||
30 | * Table of interrupt domain operations for this IRQ chip. | ||
31 | */ | ||
32 | const struct irq_domain_ops *domain_ops; | ||
33 | |||
34 | /** | ||
35 | * @parent_handler: | ||
36 | * | ||
37 | * The interrupt handler for the GPIO chip's parent interrupts, may be | ||
38 | * NULL if the parent interrupts are nested rather than cascaded. | ||
39 | */ | ||
40 | irq_flow_handler_t parent_handler; | ||
41 | |||
42 | /** | ||
43 | * @parent_handler_data: | ||
44 | * | ||
45 | * Data associated, and passed to, the handler for the parent | ||
46 | * interrupt. | ||
47 | */ | ||
48 | void *parent_handler_data; | ||
49 | }; | ||
50 | #endif | ||
51 | |||
22 | /** | 52 | /** |
23 | * struct gpio_chip - abstract a GPIO controller | 53 | * struct gpio_chip - abstract a GPIO controller |
24 | * @label: a functional name for the GPIO device, such as a part | 54 | * @label: a functional name for the GPIO device, such as a part |
@@ -176,6 +206,14 @@ struct gpio_chip { | |||
176 | bool irq_need_valid_mask; | 206 | bool irq_need_valid_mask; |
177 | unsigned long *irq_valid_mask; | 207 | unsigned long *irq_valid_mask; |
178 | struct lock_class_key *lock_key; | 208 | struct lock_class_key *lock_key; |
209 | |||
210 | /** | ||
211 | * @irq: | ||
212 | * | ||
213 | * Integrates interrupt chip functionality with the GPIO chip. Can be | ||
214 | * used to handle IRQs for most practical cases. | ||
215 | */ | ||
216 | struct gpio_irq_chip irq; | ||
179 | #endif | 217 | #endif |
180 | 218 | ||
181 | #if defined(CONFIG_OF_GPIO) | 219 | #if defined(CONFIG_OF_GPIO) |