Re: [PATCH] gpio-dwapb: reset mask register on probe

From: Linus Walleij
Date: Thu Mar 26 2015 - 05:29:42 EST


On Thu, Mar 19, 2015 at 9:44 AM, Alexey Brodkin
<Alexey.Brodkin@xxxxxxxxxxxx> wrote:

> So IMHO we need to update "gpio-dwapb" driver in the following manner:
>
> [1] In dwapb_configure_irqs() in accordance to "snps,nr-gpios" in the
> first bank set a value in GPIO_INTEN. This way we turn N pins in that
> port/bank in "interrupt" mode from their default gpio mode.
>
> [2] Don't expose dwapb_irq_enable()/dwapb_irq_disable() through
> ct->chip.irq_enable/ct->chip.irq_disable. Because we don't want to
> toggle modes of pins, right?
>
> [3] Use ct->chip.irq_mask/ct->chip.irq_unmask for purpose of real
> enabling/disabling interrupts.
>
> If I'm not missing something that would be implementation that matches
> real device specification.
>
> If we do these changes then indeed we'll want to make sure GPIO_INTMASK
> is initialized with all interrupts masked out:
> --->8---
> dwapb_write(gpio, GPIO_INTMASK, 0xffffffff);
> --->8---
>
> Let me know if my proposal makes sense and then I'll send patch that
> implements it.

Sure as long as you can test it and it works, I'm fine with this.

I might be looking at migrating this quite popular driver to
GPIOLIB_IRQCHIP so would be happy if you can help out
testing it if I do this later.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/