summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mmp/mmp2.c
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@gmail.com>2010-01-25 06:03:54 -0500
committerEric Miao <eric.y.miao@gmail.com>2010-03-02 07:40:56 +0800
commit16144bfb83bb8319c07c18b57eac15368708d02c (patch)
tree3544731005719bd1b2f9ba70efcb2233cf9437cf /arch/arm/mach-mmp/mmp2.c
parent247b4592f385622774de877f568fc30eb37dc831 (diff)
[ARM] mmp2: add gpio initialization
Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-mmp/mmp2.c')
-rw-r--r--arch/arm/mach-mmp/mmp2.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c
index 561194d3bb4..0f1c441cc89 100644
--- a/arch/arm/mach-mmp/mmp2.c
+++ b/arch/arm/mach-mmp/mmp2.c
@@ -21,6 +21,7 @@
#include <mach/cputype.h>
#include <mach/irqs.h>
#include <mach/mfp.h>
+#include <mach/gpio.h>
#include <mach/devices.h>
#include "common.h"
@@ -28,12 +29,34 @@
#define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000)
+#define APMASK(i) (GPIO_REGS_VIRT + BANK_OFF(i) + 0x9c)
+
static struct mfp_addr_map mmp2_addr_map[] __initdata = {
MFP_ADDR(PMIC_INT, 0x2c4),
MFP_ADDR_END,
};
+static void __init mmp2_init_gpio(void)
+{
+ int i;
+
+ /* enable GPIO clock */
+ __raw_writel(APBC_APBCLK | APBC_FNCLK, APBC_MMP2_GPIO);
+
+ /* unmask GPIO edge detection for all 6 banks -- APMASKx */
+ for (i = 0; i < 6; i++)
+ __raw_writel(0xffffffff, APMASK(i));
+
+ pxa_init_gpio(IRQ_MMP2_GPIO, 0, 167, NULL);
+}
+
+void __init mmp2_init_irq(void)
+{
+ mmp2_init_icu();
+ mmp2_init_gpio();
+}
+
/* APB peripheral clocks */
static APBC_CLK(uart1, MMP2_UART1, 1, 26000000);
static APBC_CLK(uart2, MMP2_UART2, 1, 26000000);