Re: [PATCH v2] gpio: switch drivers to use new callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 18 Mar 2014, Linus Walleij wrote:
> This switches all GPIO and pin control drivers with irqchips
> that were using .startup() and .shutdown() callbacks to lock
> GPIO lines for IRQ usage over to using the .request_resources()
> and .release_resources() callbacks just introduced into the
> irqchip vtable.
> 
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Jean-Jacques Hiblot <jjhiblot@xxxxxxxxxxxxxxx>
> Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> ---
> ChangeLog v1->v2:
> - Fix signedness of some callbacks.
> ---
>  drivers/gpio/gpio-adnp.c            | 15 +++++++--------
>  drivers/gpio/gpio-bcm-kona.c        | 14 +++++++-------
>  drivers/gpio/gpio-dwapb.c           | 16 ++++++++--------
>  drivers/gpio/gpio-em.c              | 14 +++++++-------
>  drivers/gpio/gpio-intel-mid.c       | 14 +++++++-------
>  drivers/gpio/gpio-lynxpoint.c       | 14 +++++++-------
>  drivers/gpio/gpio-mcp23s08.c        | 14 +++++++-------
>  drivers/gpio/gpio-pl061.c           | 14 +++++++-------
>  drivers/pinctrl/pinctrl-adi2.c      |  1 +
>  drivers/pinctrl/pinctrl-baytrail.c  | 14 +++++++-------
>  drivers/pinctrl/pinctrl-msm.c       | 11 +++++------
>  drivers/pinctrl/pinctrl-nomadik.c   | 25 +++++++++++++++++++++----
>  drivers/pinctrl/sirf/pinctrl-sirf.c | 14 +++++++-------
>  13 files changed, 98 insertions(+), 82 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-adnp.c b/drivers/gpio/gpio-adnp.c
> index 6fc6206b38bd..b2239d678d01 100644
> --- a/drivers/gpio/gpio-adnp.c
> +++ b/drivers/gpio/gpio-adnp.c
> @@ -408,24 +408,23 @@ static void adnp_irq_bus_unlock(struct irq_data *data)
>  	mutex_unlock(&adnp->irq_lock);
>  }
>  
> -static unsigned int adnp_irq_startup(struct irq_data *data)
> +static int adnp_irq_reqres(struct irq_data *data)
>  {
>  	struct adnp *adnp = irq_data_get_irq_chip_data(data);
>  
> -	if (gpio_lock_as_irq(&adnp->gpio, data->hwirq))
> +	if (gpio_lock_as_irq(&adnp->gpio, data->hwirq)) {

So you need a per chip function because all chips have their own
private data struct in irq_chip_data. Sigh. 

It'd be nice if we'd have gpio in the data, so you could have a
generic function which does the right thing.

In principle it'd be simple.

   struct gpio *gpio = irq_data_get_irq_chip_data(data);
   struct adnp *adnp = container_of(gpio, struct adnp, gpio);

Ditto for all other drivers. But that requires a major overhaul.

I wonder if it'd be worth to add another pointer to irq_data for such
purposes.

Thoughts?

Thanks,

	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux