diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2014-04-09 13:34:39 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-04-28 12:35:07 -0700 |
commit | 1c8732bb0355b929b09173464cdca7df4d516f89 (patch) | |
tree | aff50774b50c3f4567be23f9d6deeb187ab4a62f /include/linux/gpio | |
parent | d1db0eea852497762cab43b905b879dfcd3b8987 (diff) | |
download | lwn-1c8732bb0355b929b09173464cdca7df4d516f89.tar.gz lwn-1c8732bb0355b929b09173464cdca7df4d516f89.zip |
gpio: support threaded interrupts in irqchip helpers
Some off-chip GPIO expanders need to be communicated by I2C or
SPI traffic, but may still support IRQs. By the sleeping nature
of such buses, such IRQ handlers need to be threaded. Support
such handlers in the gpiochip irqchip helpers by flagging IRQs
as threaded if the .can_sleep property of the gpiochip is
true.
Helpfully deny registration of chained IRQ handlers if the
.can_sleep property is set, as such chips will invariably need
a nested handler rather than a chained handler.
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/linux/gpio')
-rw-r--r-- | include/linux/gpio/driver.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 1827b43966d9..573e4f3243d0 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -51,7 +51,10 @@ struct seq_file; * format specifier for an unsigned int. It is substituted by the actual * number of the gpio. * @can_sleep: flag must be set iff get()/set() methods sleep, as they - * must while accessing GPIO expander chips over I2C or SPI + * must while accessing GPIO expander chips over I2C or SPI. This + * implies that if the chip supports IRQs, these IRQs need to be threaded + * as the chip access may sleep when e.g. reading out the IRQ status + * registers. * @exported: flags if the gpiochip is exported for use from sysfs. Private. * * A gpio_chip can help platforms abstract various sources of GPIOs so |