]> Pileus Git - ~andy/linux/commit
[ARM] 4669/1: ep93xx: simplify GPIO code and cleanups
authorHerbert Valerio Riedel <hvr@gnu.org>
Mon, 26 Nov 2007 17:45:59 +0000 (18:45 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 26 Jan 2008 14:37:31 +0000 (14:37 +0000)
commit7ca722533979d47563e75a40c86c405153818b83
treef715a2f370d300587736b47d32f3fe64bdecf2ce
parent4e9f9fd5148004b983b29e15de66918e71da56c0
[ARM] 4669/1: ep93xx: simplify GPIO code and cleanups

This patch renumbers the (virtual) GPIO line numbering to have all
irq-capable gpio lines <= EP93XX_GPIO_LINE_MAX_IRQ by swapping the
port f range with the port c range; This simplifies code such as

 #define IRQ_EP93XX_GPIO(x)  (64 + (((x) + (((x) >> 2) & 8)) & 0x1f))

or

 if (line >= 0 && line < 16) {
    /* Port A/B */
 } else if (line >= 40 && line < 48) {
    /* Port F */
 }

considerably; in addition to the renumbering this patch also
introduces macro constants EP93XX_GPIO_LINE_MAX_IRQ and
EP93XX_GPIO_LINE_MAX, and replaces most magic numbers by those and
invocations of gpio_to_irq()/irq_to_gpio().

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-ep93xx/core.c
include/asm-arm/arch-ep93xx/gpio.h
include/asm-arm/arch-ep93xx/irqs.h