ARM: pxa: pxa_cplds: add lubbock and mainstone IO
authorRobert Jarzmik <robert.jarzmik@free.fr>
Fri, 24 Apr 2015 20:22:19 +0000 (22:22 +0200)
committerZefan Li <lizefan@huawei.com>
Fri, 18 Sep 2015 01:20:35 +0000 (09:20 +0800)
commitf692253899dd6a4633b32d700dbe4beec87f441f
tree34942f96982bd7c554bf95c4ce4efe850ac0fe37
parent0c797892cfa290d60a425d863962d285801fee8b
ARM: pxa: pxa_cplds: add lubbock and mainstone IO

commit aa8d6b73ea33c2167c543663ab66039ec94d58f1 upstream.

Historically, this support was in arch/arm/mach-pxa/lubbock.c and
arch/arm/mach-pxa/mainstone.c. When gpio-pxa was moved to drivers/pxa,
it became a driver, and its initialization and probing happened at
postcore initcall. The lubbock code used to install the chained lubbock
interrupt handler at init_irq() time.

The consequence of the gpio-pxa change is that the installed chained irq
handler lubbock_irq_handler() was overwritten in pxa_gpio_probe(_dt)(),
removing :
 - the handler
 - the falling edge detection setting of GPIO0, which revealed the
   interrupt request from the lubbock IO board.

As a fix, move the gpio0 chained handler setup to a place where we have
the guarantee that pxa_gpio_probe() was called before, so that lubbock
handler becomes the true IRQ chained handler of GPIO0, demuxing the
lubbock IO board interrupts.

This patch moves all that handling to a mfd driver. It's only purpose
for the time being is the interrupt handling, but in the future it
should encompass all the motherboard CPLDs handling :
 - leds
 - switches
 - hexleds

The same logic applies to mainstone board.

Fixes: 157d2644cb0c ("ARM: pxa: change gpio to platform device")
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Zefan Li <lizefan@huawei.com>
arch/arm/mach-pxa/Kconfig
arch/arm/mach-pxa/Makefile
arch/arm/mach-pxa/pxa_cplds_irqs.c [new file with mode: 0644]