diff options
| author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2014-01-08 05:40:54 -0500 |
|---|---|---|
| committer | Linus Walleij <linus.walleij@linaro.org> | 2014-01-08 09:07:28 -0500 |
| commit | 664e3e5ac64c8a1999e2d94bc307e5bcd17d3646 (patch) | |
| tree | 70d7a7e03a4a672da14cce26b34b2a3e29a37fbe /include/linux | |
| parent | 878756553271dd631ee7f06fe489103957753fdd (diff) | |
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>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/acpi_gpio.h | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/include/linux/acpi_gpio.h b/include/linux/acpi_gpio.h index d875bc3dba3c..af96a0d452f6 100644 --- a/include/linux/acpi_gpio.h +++ b/include/linux/acpi_gpio.h | |||
| @@ -21,9 +21,6 @@ struct acpi_gpio_info { | |||
| 21 | 21 | ||
| 22 | struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index, | 22 | struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index, |
| 23 | struct acpi_gpio_info *info); | 23 | struct acpi_gpio_info *info); |
| 24 | void acpi_gpiochip_request_interrupts(struct gpio_chip *chip); | ||
| 25 | void acpi_gpiochip_free_interrupts(struct gpio_chip *chip); | ||
| 26 | |||
| 27 | #else /* CONFIG_GPIO_ACPI */ | 24 | #else /* CONFIG_GPIO_ACPI */ |
| 28 | 25 | ||
| 29 | static inline struct gpio_desc * | 26 | static inline struct gpio_desc * |
| @@ -33,9 +30,6 @@ acpi_get_gpiod_by_index(struct device *dev, int index, | |||
| 33 | return ERR_PTR(-ENOSYS); | 30 | return ERR_PTR(-ENOSYS); |
| 34 | } | 31 | } |
| 35 | 32 | ||
| 36 | static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { } | ||
| 37 | static inline void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { } | ||
| 38 | |||
| 39 | #endif /* CONFIG_GPIO_ACPI */ | 33 | #endif /* CONFIG_GPIO_ACPI */ |
| 40 | 34 | ||
| 41 | static inline int acpi_get_gpio_by_index(struct device *dev, int index, | 35 | static inline int acpi_get_gpio_by_index(struct device *dev, int index, |
