]> git.karo-electronics.de Git - karo-tx-linux.git/commit
gpio: pl061: assign the apropriate handler for irqs
authorLinus Walleij <linus.walleij@linaro.org>
Fri, 25 Sep 2015 00:52:52 +0000 (17:52 -0700)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 15 Oct 2015 16:03:07 +0000 (18:03 +0200)
commit26ba9cd48fc0c2ff741de913270e9469506f3666
treefcb9834464590ba51d36bdabd973424005374577
parent21d4de1469a1da20a14a745c5f49488bba417ea7
gpio: pl061: assign the apropriate handler for irqs

The PL061 can handle level IRQs and edge IRQs, however it is
just utilizing handle_simple_irq() for all IRQs. Inspired by
Stefan Agners patch to vf610, this assigns the right handler
depending on what type is set up, and after this
handle_bad_irq() is only used as default and if the type is
not specified, as is done in the OMAP driver: defining the
IRQ type is really not optional for this driver.

The interrupt handler was just writing the interrupt clearing
register for all lines that were high when entering the handling
loop, this is wrong: that register is only supposed to be
written (on a per-line basis) for edge IRQs, so this ACK
was moved to the .irq_ack() callback as is proper.

Tested with PL061 on the ARM RealView PB11MPCore and the
MMC/SC card detect GPIO.

Cc: Jonas Gorski <jogo@openwrt.org>
Cc: Stefan Agner <stefan@agner.ch>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-pl061.c