Skip to content

Commit 5ccff85

Browse files
westeriLinus Walleij
authored andcommitted
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>
1 parent 664e3e5 commit 5ccff85

4 files changed

Lines changed: 26 additions & 48 deletions

File tree

‎drivers/gpio/gpiolib-acpi.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212

1313
#include <linux/errno.h>
1414
#include <linux/gpio/consumer.h>
15+
#include <linux/gpio/driver.h>
1516
#include <linux/export.h>
16-
#include <linux/acpi_gpio.h>
1717
#include <linux/acpi.h>
1818
#include <linux/interrupt.h>
1919

20+
#include "gpiolib.h"
21+
2022
struct acpi_gpio_evt_pin {
2123
struct list_head node;
2224
acpi_handle *evt_handle;
@@ -307,7 +309,6 @@ struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index,
307309

308310
return lookup.desc ? lookup.desc : ERR_PTR(-ENOENT);
309311
}
310-
EXPORT_SYMBOL_GPL(acpi_get_gpiod_by_index);
311312

312313
void acpi_gpiochip_add(struct gpio_chip *chip)
313314
{

‎drivers/gpio/gpiolib.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <linux/seq_file.h>
1111
#include <linux/gpio.h>
1212
#include <linux/of_gpio.h>
13-
#include <linux/acpi_gpio.h>
1413
#include <linux/idr.h>
1514
#include <linux/slab.h>
1615
#include <linux/acpi.h>

‎drivers/gpio/gpiolib.h‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,35 @@
1212
#ifndef GPIOLIB_H
1313
#define GPIOLIB_H
1414

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+
*/
23+
struct acpi_gpio_info {
24+
bool gpioint;
25+
bool active_low;
26+
};
27+
1528
#ifdef CONFIG_ACPI
1629
void acpi_gpiochip_add(struct gpio_chip *chip);
1730
void acpi_gpiochip_remove(struct gpio_chip *chip);
31+
32+
struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index,
33+
struct acpi_gpio_info *info);
1834
#else
1935
static inline void acpi_gpiochip_add(struct gpio_chip *chip) { }
2036
static inline void acpi_gpiochip_remove(struct gpio_chip *chip) { }
37+
38+
static inline struct gpio_desc *
39+
acpi_get_gpiod_by_index(struct device *dev, int index,
40+
struct acpi_gpio_info *info)
41+
{
42+
return ERR_PTR(-ENOSYS);
43+
}
2144
#endif
2245

2346
#endif /* GPIOLIB_H */

‎include/linux/acpi_gpio.h‎

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)