[PATCH v3] RFC: pinctrl: bcm2835: switch to GPIOLIB_IRQCHIP

Linus Walleij linus.walleij at linaro.org
Fri Dec 2 04:34:28 PST 2016

On Wed, Nov 30, 2016 at 1:22 AM, Eric Anholt <eric at anholt.net> wrote:
> Linus Walleij <linus.walleij at linaro.org> writes:
>> It should be possible to use the GPIOLIB_IRQCHIP helper
>> library with the BCM2835 driver since it is a pretty straight
>> forward cascaded irqchip.
>> The only difference from other drivers is that the BCM2835
>> has several banks for a single gpiochip, and each bank has
>> a separate IRQ line. Instead of creating one gpiochip per
>> bank, a single gpiochip covers all banks GPIO lines. This
>> makes it necessary to resolve the bank ID in the IRQ
>> handler.
>> The GPIOLIB_IRQCHIP allows several IRQs to be cascaded off
>> the same gpiochip by calling gpiochip_set_chained_irqchip()
>> repeatedly, but we have been a bit short on examples
>> for how this should be handled in practice, so this is intended
>> as an example of how this can be achieved.
>> The old code did not model the chip as a chained interrupt
>> handler, but this patch also rectifies that situation.
> I went ahead and put together a little bit of test code for HDMI to
> collect hotplug interrupts.  By registering the GPIO IRQ from the
> driver, I'm seeing my line in /proc/interrupts and its count increments
> when I plug/unplug.  Given that, feel free to apply:
> Tested-by: Eric Anholt <eric at anholt.net>
> Acked-by: Eric Anholt <eric at anholt.net>

Thanks Eric, patch applied!

I'm very happy with the state of the driver now, given the
commonality of the hardware I like to have some drivers be
ideally implemented and a pattern for others to follow. The
BCM2835 is pretty much like that now :)

Linus Walleij

More information about the linux-rpi-kernel mailing list