aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2014-01-08 05:40:56 -0500
committerLinus Walleij <linus.walleij@linaro.org>2014-01-08 09:07:28 -0500
commit5ccff85276addfdaad0046390bc5624f7e44e614 (patch)
tree4e1c1cdbdc77dcc647f926330c691066ad14b65d /drivers
parent664e3e5ac64c8a1999e2d94bc307e5bcd17d3646 (diff)
gpio / ACPI: get rid of acpi_gpio.h
Now that all users of acpi_gpio.h have been moved to use either the GPIO descriptor interface or to the internal gpiolib.h we can get rid of acpi_gpio.h entirely. Once this is done the only interface to get GPIOs to drivers enumerated from ACPI namespace is the descriptor based interface. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/gpiolib-acpi.c5
-rw-r--r--drivers/gpio/gpiolib.c1
-rw-r--r--drivers/gpio/gpiolib.h23
3 files changed, 26 insertions, 3 deletions
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 739b72b6731a..716ee9843110 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -12,11 +12,13 @@
12 12
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <linux/gpio/consumer.h> 14#include <linux/gpio/consumer.h>
15#include <linux/gpio/driver.h>
15#include <linux/export.h> 16#include <linux/export.h>
16#include <linux/acpi_gpio.h>
17#include <linux/acpi.h> 17#include <linux/acpi.h>
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19 19
20#include "gpiolib.h"
21
20struct acpi_gpio_evt_pin { 22struct acpi_gpio_evt_pin {
21 struct list_head node; 23 struct list_head node;
22 acpi_handle *evt_handle; 24 acpi_handle *evt_handle;
@@ -307,7 +309,6 @@ struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index,
307 309
308 return lookup.desc ? lookup.desc : ERR_PTR(-ENOENT); 310 return lookup.desc ? lookup.desc : ERR_PTR(-ENOENT);
309} 311}
310EXPORT_SYMBOL_GPL(acpi_get_gpiod_by_index);
311 312
312void acpi_gpiochip_add(struct gpio_chip *chip) 313void acpi_gpiochip_add(struct gpio_chip *chip)
313{ 314{
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 0de4069e33ab..ea0eba572333 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -10,7 +10,6 @@
10#include <linux/seq_file.h> 10#include <linux/seq_file.h>
11#include <linux/gpio.h> 11#include <linux/gpio.h>
12#include <linux/of_gpio.h> 12#include <linux/of_gpio.h>
13#include <linux/acpi_gpio.h>
14#include <linux/idr.h> 13#include <linux/idr.h>
15#include <linux/slab.h> 14#include <linux/slab.h>
16#include <linux/acpi.h> 15#include <linux/acpi.h>
diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h
index 2ed23ab8298c..82be586c1f90 100644
--- a/drivers/gpio/gpiolib.h
+++ b/drivers/gpio/gpiolib.h
@@ -12,12 +12,35 @@
12#ifndef GPIOLIB_H 12#ifndef GPIOLIB_H
13#define GPIOLIB_H 13#define GPIOLIB_H
14 14
15#include <linux/err.h>
16#include <linux/device.h>
17
18/**
19 * struct acpi_gpio_info - ACPI GPIO specific information
20 * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo
21 * @active_low: in case of @gpioint, the pin is active low
22 */
23struct acpi_gpio_info {
24 bool gpioint;
25 bool active_low;
26};
27
15#ifdef CONFIG_ACPI 28#ifdef CONFIG_ACPI
16void acpi_gpiochip_add(struct gpio_chip *chip); 29void acpi_gpiochip_add(struct gpio_chip *chip);
17void acpi_gpiochip_remove(struct gpio_chip *chip); 30void acpi_gpiochip_remove(struct gpio_chip *chip);
31
32struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index,
33 struct acpi_gpio_info *info);
18#else 34#else
19static inline void acpi_gpiochip_add(struct gpio_chip *chip) { } 35static inline void acpi_gpiochip_add(struct gpio_chip *chip) { }
20static inline void acpi_gpiochip_remove(struct gpio_chip *chip) { } 36static inline void acpi_gpiochip_remove(struct gpio_chip *chip) { }
37
38static inline struct gpio_desc *
39acpi_get_gpiod_by_index(struct device *dev, int index,
40 struct acpi_gpio_info *info)
41{
42 return ERR_PTR(-ENOSYS);
43}
21#endif 44#endif
22 45
23#endif /* GPIOLIB_H */ 46#endif /* GPIOLIB_H */