]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: Make it possible to exclude GPIOs from IRQ domain
authorMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 20 Sep 2016 12:15:21 +0000 (15:15 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 23 Sep 2016 12:49:50 +0000 (14:49 +0200)
commitb58c9519e45e396942c5b18ef8eb599d6f259ffd
tree7eac13032ae91d1d9d24d264fde22a654c744a57
parent1372dac0367f9e37512ea4720cf3886bcb42562d
gpiolib: Make it possible to exclude GPIOs from IRQ domain

When using GPIO irqchip helpers to setup irqchip for a gpiolib based
driver, it is not possible to select which GPIOs to add to the IRQ domain.
Instead it just adds all GPIOs which is not always desired. For example
there might be GPIOs that for some reason cannot generated normal
interrupts at all.

To support this we add a flag irq_need_valid_mask to struct gpio_chip. When
this flag is set the core allocates irq_valid_mask that holds one bit for
each GPIO the chip has. By default all bits are set but drivers can
manipulate this using set_bit() and clear_bit() accordingly.

Then when gpiochip_irqchip_add() is called, this mask is checked and all
GPIOs with bit is set are added to the IRQ domain created for the GPIO
chip.

Suggested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Documentation/gpio/driver.txt
drivers/gpio/gpiolib.c
include/linux/gpio/driver.h