diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2018-09-08 11:23:17 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2018-09-10 08:56:38 +0200 |
commit | 461c1a7d4733d1dfd5c47b040cf32a5e7eefbc6c (patch) | |
tree | bf21a1669e7b6c9e30cae1e427aeed2c4daa7d75 /include/linux/gpio/driver.h | |
parent | 4e9439ddacea06f35acce4d374bf6bd0acf99bc8 (diff) |
gpiolib: override irq_enable/disable
When using the gpiolib irqchip helpers install irq_enable/disable
hooks for the irqchip to ensure that gpiolib knows when the irq
is enabled or disabled, allowing drivers to disable the irq and then
use it as an output pin, and later switch the direction to input and
re-enable the irq.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.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, 14 insertions, 0 deletions
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 9052ccd399fd..d8dcd0e44cab 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -144,6 +144,20 @@ struct gpio_irq_chip { * will allocate and map all IRQs during initialization. */ unsigned int first; + + /** + * @irq_enable: + * + * Store old irq_chip irq_enable callback + */ + void (*irq_enable)(struct irq_data *data); + + /** + * @irq_disable: + * + * Store old irq_chip irq_disable callback + */ + void (*irq_disable)(struct irq_data *data); }; static inline struct gpio_irq_chip *to_gpio_irq_chip(struct irq_chip *chip) |