gpio / ACPI: register to ACPI events automatically
authorMika Westerberg <mika.westerberg@linux.intel.com>
Wed, 8 Jan 2014 10:40:54 +0000 (12:40 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 8 Jan 2014 14:07:28 +0000 (15:07 +0100)
commit664e3e5ac64c8a1999e2d94bc307e5bcd17d3646
tree70d7a7e03a4a672da14cce26b34b2a3e29a37fbe
parent878756553271dd631ee7f06fe489103957753fdd
gpio / ACPI: register to ACPI events automatically

Instead of asking each driver to register to ACPI events we can just call
acpi_gpiochip_register_interrupts() for each chip that has an ACPI handle.
The function checks chip->to_irq and if it is set to NULL (a GPIO driver
that doesn't do interrupts) the function does nothing.

We also add the a new header drivers/gpio/gpiolib.h that is used for
functions internal to gpiolib and add ACPI GPIO chip registering functions
to that header.

Once that is done we can remove call to acpi_gpiochip_register_interrupts()
from its only user, pinctrl-baytrail.c

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib-acpi.c
drivers/gpio/gpiolib.c
drivers/gpio/gpiolib.h [new file with mode: 0644]
drivers/pinctrl/pinctrl-baytrail.c
include/linux/acpi_gpio.h