Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mika Westerberg and committed by
Linus Walleij
5ccff852 664e3e5a

+26 -48
+3 -2
drivers/gpio/gpiolib-acpi.c
··· 12 12 13 13 #include <linux/errno.h> 14 14 #include <linux/gpio/consumer.h> 15 + #include <linux/gpio/driver.h> 15 16 #include <linux/export.h> 16 - #include <linux/acpi_gpio.h> 17 17 #include <linux/acpi.h> 18 18 #include <linux/interrupt.h> 19 + 20 + #include "gpiolib.h" 19 21 20 22 struct acpi_gpio_evt_pin { 21 23 struct list_head node; ··· 309 307 310 308 return lookup.desc ? lookup.desc : ERR_PTR(-ENOENT); 311 309 } 312 - EXPORT_SYMBOL_GPL(acpi_get_gpiod_by_index); 313 310 314 311 void acpi_gpiochip_add(struct gpio_chip *chip) 315 312 {
-1
drivers/gpio/gpiolib.c
··· 10 10 #include <linux/seq_file.h> 11 11 #include <linux/gpio.h> 12 12 #include <linux/of_gpio.h> 13 - #include <linux/acpi_gpio.h> 14 13 #include <linux/idr.h> 15 14 #include <linux/slab.h> 16 15 #include <linux/acpi.h>
+23
drivers/gpio/gpiolib.h
··· 12 12 #ifndef GPIOLIB_H 13 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 + */ 23 + struct acpi_gpio_info { 24 + bool gpioint; 25 + bool active_low; 26 + }; 27 + 15 28 #ifdef CONFIG_ACPI 16 29 void acpi_gpiochip_add(struct gpio_chip *chip); 17 30 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); 18 34 #else 19 35 static inline void acpi_gpiochip_add(struct gpio_chip *chip) { } 20 36 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 + } 21 44 #endif 22 45 23 46 #endif /* GPIOLIB_H */
-45
include/linux/acpi_gpio.h
··· 1 - #ifndef _LINUX_ACPI_GPIO_H_ 2 - #define _LINUX_ACPI_GPIO_H_ 3 - 4 - #include <linux/device.h> 5 - #include <linux/err.h> 6 - #include <linux/errno.h> 7 - #include <linux/gpio.h> 8 - #include <linux/gpio/consumer.h> 9 - 10 - /** 11 - * struct acpi_gpio_info - ACPI GPIO specific information 12 - * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo 13 - * @active_low: in case of @gpioint, the pin is active low 14 - */ 15 - struct acpi_gpio_info { 16 - bool gpioint; 17 - bool active_low; 18 - }; 19 - 20 - #ifdef CONFIG_GPIO_ACPI 21 - 22 - struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index, 23 - struct acpi_gpio_info *info); 24 - #else /* CONFIG_GPIO_ACPI */ 25 - 26 - static inline struct gpio_desc * 27 - acpi_get_gpiod_by_index(struct device *dev, int index, 28 - struct acpi_gpio_info *info) 29 - { 30 - return ERR_PTR(-ENOSYS); 31 - } 32 - 33 - #endif /* CONFIG_GPIO_ACPI */ 34 - 35 - static inline int acpi_get_gpio_by_index(struct device *dev, int index, 36 - struct acpi_gpio_info *info) 37 - { 38 - struct gpio_desc *desc = acpi_get_gpiod_by_index(dev, index, info); 39 - 40 - if (IS_ERR(desc)) 41 - return PTR_ERR(desc); 42 - return desc_to_gpio(desc); 43 - } 44 - 45 - #endif /* _LINUX_ACPI_GPIO_H_ */