diff options
author | Eric Miao <eric.miao@marvell.com> | 2009-01-20 14:38:24 +0800 |
---|---|---|
committer | Eric Miao <eric.miao@marvell.com> | 2009-03-23 10:11:34 +0800 |
commit | e2bb6650ef94c64723e2dd35ab92410b9477bc64 (patch) | |
tree | 14dc515236c9a27d39b26005c66404dd08c8570f /arch/arm/mach-mmp/pxa168.c | |
parent | 40305a583a3e080a8d1aa126fa810480ec8cbabd (diff) | |
download | op-kernel-dev-e2bb6650ef94c64723e2dd35ab92410b9477bc64.zip op-kernel-dev-e2bb6650ef94c64723e2dd35ab92410b9477bc64.tar.gz |
[ARM] pxa: add GPIO support for pxa168
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'arch/arm/mach-mmp/pxa168.c')
-rw-r--r-- | arch/arm/mach-mmp/pxa168.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c index 1935c75..1774682 100644 --- a/arch/arm/mach-mmp/pxa168.c +++ b/arch/arm/mach-mmp/pxa168.c @@ -12,6 +12,7 @@ #include <linux/kernel.h> #include <linux/init.h> #include <linux/list.h> +#include <linux/io.h> #include <linux/clk.h> #include <asm/mach/time.h> @@ -19,15 +20,33 @@ #include <mach/cputype.h> #include <mach/regs-apbc.h> #include <mach/irqs.h> +#include <mach/gpio.h> #include <mach/dma.h> #include <mach/devices.h> #include "common.h" #include "clock.h" +#define APMASK(i) (GPIO_REGS_VIRT + BANK_OFF(i) + 0x09c) + +static void __init pxa168_init_gpio(void) +{ + int i; + + /* enable GPIO clock */ + __raw_writel(APBC_APBCLK | APBC_FNCLK, APBC_PXA168_GPIO); + + /* unmask GPIO edge detection for all 4 banks - APMASKx */ + for (i = 0; i < 4; i++) + __raw_writel(0xffffffff, APMASK(i)); + + pxa_init_gpio(IRQ_PXA168_GPIOX, 0, 127, NULL); +} + void __init pxa168_init_irq(void) { icu_init_irq(); + pxa168_init_gpio(); } /* APB peripheral clocks */ |