linux/arch/arm
eric miao 7facc2f937 [ARM] pxa: add MFP-alike pin configuration support for pxa{25x, 27x}
Pin configuration on pxa{25x,27x} has now separated from generic GPIO
into dedicated mfp-pxa2xx.c by this patch. The name "mfp" is borrowed
from pxa3xx and is used here to alert the difference between the two
concepts: pin configuration and generic GPIOs.  A GPIO can be called
a "GPIO" _only_ when the corresponding pin is configured so.

A pin configuration on pxa{25x,27x} is composed of:

    - alternate function selection (or pin mux as commonly called)
    - low power state or sleep state
    - wakeup enabling from low power mode

The following MFP_xxx bit definitions in mfp.h are re-used:

    - MFP_PIN(x)
    - MFP_AFx
    - MFP_LPM_DRIVE_{LOW, HIGH}
    - MFP_LPM_EDGE_*

Selecting alternate function on pxa{25x, 27x} involves configuration
of GPIO direction register GPDRx, so a new bit and MFP_DIR_{IN, OUT}
are introduced. And pin configurations are defined by the following
two macros:

    - MFP_CFG_IN  : for input alternate functions
    - MFP_CFG_OUT : for output alternate functions

Every configuration should provide a low power state if it configured
as output using MFP_CFG_OUT().  As a general guideline, the low power
state should be decided to minimize the overall power dissipation. As
an example, it is better to drive the pin as high level in low power
mode if the GPIO is configured as an active low chip select.

Pins configured as GPIO are defined by MFP_CFG_IN(). This is to avoid
side effects when it is firstly configured as output.  The actual
direction of the GPIO is configured by gpio_direction_{input, output}

Wakeup enabling on pxa{25x, 27x} is actually GPIO based wakeup, thus
the device based enable_irq_wake() mechanism is not applicable here.

E.g.  invoking enable_irq_wake() with a GPIO IRQ as in the following
code to enable OTG wakeup is by no means portable and intuitive, and
it is valid _only_ when GPIO35 is configured as USB_P2_1:

    enable_irq_wake( gpio_to_irq(35) );

To make things worse, not every GPIO is able to wakeup the system.
Only a small number of them can, on either rising or falling edge,
or when level is high (for keypad GPIOs).

Thus, another new bit is introduced to indicate that the GPIO will
wakeup the system:

    - MFP_LPM_WAKEUP_ENABLE

The following macros can be used in platform code, and be OR'ed to
the GPIO configuration to enable its wakeup:

    - WAKEUP_ON_EDGE_{RISE, FALL, BOTH}
    - WAKEUP_ON_LEVEL_HIGH

The WAKEUP_ON_LEVEL_HIGH is used for keypad GPIOs _only_, there is
no edge settings for those GPIOs.

These WAKEUP_ON_* flags OR'ed on wrong GPIOs will be ignored in case
that platform code author is careless enough.

The tradeoff here is that the wakeup source is fully determined by
the platform configuration, instead of enable_irq_wake().

Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-04-19 11:29:04 +01:00
..
boot Merge branch 'orion' into devel 2008-01-28 13:21:30 +00:00
common [ARM] replace remaining __FUNCTION__ occurrences 2008-03-06 12:18:18 +00:00
configs ARM: OMAP1: Compile in other 16xx boards to OSK defconfig 2008-03-06 13:28:06 +02:00
kernel [ARM] 4870/1: fix signal return code when enable CONFIG_OABI_COMPAT 2008-03-20 15:59:31 +00:00
lib [ARM] spelling fixes 2007-05-20 20:10:32 +01:00
mach-aaec2000 [ARM] Fix timer damage from d3d74453c3 2008-01-28 10:17:12 +00:00
mach-at91 [ARM] AT91: correct at91sam9263ek LCD power gpio pin 2008-03-06 12:18:18 +00:00
mach-clps711x [ARM] Fix timer damage from d3d74453c3 2008-01-28 10:17:12 +00:00
mach-clps7500 [ARM] Fix timer damage from d3d74453c3 2008-01-28 10:17:12 +00:00
mach-davinci [ARM] constify function pointer tables 2008-02-09 22:46:44 +00:00
mach-ebsa110 [ARM] Fix timer damage from d3d74453c3 2008-01-28 10:17:12 +00:00
mach-ep93xx Merge branches 'at91', 'ep93xx', 'iop', 'kprobes', 'ks8695', 'misc', 'msm', 's3c2410', 'sa1100' and 'vfp' into devel 2008-01-28 13:21:21 +00:00
mach-footbridge [ARM] Fix timer damage from d3d74453c3 2008-01-28 10:17:12 +00:00
mach-h720x [ARM] replace remaining __FUNCTION__ occurrences 2008-03-06 12:18:18 +00:00
mach-imx [ARM] replace remaining __FUNCTION__ occurrences 2008-03-06 12:18:18 +00:00
mach-integrator Merge branches 'at91', 'ep93xx', 'iop', 'kprobes', 'ks8695', 'misc', 'msm', 's3c2410', 'sa1100' and 'vfp' into devel 2008-01-28 13:21:21 +00:00
mach-iop13xx [ARM] replace remaining __FUNCTION__ occurrences 2008-03-06 12:18:18 +00:00
mach-iop32x [ARM] 4865/1: Register the F75375 device in the GLAN Tank platform code 2008-03-20 15:59:30 +00:00
mach-iop33x iop3xx: surface the iop3xx DMA and AAU units to the iop-adma driver 2007-07-13 08:06:19 -07:00
mach-ixp4xx [ARM] replace remaining __FUNCTION__ occurrences 2008-03-06 12:18:18 +00:00
mach-ixp23xx [ARM] remove duplicate includes 2008-01-26 14:50:07 +00:00
mach-ixp2000 [ARM] Fix timer damage from d3d74453c3 2008-01-28 10:17:12 +00:00
mach-ks8695 Merge branches 'at91', 'ep93xx', 'iop', 'kprobes', 'ks8695', 'misc', 'msm', 's3c2410', 'sa1100' and 'vfp' into devel 2008-01-28 13:21:21 +00:00
mach-l7200 [ARM] Remove compatibility layer for ARM irqs 2006-11-30 12:24:47 +00:00
mach-lh7a40x [ARM] Fix timer damage from d3d74453c3 2008-01-28 10:17:12 +00:00
mach-msm [ARM] msm: dma support for MSM7X00A 2008-01-26 14:39:14 +00:00
mach-mx3 [ARM] Fix timer damage from d3d74453c3 2008-01-28 10:17:12 +00:00
mach-netx [ARM] replace remaining __FUNCTION__ occurrences 2008-03-06 12:18:18 +00:00
mach-ns9xxx [ARM] 4851/1: ns9xxx: fix size of gpiores 2008-03-08 15:53:45 +00:00
mach-omap1 ARM: OMAP1: Fix typo in OMAP1 MPU clock source initialization 2008-03-20 16:57:54 +02:00
mach-omap2 ARM: OMAP2: Register the L4 io bus to boot OMAP2 2008-03-06 13:28:06 +02:00
mach-orion [ARM] 4856/1: Orion: initialise the sixth PCIe MBUS mapping window as well 2008-03-08 15:53:49 +00:00
mach-pnx4008 [ARM] replace remaining __FUNCTION__ occurrences 2008-03-06 12:18:18 +00:00
mach-pxa [ARM] pxa: add MFP-alike pin configuration support for pxa{25x, 27x} 2008-04-19 11:29:04 +01:00
mach-realview [ARM] 4822/1: RealView: Change the REALVIEW_MPCORE configuration option 2008-02-04 17:52:28 +00:00
mach-rpc Rename: linux/pata_platform.h to linux/ata_platform.h 2008-02-06 06:54:17 -05:00
mach-s3c2400 [ARM] 4157/2: S3C24XX: move arch/arch/mach-s3c2410 into cpu components 2007-02-11 17:36:09 +00:00
mach-s3c2410 Merge branches 'at91', 'ep93xx', 'iop', 'kprobes', 'ks8695', 'misc', 'msm', 's3c2410', 'sa1100' and 'vfp' into devel 2008-01-28 13:21:21 +00:00
mach-s3c2412 [ARM] 4791/1: S3C2412: Make fclk a parent of msysclk 2008-01-28 13:20:52 +00:00
mach-s3c2440 [ARM] 4794/1: S3C24XX: Comonise S3C2440 and S3C2442 clock code 2008-01-28 13:20:52 +00:00
mach-s3c2442 [ARM] 4794/1: S3C24XX: Comonise S3C2440 and S3C2442 clock code 2008-01-28 13:20:52 +00:00
mach-s3c2443 Driver core: change sysdev classes to use dynamic kobject names 2008-01-24 20:40:40 -08:00
mach-sa1100 [ARM] replace remaining __FUNCTION__ occurrences 2008-03-06 12:18:18 +00:00
mach-shark [ARM] Fix timer damage from d3d74453c3 2008-01-28 10:17:12 +00:00
mach-versatile [ARM] 4454/1: Use word accesses in Versatile PCI config reads 2007-07-02 13:39:35 +01:00
mm [ARM] 4864/1: Enable write buffer coalescing on IOP 2008-03-20 15:59:30 +00:00
nwfpe Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
oprofile Driver core: change sysdev classes to use dynamic kobject names 2008-01-24 20:40:40 -08:00
plat-iop [ARM] replace remaining __FUNCTION__ occurrences 2008-03-06 12:18:18 +00:00
plat-mxc [ARM] 4461/1: MXC platform and i.MX31ADS core support 2007-07-22 15:44:46 +01:00
plat-omap ARM: OMAP: Fix DMA CLINK mask, clear spurious interrupt 2008-03-20 16:57:54 +02:00
plat-s3c [ARM] 4518/1: S3C: Rename watchdog configuration options 2007-07-22 16:44:38 +01:00
plat-s3c24xx [ARM] replace remaining __FUNCTION__ occurrences 2008-03-06 12:18:18 +00:00
tools [ARM] Update mach-types 2008-04-19 11:28:05 +01:00
vfp [ARM] 4583/1: ARMv7: Add VFPv3 support 2008-01-26 14:41:28 +00:00
Kconfig ARM: OMAP: Fix clockevent support for hrtimers 2008-03-20 16:56:09 +02:00
Kconfig-nommu [ARM] 4532/1: allow configuration of processor ID 2007-10-12 23:43:02 +01:00
Kconfig.debug [ARM] CONFIG_DEBUG_STACK_USAGE 2008-01-26 14:50:06 +00:00
Makefile [ARM] 4853/1: include uImage target in make help 2008-03-08 15:53:47 +00:00