summaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc/gpio.c
Commit message (Collapse)AuthorAgeFilesLines
* gpio/mxc: Move Freescale MXC gpio driver to drivers/gpioShawn Guo2011-06-061-361/+0
| | | | | | | | | | GPIO drivers are getting moved to drivers/gpio for cleanup and consolidation. This patch moves the plat-mxc driver. Follow up patches will clean it up and make it a fine upstanding gpio driver. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* ARM: mxc: Add missing lockdep annotationThomas Gleixner2011-04-121-0/+7
| | | | | | | | | | | | | | | | | | | | | The irq_set_wake() function of the gpio irq_chip calls enable/disable_irq_wake() on the demultiplex interrupt. That leads to a lockdep warning "INFO: possible recursive locking detected" because irq_set_type() is called under irq_desc->lock and the *_irq_wake() calls take irq_desc->lock of the demux interrupt. Tell lockdep that the gpio irqs are in a different lock class. Documentation/SubmitChecklist: 15: All codepaths have been exercised with all lockdep features enabled. That's a non-optional requirement, AFAICT. Reported-and-tested-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> LAKML-Reference: alpine.LFD.2.00.1104041416290.19945@localhost6.localdomain6 Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: Fold irq_set_chip/irq_set_handlerThomas Gleixner2011-03-291-2/+2
| | | | | | Use irq_set_chip_and_handler() instead. Converted with coccinelle. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* arm: Cleanup the irq namespaceThomas Gleixner2011-03-291-11/+13
| | | | | | Convert to the new function names. Automated with coccinelle. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* ARM i.MX: Move gpio initialization to SoC specific filesSascha Hauer2011-03-071-110/+0
| | | | | | This saves us from soc level dispatching in generic files Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* plat-mxc: Provide irq_chip name for GPIO IRQsAlexander Stein2011-02-011-0/+1
| | | | | Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: plat-mxc: irq_data conversion.Lennert Buytenhek2011-01-131-15/+15
| | | | Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca>
* arm: mx50: add core functions support except clockRichard Zhao2011-01-031-0/+14
| | | | | | | | Add core definitions and memory map, gpio, irq, iomux, uart device support. Signed-off-by: Richard Zhao <richard.zhao@freescale.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: plat-mxc: add full parameter macro to define gpio portRichard Zhao2011-01-031-1/+4
| | | | | | Signed-off-by: Richard Zhao <richard.zhao@freescale.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mx3: introduce SOC_IMX31 and SOC_IMX35Uwe Kleine-König2010-11-191-4/+4
| | | | | | | Additionally convert some known to be good usages to the new names. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
* ARM: mx3: move registration of gpios to plat-mxc/gpio.cUwe Kleine-König2010-11-191-0/+22
| | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
* ARM: imx: use SOC_IMX25 instead of ARCH_MX25 for multi-SoCUwe Kleine-König2010-11-191-2/+2
| | | | | | | | Some usages of ARCH_MX25 are assuming that if it is defined the other SoCs are undefined. Use SOC_IMX25 for the save places. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
* ARM: mx25: move registration of gpios to plat-mxc/gpio.cUwe Kleine-König2010-11-171-23/+35
| | | | | | | | To use common macros to define the gpio ports for imx{1,21,25,27} the existing ones had to made more general and a few more base address defines were necessary. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
* ARM: imx: move registration of gpios to plat-mxc/gpio.cUwe Kleine-König2010-11-171-0/+59
| | | | | | This finally gets rid of mach-imx/devices.c. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
* ARM: imx/gpio: remove some useless castsUwe Kleine-König2010-11-171-2/+2
| | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
* ARM: imx: Add wake functionality to GPIODinh Nguyen2010-10-261-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>
* mxc/gpio: make _set_value work with values != 0/1Peter Korsgaard2010-10-111-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>
* arm/imx/gpio: add spinlock protectionBaruch Siach2010-07-281-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>
* i.MX51: handle IRQ for gpio 16..31Eric Bénard2010-07-261-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>
* mx5: Add registration of GPIOs for MX5 devicesDinh Nguyen2010-04-221-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>
* arm/imx/gpio: remove a BUG_ON in hot pathUwe Kleine-König2010-02-241-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>
* arm/imx/gpio: use fls to find set bits in the irq status registerUwe Kleine-König2010-02-241-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>
* arm/imx: use generic_handle_irq instead of open-coding itUwe Kleine-König2010-02-241-2/+1
| | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
* arm/imx/gpio: GPIO_INT_{HIGH,LOW}_LEV are not necessarily constantUwe Kleine-König2010-02-241-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>
* imx/gpio: Use handle_level_irqUwe Kleine-König2009-11-141-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>
* Add i.MX25 supportSascha Hauer2009-08-141-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MXC gpio interrupt support: move register definitions to .c fileSascha Hauer2009-08-071-0/+17
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mxc gpio: CONFIG_ARCH_* -> cpu_is_*()Sascha Hauer2009-08-071-14/+11
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mxc: emulate GPIO interrupt on both-edgesGuennadi Liakhovetski2009-05-071-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>
* MXC: remove BUG_ON in interrupt handlerSascha Hauer2009-05-051-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>
* mxc: first set GPIO level, then switch direction to outputGuennadi Liakhovetski2009-03-131-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>
* patch-mxc-add-ARCH_MX1Paulius Zaleckas2008-12-161-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>
* [ARM] MXC: Fix mxc_gpio_get(), which must read PSR register instead DR.Darius Augulis2008-10-301-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>
* [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/machRussell King2008-08-071-1/+1
| | | | | | This just leaves include/asm-arm/plat-* to deal with. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] Remove asm/hardware.h, use asm/arch/hardware.h insteadRussell King2008-08-071-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>
* [ARM] 5179/1: Replace obsolete IRQT_* and __IRQT_* values with IRQ_TYPE_*Dmitry Baryshkov2008-07-271-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>
* MXC arch: Add gpio support for the whole platformJuergen Beisert2008-07-051-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>
OpenPOWER on IntegriCloud