Message ID | 1390473478-5591-2-git-send-email-jjhiblot@traphandler.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, Jan 23, 2014 at 11:37 AM, Jean-Jacques Hiblot <jjhiblot@traphandler.com> wrote: > When an IRQ is started on a GPIO line, mark this GPIO as IRQ in > the gpiolib so we can keep track of the usage centrally. > > Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Nicolas, are you queueing this patch? I guess this custom GPIO implementation is going away with the transition to pinctrl else I'd requested that it be moved to drivers/gpio... Yours, Linus Walleij
On 31/01/2014 08:55, Linus Walleij : > On Thu, Jan 23, 2014 at 11:37 AM, Jean-Jacques Hiblot > <jjhiblot@traphandler.com> wrote: > >> When an IRQ is started on a GPIO line, mark this GPIO as IRQ in >> the gpiolib so we can keep track of the usage centrally. >> >> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com> > > Acked-by: Linus Walleij <linus.walleij@linaro.org> > > Nicolas, are you queueing this patch? Yes, I will. > I guess this custom GPIO implementation is going away with > the transition to pinctrl else I'd requested that it be moved to > drivers/gpio... Absolutely. But I suspect it will still be around for some time... Thanks for your review. Bye,
On 09:57 Fri 31 Jan , Nicolas Ferre wrote: > On 31/01/2014 08:55, Linus Walleij : > > On Thu, Jan 23, 2014 at 11:37 AM, Jean-Jacques Hiblot > > <jjhiblot@traphandler.com> wrote: > > > >> When an IRQ is started on a GPIO line, mark this GPIO as IRQ in > >> the gpiolib so we can keep track of the usage centrally. > >> > >> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com> > > > > Acked-by: Linus Walleij <linus.walleij@linaro.org> > > > > Nicolas, are you queueing this patch? > > Yes, I will. > > > I guess this custom GPIO implementation is going away with > > the transition to pinctrl else I'd requested that it be moved to > > drivers/gpio... > > Absolutely. But I suspect it will still be around for some time... moved no I'm not even sure we need to update it at all to simply for the switch to DT nearly all the support for old SoC is here so I see no reason to do not switch I even a big patch serie to switch old board to DT So for me no do not touch the old stuff Best Regards, J. > > Thanks for your review. Bye, > -- > Nicolas Ferre
On 31/01/2014 09:57, Nicolas Ferre : > On 31/01/2014 08:55, Linus Walleij : >> On Thu, Jan 23, 2014 at 11:37 AM, Jean-Jacques Hiblot >> <jjhiblot@traphandler.com> wrote: >> >>> When an IRQ is started on a GPIO line, mark this GPIO as IRQ in >>> the gpiolib so we can keep track of the usage centrally. >>> >>> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com> >> >> Acked-by: Linus Walleij <linus.walleij@linaro.org> >> >> Nicolas, are you queueing this patch? > > Yes, I will. stacked on at91-3.15-cleanup branch. Best regards, >> I guess this custom GPIO implementation is going away with >> the transition to pinctrl else I'd requested that it be moved to >> drivers/gpio... > > Absolutely. But I suspect it will still be around for some time... > > Thanks for your review. Bye, >
On 12/03/2014 15:38, Nicolas Ferre : > On 31/01/2014 09:57, Nicolas Ferre : >> On 31/01/2014 08:55, Linus Walleij : >>> On Thu, Jan 23, 2014 at 11:37 AM, Jean-Jacques Hiblot >>> <jjhiblot@traphandler.com> wrote: >>> >>>> When an IRQ is started on a GPIO line, mark this GPIO as IRQ in >>>> the gpiolib so we can keep track of the usage centrally. >>>> >>>> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com> >>> >>> Acked-by: Linus Walleij <linus.walleij@linaro.org> >>> >>> Nicolas, are you queueing this patch? >> >> Yes, I will. > > stacked on at91-3.15-cleanup branch. ... And immediately removed thanks to Boris' advice: it seems that you will move to a gpio_irq_request/release_resources() model. So, we might wait for the solution to settle in 3.15-rc before building on top of it. Thanks, bye, >>> I guess this custom GPIO implementation is going away with >>> the transition to pinctrl else I'd requested that it be moved to >>> drivers/gpio... >> >> Absolutely. But I suspect it will still be around for some time... >> >> Thanks for your review. Bye, >> > >
On Wed, Mar 12, 2014 at 6:29 PM, Nicolas Ferre <nicolas.ferre@atmel.com> wrote: > On 12/03/2014 15:38, Nicolas Ferre : >> On 31/01/2014 09:57, Nicolas Ferre : >>> On 31/01/2014 08:55, Linus Walleij : >>>> On Thu, Jan 23, 2014 at 11:37 AM, Jean-Jacques Hiblot >>>> <jjhiblot@traphandler.com> wrote: >>>> >>>>> When an IRQ is started on a GPIO line, mark this GPIO as IRQ in >>>>> the gpiolib so we can keep track of the usage centrally. >>>>> >>>>> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com> >>>> >>>> Acked-by: Linus Walleij <linus.walleij@linaro.org> >>>> >>>> Nicolas, are you queueing this patch? >>> >>> Yes, I will. >> >> stacked on at91-3.15-cleanup branch. > > ... And immediately removed thanks to Boris' advice: it seems that you > will move to a gpio_irq_request/release_resources() model. > > So, we might wait for the solution to settle in 3.15-rc before building > on top of it. It's not such a big deal IMO, but sure I'm working to clean this up. Yours, Linus Walleij
diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c index a5afcf7..a88ed12 100644 --- a/arch/arm/mach-at91/gpio.c +++ b/arch/arm/mach-at91/gpio.c @@ -577,8 +577,35 @@ static int alt_gpio_irq_type(struct irq_data *d, unsigned type) return 0; } +static unsigned int gpio_irq_startup(struct irq_data *d) +{ + struct at91_gpio_chip *at91_gpio = irq_data_get_irq_chip_data(d); + unsigned pin = d->hwirq; + int ret; + + ret = gpio_lock_as_irq(&at91_gpio->chip, pin); + if (ret) { + dev_err(at91_gpio->chip.dev, "unable to lock pind %lu IRQ\n", + d->hwirq); + return ret; + } + gpio_irq_unmask(d); + return 0; +} + +static void gpio_irq_shutdown(struct irq_data *d) +{ + struct at91_gpio_chip *at91_gpio = irq_data_get_irq_chip_data(d); + unsigned pin = d->hwirq; + + gpio_irq_mask(d); + gpio_unlock_as_irq(&at91_gpio->chip, pin); +} + static struct irq_chip gpio_irqchip = { .name = "GPIO", + .irq_shutdown = gpio_irq_shutdown, + .irq_startup = gpio_irq_startup, .irq_disable = gpio_irq_mask, .irq_mask = gpio_irq_mask, .irq_unmask = gpio_irq_unmask,
When an IRQ is started on a GPIO line, mark this GPIO as IRQ in the gpiolib so we can keep track of the usage centrally. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com> --- arch/arm/mach-at91/gpio.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)