linux/arch/arm
Cory Maccarrone 4318f36b7c omap: gpio: Simultaneously requested rising and falling edge
Some chips, namely any OMAP1 chips using METHOD_MPUIO,
OMAP15xx and OMAP7xx, cannot be setup to respond to on-chip GPIO
interrupts in both rising and falling edge directions -- they can
only respond to one direction or the other, depending on how the
ICR is configured.

Additionally, current code forces rising edge detection if both
flags are specified:

        if (trigger & IRQ_TYPE_EDGE_RISING)
                l |= 1 << gpio;
        else if (trigger & IRQ_TYPE_EDGE_FALLING)
                l &= ~(1 << gpio);
        else
                goto bad;

This change implements a toggle function that will modify the ICR
to flip the direction of interrupt for IRQs that are requested with
both rising and falling flags.  The toggle function is not called
for chips and GPIOs it does not apply to through the use of a flip_mask
that's added on a per-bank basis.  The mask is only set for those
GPIOs where a toggle is necessary.  Edge detection starts out the
same as above with FALLING mode first.

The toggle happens on EACH interrupt; without it, we have the
following sequence of actions on GPIO transition:

  ICR    GPIO               Result
  0x1    0 -> 1 (rising)    Interrupt
  0x1    1 -> 0 (falling)   No interrupt

  (set ICR to 0x0 manually)
  0x0    0 -> 1 (rising)    No interrupt
  0x0    1 -> 0 (falling)   Interrupt

That is, with the ICR set to 1 for a gpio, only rising edge interrupts
are caught, and with it set to 0, only falling edge interrupts are
caught.  If we add in the toggle, we get this:

  ICR    GPIO               Result
  0x1    0 -> 1 (rising)    Interrupt (ICR set to 0x0)
  0x0    1 -> 0 (falling)   Interrupt (ICR set to 0x1)
  0x1    0 -> 1 ...

so, both rising and falling are caught, per the request for both
(IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING).

Signed-off-by: Cory Maccarrone <darkstar6262@gmail.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2010-01-08 10:29:04 -08:00
..
boot ARM: add base support for Marvell Dove SoC 2009-11-27 15:43:06 -05:00
common ARM: 5857/1: ARM: dmabounce: fix build 2009-12-22 15:32:32 +00:00
configs ARM: Kill CONFIG_CPU_32 2009-12-18 16:07:53 +00:00
include/asm ARM: Kill CONFIG_CPU_32 2009-12-18 16:07:53 +00:00
kernel ARM: dma-isa: request cascade channel after registering it 2009-12-24 18:34:08 +00:00
lib
mach-aaec2000
mach-at91 atmel-mci: change use of dma slave interface 2009-12-15 08:53:35 -08:00
mach-bcmring Merge git://git.infradead.org/mtd-2.6 2009-12-16 10:23:43 -08:00
mach-clps711x ARM: fix clps711x, footbridge, integrator, ixp2000, ixp2300 and s3c build bug 2009-12-13 16:33:19 +00:00
mach-davinci Merge git://git.infradead.org/mtd-2.6 2009-12-16 10:23:43 -08:00
mach-dove ARM: Add Tauros2 L2 cache controller support 2009-11-27 15:43:21 -05:00
mach-ebsa110
mach-ep93xx Input: ep93xx_keypad - update driver to new core support 2009-12-15 08:54:45 -08:00
mach-footbridge ARM: footbridge: trim down old ISA rtc setup 2009-12-24 13:39:18 +00:00
mach-gemini
mach-h720x
mach-integrator ARM: fix clps711x, footbridge, integrator, ixp2000, ixp2300 and s3c build bug 2009-12-13 16:33:19 +00:00
mach-iop13xx Merge branch 'devel-stable' into devel 2009-12-05 10:35:33 +00:00
mach-iop32x
mach-iop33x
mach-ixp4xx IXP4xx: GTWX5715 platform only has two PCI IRQ lines, not four. 2009-12-05 16:58:41 +01:00
mach-ixp23xx ARM: fix clps711x, footbridge, integrator, ixp2000, ixp2300 and s3c build bug 2009-12-13 16:33:19 +00:00
mach-ixp2000 ARM: fix clps711x, footbridge, integrator, ixp2000, ixp2300 and s3c build bug 2009-12-13 16:33:19 +00:00
mach-kirkwood [ARM] Kirkwood: Add LaCie Network Space v2 support 2009-12-10 23:01:57 -05:00
mach-ks8695 ARM: dma-mapping: provide dma_to_page() 2009-11-23 12:53:54 +00:00
mach-l7200
mach-lh7a40x ARM: fix lh7a40x build 2009-12-13 19:39:20 +00:00
mach-loki
mach-mmp [ARM] pxa: add apmu clock support in mmp 2009-12-01 09:02:51 +08:00
mach-msm HTC Dream: mmc compilation fixes 2009-12-10 10:14:34 -08:00
mach-mv78xx0
mach-mx1
mach-mx2 mx27: mxt_td60: Add support to SD/MMC 2009-12-02 12:06:14 +01:00
mach-mx3 mx31moboard: fix typo 2009-12-04 13:23:41 +01:00
mach-mx25
mach-mxc91231
mach-netx
mach-nomadik Merge git://git.infradead.org/mtd-2.6 2009-12-16 10:23:43 -08:00
mach-ns9xxx genirq: Convert irq_desc.lock to raw_spinlock 2009-12-14 23:55:33 +01:00
mach-omap1 omap1: LCD_DMA: Use some define rather than a hexadecimal 2009-12-11 16:16:36 -08:00
mach-omap2 OMAP3: serial - fix bug introduced in 2009-12-16 12:44:04 -08:00
mach-orion5x tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
mach-pnx4008
mach-pxa [ARM] pxa: fix no reference of cpu_is_pxa25x() in devices.c 2009-12-16 21:35:52 +08:00
mach-realview ARM: RealView: Fix typo in the RealView/PBX Kconfig entry 2009-12-09 13:19:42 +00:00
mach-rpc
mach-s3c24a0/include/mach ARM: fix clps711x, footbridge, integrator, ixp2000, ixp2300 and s3c build bug 2009-12-13 16:33:19 +00:00
mach-s3c2400 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
mach-s3c2410 ARM: S3C24XX: touchscreen device definition 2009-12-23 19:28:12 +00:00
mach-s3c2412 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
mach-s3c2440 ARM: mach-osiris: add NAND_SCAN_SILENT_NODEV to optional devices 2009-12-23 19:28:11 +00:00
mach-s3c2442 Merge git://git.infradead.org/battery-2.6 2009-12-15 08:59:33 -08:00
mach-s3c2443
mach-s3c6400 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
mach-s3c6410 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
mach-s5pc100 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
mach-sa1100 ARM: fix sa1100 build 2009-12-13 19:38:08 +00:00
mach-shark
mach-stmp37xx
mach-stmp378x
mach-u300 Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx 2009-12-16 10:28:56 -08:00
mach-ux500 ARM: 5832/1: ARM: U8500 Makefile.boot 2009-11-28 10:22:52 +00:00
mach-versatile
mach-w90x900 ARM: 5856/1: Fix bug of uart0 platfrom data for nuc900 2009-12-22 15:32:32 +00:00
mm ARM: fix PAGE_KERNEL 2009-12-24 10:16:21 +00:00
nwfpe ARM: Kill CONFIG_CPU_32 2009-12-18 16:07:53 +00:00
oprofile ARM: 5849/1: ARMv7: fix Oprofile events count 2009-12-22 15:32:31 +00:00
plat-iop
plat-mxc Merge git://git.infradead.org/mtd-2.6 2009-12-16 10:23:43 -08:00
plat-nomadik ARM: 5833/1: ARM nomadik: enable U8500 for common platform 2009-11-28 10:22:53 +00:00
plat-omap omap: gpio: Simultaneously requested rising and falling edge 2010-01-08 10:29:04 -08:00
plat-orion
plat-pxa pxa3xx_nand: move pxa3xx_nand.h common into plat directory 2009-12-01 09:02:43 +08:00
plat-s3c ARM: S3C: Fix NAND device registration by s3c_nand_set_platdata(). 2009-12-23 20:34:29 +00:00
plat-s3c24xx ARM: S3C24XX: touchscreen device definition 2009-12-23 19:28:12 +00:00
plat-s3c64xx Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
plat-s5pc1xx Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
plat-samsung ARM: SAMSUNG: Add plat-samsung as starting point for plat-s3c* moves 2009-12-01 01:28:37 +00:00
plat-stmp3xxx
tools Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2009-12-17 15:53:41 -08:00
vfp ARM: Convert VFP/Crunch/XscaleCP thread_release() to exit_thread() 2009-12-18 14:53:41 +00:00
Kconfig ARM: fix sa1100 build 2009-12-13 19:38:08 +00:00
Kconfig-nommu
Kconfig.debug Merge branch 'devel' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6 into devel 2009-12-13 16:35:09 +00:00
Makefile arm: move mach-types to include/generated 2009-12-12 13:08:14 +01:00