gpio: add IRQ chip helpers in gpiolib

This provides a function gpiochip_irqchip_add() to set
up an irqchip for a GPIO controller, and a function
gpiochip_set_chained_irqchip() to chain it to a parent
irqchip.

Most GPIOs are of the type where a number of lines form
a cascaded interrupt controller chained onto
the primary system interrupt controller (or further down the
chain) so let's add this helper and factor the code to
request the lines to be used as IRQs, the .to_irq() function
and the irqdomain into the core as well.

Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Linus Walleij
2014-03-25 10:40:18 +01:00
parent 8f18bcfcd2
commit 1425052097
3 changed files with 220 additions and 0 deletions

View File

@@ -55,6 +55,9 @@ config GPIO_ACPI
def_bool y
depends on ACPI
config GPIOLIB_IRQCHIP
bool
config DEBUG_GPIO
bool "Debug GPIO calls"
depends on DEBUG_KERNEL