kernel-ark/arch/arm/mach-pxa
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
..
akita-ioexp.c i2c: normal_i2c can be made const (remaining drivers) 2008-01-27 18:14:47 +01:00
clock.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
clock.h
cm-x270-pci.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
cm-x270-pci.h
cm-x270.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
colibri.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
corgi_lcd.c [ARM] 4737/1: Refactor corgi_lcd to improve readability + bugfix 2008-01-28 13:13:25 +00:00
corgi_pm.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
corgi_ssp.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
corgi.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
cpu-pxa.c [ARM] eliminate MODULE_PARM() usage 2008-02-29 22:47:17 +00:00
devices.c [ARM] pxa: fix the warning of undeclared "struct pxaohci_platform_data" 2008-02-04 13:17:32 +00:00
devices.h [ARM] pxa: mmc: add 3rd host controller support for pxa310 2008-01-26 15:07:53 +00:00
dma.c [ARM] replace remaining __FUNCTION__ occurrences 2008-03-06 12:18:18 +00:00
em-x270.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
eseries.c [ARM] 4649/1: Base support for pxa-based Toshiba e-series PDAs. 2008-01-28 13:13:13 +00:00
generic.c [ARM] pxa: move GPIO sysdev outside of generic.c into gpio.c 2008-04-19 11:29:04 +01:00
generic.h [ARM] pxa: move mfp sysdev registeration out for suspend/resume order 2008-04-19 11:29:04 +01:00
gpio.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
idp.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
irq.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
Kconfig [ARM] 4762/1: Basic support for Toradex Colibri module 2008-01-28 13:13:27 +00:00
leds-idp.c
leds-lubbock.c
leds-mainstone.c
leds-trizeps4.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
leds.c
leds.h
littleton.c [NET] smc91x: Make smc91x use IRQ resource trigger flags 2008-01-28 13:13:19 +00:00
lpd270.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
lubbock.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
magician.c [ARM] 4664/1: Add basic support for HTC Magician PDA phones 2008-01-28 13:13:16 +00:00
mainstone.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
Makefile [ARM] pxa: add MFP-alike pin configuration support for pxa{25x, 27x} 2008-04-19 11:29:04 +01:00
Makefile.boot
mfp-pxa2xx.c [ARM] pxa: add MFP-alike pin configuration support for pxa{25x, 27x} 2008-04-19 11:29:04 +01:00
mfp-pxa3xx.c [ARM] pxa: move mfp sysdev registeration out for suspend/resume order 2008-04-19 11:29:04 +01:00
pcm027.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
pcm990-baseboard.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
pm.c [ARM] pxa: skip registers saving/restoring if entering standby mode 2008-01-26 15:07:57 +00:00
poodle.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
pxa3xx.c [ARM] pxa: move mfp sysdev registeration out for suspend/resume order 2008-04-19 11:29:04 +01:00
pxa25x.c [ARM] pxa: merge assignment of set_wake into pxa_init_{irq,gpio}() 2008-04-19 11:29:04 +01:00
pxa27x.c [ARM] pxa: merge assignment of set_wake into pxa_init_{irq,gpio}() 2008-04-19 11:29:04 +01:00
pxa300.c
pxa320.c
sharpsl_pm.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
sharpsl.h [ARM] 4737/1: Refactor corgi_lcd to improve readability + bugfix 2008-01-28 13:13:25 +00:00
sleep.S [ARM] pxa: add preliminary suspend/resume code for pxa3xx 2008-02-04 13:17:33 +00:00
smemc.c [ARM] pxa: introduce sysdev for pxa3xx static memory controller 2008-02-04 13:17:33 +00:00
spitz_pm.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
spitz.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
ssp.c Merge branch 'pxa-plat' into devel 2008-01-28 13:21:38 +00:00
standby.S [ARM] pxa: Add PXA3 standby code hooked into the IRQ wake scheme 2008-01-26 15:07:56 +00:00
time.c [ARM] pxa: fix PXA27x resume 2008-01-26 15:07:57 +00:00
tosa.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
trizeps4.c [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h 2008-04-19 11:29:04 +01:00
zylonite_pxa300.c [ARM] pxa: Add zylonite MFP wakeup configurations 2008-01-26 15:07:56 +00:00
zylonite_pxa320.c [ARM] pxa: Add zylonite MFP wakeup configurations 2008-01-26 15:07:56 +00:00
zylonite.c [ARM] 4841/1: pxa: fix typo in LCD platform data definition code for zylonite 2008-02-29 22:47:25 +00:00