aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc/gpio.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-10-26ARM: imx: Add wake functionality to GPIODinh Nguyen1-0/+32
Add function definition for irq_chip.set_wake to enable GPIO to wake-up the system. This patch has been tested on a MX51 Babbage system that had suspend code implemented. The set_wake implementation is necessary for a GPIO to wake up a system from suspend. Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-11mxc/gpio: make _set_value work with values != 0/1Peter Korsgaard1-1/+1
Documentation/gpio.txt specifies that the value argument to gpio_set_value() should be handled as a boolean (E.G. != 0 is high), so use the same logic as in _set_direction(). Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-07-28arm/imx/gpio: add spinlock protectionBaruch Siach1-0/+8
The GPIO registers need protection from concurrent access for operations that are not atomic. Cc: stable@kernel.org Cc: Juergen Beisert <j.beisert@pengutronix.de> Cc: Daniel Mack <daniel@caiaq.de> Reported-by: rpkamiak@rockwellcollins.com Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-07-26i.MX51: handle IRQ for gpio 16..31Eric Bénard1-0/+6
The i.MX51 generates 2 IRQ for each GPIO bank : one for gpio 0 to 15 and one for gpio 16 to 31. Actually only the lower IRQ is registered so register the second one. Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-04-22mx5: Add registration of GPIOs for MX5 devicesDinh Nguyen1-3/+2
Register the gpio irqs on Freescale's MX51 Babbage HW. Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com> Signed-off-by: Amit Kucheria <amit.kucheria@canonical.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-24arm/imx/gpio: remove a BUG_ON in hot pathUwe Kleine-König1-2/+0
Now if the problem occurs that triggered the BUG_ON before, the machine runs in a NULL pointer dereference. So it wouldn't be much harder now to debug the situation if it occured. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2010-02-24arm/imx/gpio: use fls to find set bits in the irq status registerUwe Kleine-König1-11/+9
As in most cases only few irqs are pending using fls is more effective than looping over all bits. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2010-02-24arm/imx: use generic_handle_irq instead of open-coding itUwe Kleine-König1-2/+1
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2010-02-24arm/imx/gpio: GPIO_INT_{HIGH,LOW}_LEV are not necessarily constantUwe Kleine-König1-6/+3
GPIO_INT_LOW_LEV is defined as (cpu_is_mx1_mx2() ? 0x3 : 0x0) so depending on compiler optimisation and enabled SoCs this doesn't qualify as a constant expression as needed by a switch statement. Ditto for GPIO_INT_HIGH_LEV. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2009-11-14imx/gpio: Use handle_level_irqUwe Kleine-König1-1/+1
According to Russell King handle_edge_irq is only useful for "edge-based inputs where the controller does not remember transitions with the input masked." So using handle_edge_irq unconditionally for both edge and level irqs is wrong. Testing showed that the controller does remember transitions while the interrupt is masked. So use handle_level_irq unconditionally. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-08-14Add i.MX25 supportSascha Hauer1-1/+1
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-08-07MXC gpio interrupt support: move register definitions to .c fileSascha Hauer1-0/+17
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-08-07mxc gpio: CONFIG_ARCH_* -> cpu_is_*()Sascha Hauer1-14/+11
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-05-07mxc: emulate GPIO interrupt on both-edgesGuennadi Liakhovetski1-1/+48
MXC GPIO controller does not support generation of interrupts on both edges. Emulate this mode in software by reconfiguring the irq trigger polarity on each interrupt. This follows an example of drivers/mfd/asic3.c. Signed-off-by: Guennadi Liakhovetski <lg@denx.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-05-05MXC: remove BUG_ON in interrupt handlerSascha Hauer1-1/+1
On i.MX31 I sometimes get spurious interrupts. There is no need to crash the whole system when this happens. Instead, silently ignore it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-03-13mxc: first set GPIO level, then switch direction to outputGuennadi Liakhovetski1-1/+1
Make sure not to create spurious pulses on GPIOs, when configuring them as output: first set required level, then switch direction. Signed-off-by: Guennadi Liakhovetski <lg@denx.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-12-16patch-mxc-add-ARCH_MX1Paulius Zaleckas1-3/+3
Adds MX1 architecture to platform MXC. It will supersede mach-imx and let it die. Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt> Signed-off-by: Darius Augulis <augulis.darius@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-10-30[ARM] MXC: Fix mxc_gpio_get(), which must read PSR register instead DR.Darius Augulis1-1/+1
The Data register holds the value we have written to a gpio. To get the input value we must read the Pad Status Register MX3 (or Sample Status register in MX1/2 terms) Signed-off-by: Darius Augulis <augulis.darius@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-07[ARM] Move include/asm-arm/arch-* to arch/arm/*/include/machRussell King1-1/+1
This just leaves include/asm-arm/plat-* to deal with. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-08-07[ARM] Remove asm/hardware.h, use asm/arch/hardware.h insteadRussell King1-1/+1
Remove includes of asm/hardware.h in addition to asm/arch/hardware.h. Then, since asm/hardware.h only exists to include asm/arch/hardware.h, update everything to directly include asm/arch/hardware.h and remove asm/hardware.h. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-07-27[ARM] 5179/1: Replace obsolete IRQT_* and __IRQT_* values with IRQ_TYPE_*Dmitry Baryshkov1-5/+5
IRQT_* and __IRQT_* were obsoleted long ago by patch [3692/1]. Remove them completely. Sed script for the reference: s/__IRQT_RISEDGE/IRQ_TYPE_EDGE_RISING/g s/__IRQT_FALEDGE/IRQ_TYPE_EDGE_FALLING/g s/__IRQT_LOWLVL/IRQ_TYPE_LEVEL_LOW/g s/__IRQT_HIGHLVL/IRQ_TYPE_LEVEL_HIGH/g s/IRQT_RISING/IRQ_TYPE_EDGE_RISING/g s/IRQT_FALLING/IRQ_TYPE_EDGE_FALLING/g s/IRQT_BOTHEDGE/IRQ_TYPE_EDGE_BOTH/g s/IRQT_LOW/IRQ_TYPE_LEVEL_LOW/g s/IRQT_HIGH/IRQ_TYPE_LEVEL_HIGH/g s/IRQT_PROBE/IRQ_TYPE_PROBE/g s/IRQT_NOEDGE/IRQ_TYPE_NONE/g Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-07-05MXC arch: Add gpio support for the whole platformJuergen Beisert1-0/+253
This patch bases on the one from Daniel Mack. The most important change to Daniel's patch is to be more generic. This gpio routine supports at least the i.MX27 and i.MX31 processors. Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de> Acked-by: Daniel Mack <daniel@caiaq.de>