update for gpio
author沈睿汀 <srt@rock-chips.com>
Thu, 29 Apr 2010 09:10:42 +0000 (09:10 +0000)
committer黄涛 <huangtao@rock-chips.com>
Mon, 21 Jun 2010 05:34:48 +0000 (13:34 +0800)
arch/arm/mach-rk2818/Kconfig
arch/arm/mach-rk2818/board-midsdk.c

index e121931001995521cb60c7cade7549b65beece3c..bd9c54ee6dcb1d844141e1b86051f32a86285e68 100644 (file)
@@ -10,4 +10,8 @@ config MACH_RK2818MID
        help
          Support for the ROCKCHIP Board For Rk2818 Mid.
 
+config RK28_GPIO_IRQ
+       int
+       default 16 if ARCH_RK2818       
+       default 0       
 endif
index 15b42ae5a6b30c88ad7781496f6070e2860ead8e..97d89ccc18cc7e5fbc435a322c1988a2c46db8fc 100644 (file)
 #include <mach/board.h>
 #include <mach/rk2818_iomap.h>
 #include <mach/iomux.h>
+#include <mach/gpio.h>
 
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
 
 #include "devices.h"
+
+
+/* --------------------------------------------------------------------
+ *  ÉùÃ÷ÁËrk2818_gpioBankÊý×飬²¢¶¨ÒåÁËGPIO¼Ä´æÆ÷×éIDºÍ¼Ä´æÆ÷»ùµØÖ·¡£
+ * -------------------------------------------------------------------- */
+
+static struct rk2818_gpio_bank rk2818_gpioBank[] = {
+               {
+               .id             = AT2818_ID_PIOA,
+               .offset         = RK2818_GPIO0_BASE,
+               .clock          = NULL,
+       }, 
+               {
+               .id             = AT2818_ID_PIOB,
+               .offset         = RK2818_GPIO0_BASE,
+               .clock          = NULL,
+       }, 
+               {
+               .id             = AT2818_ID_PIOC,
+               .offset         = RK2818_GPIO0_BASE,
+               .clock          = NULL,
+       }, 
+               {
+               .id             = AT2818_ID_PIOD,
+               .offset         = RK2818_GPIO0_BASE,
+               .clock          = NULL,
+       },
+               {
+               .id             = AT2818_ID_PIOE,
+               .offset         = RK2818_GPIO1_BASE,
+               .clock          = NULL,
+       },
+               {
+               .id             = AT2818_ID_PIOF,
+               .offset         = RK2818_GPIO1_BASE,
+               .clock          = NULL,
+       },
+               {
+               .id             = AT2818_ID_PIOG,
+               .offset         = RK2818_GPIO1_BASE,
+               .clock          = NULL,
+       },
+               {
+               .id             = AT2818_ID_PIOH,
+               .offset         = RK2818_GPIO1_BASE,
+               .clock          = NULL,
+       }
+};
+
 //IOÓ³É䷽ʽÃèÊö £¬Ã¿¸öΪһ¶ÎÏßÐÔÁ¬ÐøÓ³Éä
 static struct map_desc rk2818_io_desc[] __initdata = {
 
@@ -98,11 +148,14 @@ extern struct sys_timer rk2818_timer;
 static void __init machine_rk2818_init_irq(void)
 {
        rk2818_init_irq();
+       rk2818_gpio_init(rk2818_gpioBank, 8);
+       rk2818_gpio_irq_setup();
 }
 
 static void __init machine_rk2818_board_init(void)
 {
        platform_add_devices(devices, ARRAY_SIZE(devices));
+
 }
 
 static void __init machine_rk2818_mapio(void)