linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] gpio: export acpi_gpiochip_request_interrupts in gpio/driver.h
@ 2019-12-04 10:10 Clement Leger
  2019-12-04 12:35 ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Clement Leger @ 2019-12-04 10:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: Clement Leger, Linus Walleij, Bartosz Golaszewski, linux-gpio

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.

Signed-off-by: Clement Leger <cleger@kalray.eu>
---
 drivers/gpio/gpiolib-acpi.h |  4 ----
 include/linux/gpio/driver.h | 12 ++++++++++++
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpiolib-acpi.h b/drivers/gpio/gpiolib-acpi.h
index 1c6d65cf0629..ba2f187babe3 100644
--- a/drivers/gpio/gpiolib-acpi.h
+++ b/drivers/gpio/gpiolib-acpi.h
@@ -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) { }
 
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index e2480ef94c55..40b9f13d77e1 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/5] gpio: export acpi_gpiochip_request_interrupts in gpio/driver.h
  2019-12-04 10:10 [PATCH 1/5] gpio: export acpi_gpiochip_request_interrupts in gpio/driver.h Clement Leger
@ 2019-12-04 12:35 ` Andy Shevchenko
  2019-12-04 13:39   ` Clément Leger
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2019-12-04 12:35 UTC (permalink / raw)
  To: Clement Leger
  Cc: Linux Kernel Mailing List, Linus Walleij, Bartosz Golaszewski,
	open list:GPIO SUBSYSTEM

On Wed, Dec 4, 2019 at 12:13 PM Clement Leger <cleger@kalray.eu> wrote:
>
> 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.
>

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.

> Signed-off-by: Clement Leger <cleger@kalray.eu>
> ---
>  drivers/gpio/gpiolib-acpi.h |  4 ----
>  include/linux/gpio/driver.h | 12 ++++++++++++
>  2 files changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpio/gpiolib-acpi.h b/drivers/gpio/gpiolib-acpi.h
> index 1c6d65cf0629..ba2f187babe3 100644
> --- a/drivers/gpio/gpiolib-acpi.h
> +++ b/drivers/gpio/gpiolib-acpi.h
> @@ -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) { }
>
> diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
> index e2480ef94c55..40b9f13d77e1 100644
> --- a/include/linux/gpio/driver.h
> +++ b/include/linux/gpio/driver.h
> @@ -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
>


-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/5] gpio: export acpi_gpiochip_request_interrupts in gpio/driver.h
  2019-12-04 12:35 ` Andy Shevchenko
@ 2019-12-04 13:39   ` Clément Leger
  2019-12-04 17:44     ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Clément Leger @ 2019-12-04 13:39 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-kernel, Linus Walleij, Bartosz Golaszewski, open list,
	GPIO SUBSYSTEM

Ok, should I fix the original driver first and then submit the serie to add pinctrl ?

----- On 4 Dec, 2019, at 13:35, Andy Shevchenko andy.shevchenko@gmail.com wrote:

> On Wed, Dec 4, 2019 at 12:13 PM Clement Leger <cleger@kalray.eu> wrote:
>>
>> 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.
>>
> 
> 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.
> 
>> Signed-off-by: Clement Leger <cleger@kalray.eu>
>> ---
>>  drivers/gpio/gpiolib-acpi.h |  4 ----
>>  include/linux/gpio/driver.h | 12 ++++++++++++
>>  2 files changed, 12 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpio/gpiolib-acpi.h b/drivers/gpio/gpiolib-acpi.h
>> index 1c6d65cf0629..ba2f187babe3 100644
>> --- a/drivers/gpio/gpiolib-acpi.h
>> +++ b/drivers/gpio/gpiolib-acpi.h
>> @@ -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) { }
>>
>> diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
>> index e2480ef94c55..40b9f13d77e1 100644
>> --- a/include/linux/gpio/driver.h
>> +++ b/include/linux/gpio/driver.h
>> @@ -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
>>
> 
> 
> --
> With Best Regards,
> Andy Shevchenko

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/5] gpio: export acpi_gpiochip_request_interrupts in gpio/driver.h
  2019-12-04 13:39   ` Clément Leger
@ 2019-12-04 17:44     ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2019-12-04 17:44 UTC (permalink / raw)
  To: Clément Leger
  Cc: linux-kernel, Linus Walleij, Bartosz Golaszewski, open list,
	GPIO SUBSYSTEM

On Wed, Dec 4, 2019 at 3:39 PM Clément Leger <cleger@kalray.eu> wrote:

> 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.

> ----- On 4 Dec, 2019, at 13:35, Andy Shevchenko andy.shevchenko@gmail.com wrote:
> > On Wed, Dec 4, 2019 at 12:13 PM Clement Leger <cleger@kalray.eu> wrote:
> >>
> >> 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.

> > 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.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-04 17:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-04 10:10 [PATCH 1/5] gpio: export acpi_gpiochip_request_interrupts in gpio/driver.h Clement Leger
2019-12-04 12:35 ` Andy Shevchenko
2019-12-04 13:39   ` Clément Leger
2019-12-04 17:44     ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).