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 /drivers/gpio/gpiolib.h | |
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 'drivers/gpio/gpiolib.h')
-rw-r--r-- | drivers/gpio/gpiolib.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h new file mode 100644 index 000000000000..2ed23ab8298c --- /dev/null +++ b/drivers/gpio/gpiolib.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * Internal GPIO functions. | ||
3 | * | ||
4 | * Copyright (C) 2013, Intel Corporation | ||
5 | * Author: Mika Westerberg <mika.westerberg@linux.intel.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef GPIOLIB_H | ||
13 | #define GPIOLIB_H | ||
14 | |||
15 | #ifdef CONFIG_ACPI | ||
16 | void acpi_gpiochip_add(struct gpio_chip *chip); | ||
17 | void acpi_gpiochip_remove(struct gpio_chip *chip); | ||
18 | #else | ||
19 | static inline void acpi_gpiochip_add(struct gpio_chip *chip) { } | ||
20 | static inline void acpi_gpiochip_remove(struct gpio_chip *chip) { } | ||
21 | #endif | ||
22 | |||
23 | #endif /* GPIOLIB_H */ | ||