gpio: export acpi_gpiochip_request_interrupts in gpio/driver.h
Subsystems (2)
PATCH 1/5 gpio: export acpi_gpiochip_request_interrupts in gpio/driver.h
dwapb-gpio driver which uses this function will be moved to pinctrl for pinctrl support. Export this function in gpio/driver.h to allow using it.
--- drivers/gpio/gpiolib-acpi.h | 4 ---- include/linux/gpio/driver.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-)
drivers/gpio/gpiolib-acpi.h +0 -4
@@ -34,7 +34,6 @@ struct acpi_gpio_info {void acpi_gpiochip_add (struct gpio_chip *chip);void acpi_gpiochip_remove (struct gpio_chip *chip); -void acpi_gpiochip_request_interrupts (struct gpio_chip *chip);void acpi_gpiochip_free_interrupts (struct gpio_chip *chip); int acpi_gpio_update_gpiod_flags(enum gpiod_flags *flags,
@@ -56,9 +55,6 @@ int acpi_gpio_count(struct device *dev, const char *con_id);static inline void acpi_gpiochip_add (struct gpio_chip *chip) { }static inline void acpi_gpiochip_remove (struct gpio_chip *chip) { } -static inline void -acpi_gpiochip_request_interrupts (struct gpio_chip *chip) { } -static inline void acpi_gpiochip_free_interrupts (struct gpio_chip *chip) { }
include/linux/gpio/driver.h +12 -0
@@ -733,6 +733,18 @@ void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset);struct gpio_chip *gpiod_to_chip (const struct gpio_desc *desc); + +#ifdef CONFIG_GPIO_ACPI + +void acpi_gpiochip_request_interrupts (struct gpio_chip *chip); + +#else + +static inline void acpi_gpiochip_request_interrupts (struct gpio_chip *chip) +{ +} + +#endif /* CONFIG_GPIO_ACPI */ #else /* CONFIG_GPIOLIB */ static inline struct gpio_chip *gpiod_to_chip (const struct gpio_desc *desc)
Signature · 1 line
2.15.0.276.g89ea799
Quoted 5 lines · Clement Leger
dwapb-gpio driver which uses this function will be moved to pinctrl for pinctrl support. Export this function in
gpio/driver.hto allow using it.
I don't think this is proper way to do it.
The driver has to register IRQ chip and GPIO core will take care of ACPI related stuff.
Quoted 54 lines
Signed-off-by Clement Leger <[email protected]>--- drivers/gpio/gpiolib-acpi.h | 4 ---- include/linux/gpio/driver.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-)drivers/gpio/gpiolib-acpi.h +0
-4@@ -34,7 +34,6 @@ struct acpi_gpio_info {void acpi_gpiochip_add (struct gpio_chip *chip);void acpi_gpiochip_remove (struct gpio_chip *chip); -void acpi_gpiochip_request_interrupts (struct gpio_chip *chip);void acpi_gpiochip_free_interrupts (struct gpio_chip *chip); int acpi_gpio_update_gpiod_flags(enum gpiod_flags *flags,@@ -56,9 +55,6 @@ int acpi_gpio_count(struct device *dev, const char *con_id);static inline void acpi_gpiochip_add (struct gpio_chip *chip) { }static inline void acpi_gpiochip_remove (struct gpio_chip *chip) { } -static inline void -acpi_gpiochip_request_interrupts (struct gpio_chip *chip) { } -static inline void acpi_gpiochip_free_interrupts (struct gpio_chip *chip) { }include/linux/gpio/driver.h +12
-1@@ -733,6 +733,18 @@ void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset);struct gpio_chip *gpiod_to_chip (const struct gpio_desc *desc); + +#ifdef CONFIG_GPIO_ACPI + +void acpi_gpiochip_request_interrupts (struct gpio_chip *chip); + +#else + +static inline void acpi_gpiochip_request_interrupts (struct gpio_chip *chip) +{ +} + +#endif /* CONFIG_GPIO_ACPI */ #else /* CONFIG_GPIOLIB */ static inline struct gpio_chip *gpiod_to_chip (const struct gpio_desc *desc) --2.15.0.276.g89ea799
Signature · 2 lines
With Best Regards, Andy Shevchenko
Ok, should I fix the original driver first and then submit the serie to add pinctrl ?
Quoted 71 lines · ----- On 4 Dec, 2019, at 13:35, Andy Shevchenko [email protected] wrote:
Quoted 5 lines · Clement Leger
dwapb-gpio driver which uses this function will be moved to pinctrl for pinctrl support. Export this function in
gpio/driver.hto allow using it.I don't think this is proper way to do it.
The driver has to register IRQ chip and GPIO core will take care of ACPI related stuff.Quoted 51 lines
Signed-off-by Clement Leger <[email protected]>--- drivers/gpio/gpiolib-acpi.h | 4 ---- include/linux/gpio/driver.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-)drivers/gpio/gpiolib-acpi.h +0
-4@@ -34,7 +34,6 @@ struct acpi_gpio_info {void acpi_gpiochip_add (struct gpio_chip *chip);void acpi_gpiochip_remove (struct gpio_chip *chip); -void acpi_gpiochip_request_interrupts (struct gpio_chip *chip);void acpi_gpiochip_free_interrupts (struct gpio_chip *chip); int acpi_gpio_update_gpiod_flags(enum gpiod_flags *flags,@@ -56,9 +55,6 @@ int acpi_gpio_count(struct device *dev, const char *con_id);static inline void acpi_gpiochip_add (struct gpio_chip *chip) { }static inline void acpi_gpiochip_remove (struct gpio_chip *chip) { } -static inline void -acpi_gpiochip_request_interrupts (struct gpio_chip *chip) { } -static inline void acpi_gpiochip_free_interrupts (struct gpio_chip *chip) { }include/linux/gpio/driver.h +12
-0@@ -733,6 +733,18 @@ void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset);struct gpio_chip *gpiod_to_chip (const struct gpio_desc *desc); + +#ifdef CONFIG_GPIO_ACPI + +void acpi_gpiochip_request_interrupts (struct gpio_chip *chip); + +#else + +static inline void acpi_gpiochip_request_interrupts (struct gpio_chip *chip) +{ +} + +#endif /* CONFIG_GPIO_ACPI */ #else /* CONFIG_GPIOLIB */ Quoted 4 lines
static inline struct
gpio_chip*gpiod_to_chip(const structgpio_desc*desc)
--
2.15.0.276.g89ea799--
With Best Regards,
Andy Shevchenko
Quoted 1 line · Clément Leger
Ok, should I fix the original driver first and then submit the serie to add pinctrl ?
I guess so. Because we definitely don't want a churn with exporting symbols like this.
Quoted 10 lines
Quoted 9 lines · ----- On 4 Dec, 2019, at 13:35, Andy Shevchenko [email protected] wrote:
Quoted 4 lines · Clement Leger
dwapb-gpio driver which uses this function will be moved to pinctrl for pinctrl support. Export this function in
gpio/driver.hto allow using it.I don't think this is proper way to do it.
The driver has to register IRQ chip and GPIO core will take care of ACPI related stuff.
Signature · 2 lines
With Best Regards, Andy Shevchenko