kernel-ark/include
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
..
acpi ACPI, cpuidle: Clarify C-state description in sysfs 2008-02-14 00:09:55 -05:00
asm-alpha CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
asm-arm [ARM] pxa: add MFP-alike pin configuration support for pxa{25x, 27x} 2008-04-19 11:29:04 +01:00
asm-avr32 AVR32: Define PAGE_SHARED 2008-02-13 14:44:03 +01:00
asm-blackfin [Blackfin] arch: current_l1_stack_save is a pointer, so use NULL rather than 0 2008-03-05 19:02:23 -07:00
asm-cris cris: correct syscall numbers in unistd.h for timerfd_settime and timerfd_gettime 2008-03-04 16:35:16 -08:00
asm-frv FRV: Change the timerfd syscalls to be the same as i386 2008-02-20 19:58:16 -08:00
asm-generic percpu: fix DEBUG_PREEMPT per_cpu checking 2008-02-23 12:09:28 -08:00
asm-h8300 h8300: fix recent uaccess breakage 2008-03-13 13:11:43 -07:00
asm-ia64 [IA64] kprobes arch consolidation build fix 2008-03-06 09:49:01 -08:00
asm-m32r CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
asm-m68k m68k{,nommu}: Wire up new timerfd syscalls 2008-03-04 08:04:11 -08:00
asm-m68knommu m68k{,nommu}: Wire up new timerfd syscalls 2008-03-04 08:04:11 -08:00
asm-mips [MIPS] Clocksource: Only install r4k counter as clocksource if present. 2008-03-12 14:14:42 +00:00
asm-mn10300 Really unexport asm/page.h 2008-03-06 08:13:47 -08:00
asm-parisc [PARISC] futex: special case cmpxchg NULL in kernel space 2008-03-15 19:12:17 -07:00
asm-powerpc [POWERPC] 8xx: fix swap 2008-03-07 08:42:28 -06:00
asm-ppc [PPC] 8xx: swap bug-fix 2008-03-07 16:56:54 -06:00
asm-s390 Kprobes: indicate kretprobe support in Kconfig 2008-03-04 16:35:11 -08:00
asm-sh sh: Fix more user header breakage from sh64 integration. 2008-03-14 17:21:09 +09:00
asm-sparc [SPARC]: Add reboot_command[] extern decl to asm/system.h 2008-02-28 21:53:20 -08:00
asm-sparc64 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2008-03-24 13:08:01 -07:00
asm-um uml: x86_64 should copy %fs during fork 2008-02-08 09:22:43 -08:00
asm-v850 Add pgtable_t to remaining nommu architectures 2008-02-09 11:08:33 -08:00
asm-x86 x86-32: Pass the full resource data to ioremap() 2008-03-24 11:22:39 -07:00
asm-xtensa [XTENSA] Allow debugger to modify the WINDOWBASE register. 2008-02-13 17:45:36 -08:00
crypto [CRYPTO] skcipher: Fix section mismatches 2008-03-08 20:29:43 +08:00
keys
linux Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 2008-03-24 23:24:16 -07:00
math-emu
media V4L/DVB (7192): Adds support for Genius TVGo A11MCE 2008-02-18 11:15:19 -03:00
mtd
net [SCTP]: Fix build warnings with IPV6 disabled. 2008-03-21 15:40:47 -07:00
pcmcia
rdma IB/core: Remove unused struct ib_device.flags member 2008-02-08 14:47:26 -08:00
rxrpc
scsi [SCSI] iscsi class: regression - fix races with state manipulation and blocking/unblocking 2008-03-05 12:04:09 -06:00
sound [ALSA] opl3 - Fix compilation without sequencer support 2008-02-22 14:20:08 -08:00
video atmel_lcdfb: backlight control 2008-02-06 10:41:16 -08:00
xen
Kbuild