From 1fdb1023a5a2c062fc43efb7c8a1119d0d9431bb Mon Sep 17 00:00:00 2001
From: root <root@ubuntu.(none)>
Date: Tue, 15 Feb 2011 16:27:13 +0800
Subject: [PATCH] (wqq) add malata machine borad file

---
 Makefile                                  |   2 +-
 arch/arm/configs/rk29_malata_defconfig    |  39 +++---
 arch/arm/mach-rk29/Makefile               |   2 +-
 arch/arm/mach-rk29/board-malata.c         | 148 ++++++++++++++++++++--
 arch/arm/mach-rk29/board-rk29malata-key.c | 110 ++++++++++++++++
 drivers/video/backlight/rk29_backlight.c  |   2 +-
 6 files changed, 267 insertions(+), 36 deletions(-)
 mode change 100644 => 100755 Makefile
 mode change 100755 => 100644 arch/arm/mach-rk29/board-malata.c
 create mode 100644 arch/arm/mach-rk29/board-rk29malata-key.c
 mode change 100644 => 100755 drivers/video/backlight/rk29_backlight.c

diff --git a/Makefile b/Makefile
old mode 100644
new mode 100755
index 7be29d6c48cd..03ad8a446458
--- a/Makefile
+++ b/Makefile
@@ -184,7 +184,7 @@ export KBUILD_BUILDHOST := $(SUBARCH)
 #CROSS_COMPILE	?=
 ARCH		?= arm
 #CROSS_COMPILE	:=/opt/android0320/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi-
-CROSS_COMPILE	?=../toolchain/arm-eabi-4.4.0/bin/arm-eabi-
+CROSS_COMPILE	?=../../rkandroid2.1/kernel25_281x_A7/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
 
 # Architecture as present in compile.h
 UTS_MACHINE 	:= $(ARCH)
diff --git a/arch/arm/configs/rk29_malata_defconfig b/arch/arm/configs/rk29_malata_defconfig
index f29b276aaabe..b17e870c5434 100644
--- a/arch/arm/configs/rk29_malata_defconfig
+++ b/arch/arm/configs/rk29_malata_defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.32.27
-# Wed Jan 26 16:33:21 2011
+# Tue Feb 15 16:16:01 2011
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -301,21 +301,7 @@ CONFIG_ATAGS_PROC=y
 #
 # CPU Power Management
 #
-CONFIG_CPU_FREQ=y
-CONFIG_CPU_FREQ_TABLE=y
-# CONFIG_CPU_FREQ_DEBUG is not set
-CONFIG_CPU_FREQ_STAT=y
-CONFIG_CPU_FREQ_STAT_DETAILS=y
-# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
-CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
-# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
-CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
-CONFIG_CPU_FREQ_GOV_POWERSAVE=y
-CONFIG_CPU_FREQ_GOV_USERSPACE=y
-CONFIG_CPU_FREQ_GOV_ONDEMAND=y
-CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+# CONFIG_CPU_FREQ is not set
 # CONFIG_CPU_IDLE is not set
 
 #
@@ -593,8 +579,7 @@ CONFIG_ANDROID_PMEM=y
 # CONFIG_ISL29003 is not set
 # CONFIG_UID_STAT is not set
 # CONFIG_WL127X_RFKILL is not set
-CONFIG_APANIC=y
-CONFIG_APANIC_PLABEL="kpanic"
+# CONFIG_APANIC is not set
 # CONFIG_STE is not set
 # CONFIG_C2PORT is not set
 
@@ -605,6 +590,8 @@ CONFIG_APANIC_PLABEL="kpanic"
 # CONFIG_EEPROM_LEGACY is not set
 # CONFIG_EEPROM_MAX6875 is not set
 # CONFIG_EEPROM_93CX6 is not set
+CONFIG_RK29_SUPPORT_MODEM=y
+CONFIG_MODEM_ROCKCHIP_DEMO=y
 CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
@@ -729,8 +716,20 @@ CONFIG_BCM4329=y
 # CONFIG_USB_USBNET is not set
 # CONFIG_USB_HSO is not set
 # CONFIG_WAN is not set
-# CONFIG_PPP is not set
+CONFIG_PPP=y
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=y
+CONFIG_PPP_SYNC_TTY=y
+# CONFIG_PPP_DEFLATE is not set
+CONFIG_PPP_BSDCOMP=y
+CONFIG_PPP_MPPE=y
+CONFIG_PPPOE=y
+CONFIG_PPPOL2TP=y
+CONFIG_PPPOLAC=y
+CONFIG_PPPOPNS=y
 # CONFIG_SLIP is not set
+CONFIG_SLHC=y
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
@@ -1021,6 +1020,7 @@ CONFIG_VIDEO_V4L2=y
 CONFIG_VIDEO_V4L1=y
 CONFIG_VIDEOBUF_GEN=y
 CONFIG_VIDEOBUF_DMA_CONTIG=y
+# CONFIG_VIDEO_RK29XX_VOUT is not set
 CONFIG_VIDEO_CAPTURE_DRIVERS=y
 # CONFIG_VIDEO_ADV_DEBUG is not set
 # CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
@@ -1044,6 +1044,7 @@ CONFIG_SOC_CAMERA=y
 # CONFIG_SOC_CAMERA_OV9650 is not set
 # CONFIG_SOC_CAMERA_OV3640 is not set
 # CONFIG_SOC_CAMERA_OV5642 is not set
+# CONFIG_SOC_CAMERA_OV5640 is not set
 CONFIG_SOC_CAMERA_S5K6AA=y
 # CONFIG_VIDEO_SH_MOBILE_CEU is not set
 CONFIG_VIDEO_RK29=y
diff --git a/arch/arm/mach-rk29/Makefile b/arch/arm/mach-rk29/Makefile
index 85f69c512e3d..1983c8950f74 100755
--- a/arch/arm/mach-rk29/Makefile
+++ b/arch/arm/mach-rk29/Makefile
@@ -5,4 +5,4 @@ obj-$(CONFIG_RK29_VPU) += vpu.o vpu_mem.o
 obj-$(CONFIG_MACH_RK29SDK) += board-rk29sdk.o board-rk29sdk-key.o board-rk29sdk-rfkill.o
 obj-$(CONFIG_MACH_RK29WINACCORD) += board-rk29-winaccord.o board-rk29sdk-key.o
 obj-$(CONFIG_MACH_RK29_AIGO) += board-rk29-aigo.o board-rk29aigo-key.o board-rk29sdk-rfkill.o
-obj-$(CONFIG_MACH_RK29_MALATA) += board-malata.o board-rk29sdk-key.o board-rk29sdk-rfkill.o
+obj-$(CONFIG_MACH_RK29_MALATA) += board-malata.o board-rk29malata-key.o board-rk29sdk-rfkill.o
diff --git a/arch/arm/mach-rk29/board-malata.c b/arch/arm/mach-rk29/board-malata.c
old mode 100755
new mode 100644
index 0f7f67c0b38b..caca88cfb8db
--- a/arch/arm/mach-rk29/board-malata.c
+++ b/arch/arm/mach-rk29/board-malata.c
@@ -42,6 +42,7 @@
 #include <mach/rk29_camera.h>                          /* ddl@rock-chips.com : camera support */
 #include <media/soc_camera.h>                               /* ddl@rock-chips.com : camera support */
 #include <mach/vpu_mem.h>
+#include <mach/sram.h>
 
 #include <linux/regulator/rk29-pwm-regulator.h>
 #include <linux/regulator/machine.h>
@@ -78,9 +79,27 @@
 #define MEM_FB_BASE         (MEM_CAMIPP_BASE - MEM_FB_SIZE)
 #define LINUX_SIZE          (MEM_FB_BASE - RK29_SDRAM_PHYS)
 
+#define PREALLOC_WLAN_SEC_NUM           4
+#define PREALLOC_WLAN_BUF_NUM           160
+#define PREALLOC_WLAN_SECTION_HEADER    24
+
+#define WLAN_SECTION_SIZE_0     (PREALLOC_WLAN_BUF_NUM * 128)
+#define WLAN_SECTION_SIZE_1     (PREALLOC_WLAN_BUF_NUM * 128)
+#define WLAN_SECTION_SIZE_2     (PREALLOC_WLAN_BUF_NUM * 512)
+#define WLAN_SECTION_SIZE_3     (PREALLOC_WLAN_BUF_NUM * 1024)
+
+#define WLAN_SKB_BUF_NUM        16
+
+static struct sk_buff *wlan_static_skb[WLAN_SKB_BUF_NUM];
+
+struct wifi_mem_prealloc {
+        void *mem_ptr;
+        unsigned long size;
+};
+
 extern struct sys_timer rk29_timer;
 
-int rk29_nand_io_init(void)
+static int rk29_nand_io_init(void)
 {
     return 0;
 }
@@ -127,7 +146,7 @@ static int rk29_lcd_io_deinit(void)
     return ret;
 }
 
-struct rk29lcd_info rk29_lcd_info = {
+static struct rk29lcd_info rk29_lcd_info = {
     .txd_pin  = LCD_TXD_PIN,
     .clk_pin = LCD_CLK_PIN,
     .cs_pin = LCD_CS_PIN,
@@ -184,7 +203,7 @@ static int rk29_fb_io_init(struct rk29_fb_setting_info *fb_setting)
     return ret;
 }
 
-struct rk29fb_info rk29_fb_info = {
+static struct rk29fb_info rk29_fb_info = {
     .fb_id   = FB_ID,
     .disp_on_pin = FB_DISPLAY_ON_PIN,
     .disp_on_value = FB_DISPLAY_ON_VALUE,
@@ -196,7 +215,7 @@ struct rk29fb_info rk29_fb_info = {
 };
 
 /* rk29 fb resource */
-struct resource rk29_fb_resource[] = {
+static struct resource rk29_fb_resource[] = {
 	[0] = {
         .name  = "lcdc reg",
 		.start = RK29_LCDC_PHYS,
@@ -227,6 +246,13 @@ struct platform_device rk29_device_fb = {
 		.platform_data  = &rk29_fb_info,
 	}
 };
+
+struct platform_device rk29_device_dma_cpy = {
+	.name		  = "dma_memcpy",
+	.id		  = 4,
+
+};
+
 #endif
 
 static struct android_pmem_platform_data android_pmem_pdata = {
@@ -278,6 +304,9 @@ static struct platform_device rk29_vpu_mem_device = {
 	},
 };
 
+static struct platform_device rk29_v4l2_output_devce = {
+	.name		= "rk29_vout",
+};
 
 /*HANNSTAR_P1003 touch*/
 #if defined (CONFIG_HANNSTAR_P1003)
@@ -954,7 +983,7 @@ static struct i2c_board_info rk29_i2c_cam_info_0[] = {
 	},
 };
 
-struct soc_camera_link rk29_iclink_0 = {
+static struct soc_camera_link rk29_iclink_0 = {
 	.bus_id		= RK29_CAM_PLATFORM_DEV_ID,
 	.power		= rk29_sensor_power,
 	.powerdown  = rk29_sensor_powerdown,
@@ -964,7 +993,7 @@ struct soc_camera_link rk29_iclink_0 = {
 };
 
 /*platform_device : soc-camera need  */
-struct platform_device rk29_soc_camera_pdrv_0 = {
+static struct platform_device rk29_soc_camera_pdrv_0 = {
 	.name	= "soc-camera-pdrv",
 	.id	= 0,
 	.dev	= {
@@ -979,7 +1008,7 @@ static struct i2c_board_info rk29_i2c_cam_info_1[] = {
 	},
 };
 
-struct soc_camera_link rk29_iclink_1 = {
+static struct soc_camera_link rk29_iclink_1 = {
 	.bus_id		= RK29_CAM_PLATFORM_DEV_ID,
 	.power		= rk29_sensor_power,
 	.powerdown  = rk29_sensor_powerdown,
@@ -989,7 +1018,7 @@ struct soc_camera_link rk29_iclink_1 = {
 };
 
 /*platform_device : soc-camera need  */
-struct platform_device rk29_soc_camera_pdrv_1 = {
+static struct platform_device rk29_soc_camera_pdrv_1 = {
 	.name	= "soc-camera-pdrv",
 	.id	= 1,
 	.dev	= {
@@ -1000,7 +1029,7 @@ struct platform_device rk29_soc_camera_pdrv_1 = {
 
 
 static u64 rockchip_device_camera_dmamask = 0xffffffffUL;
-struct resource rk29_camera_resource[] = {
+static struct resource rk29_camera_resource[] = {
 	[0] = {
 		.start = RK29_VIP_PHYS,
 		.end   = RK29_VIP_PHYS + RK29_VIP_SIZE - 1,
@@ -1014,7 +1043,7 @@ struct resource rk29_camera_resource[] = {
 };
 
 /*platform_device : */
-struct platform_device rk29_device_camera = {
+static struct platform_device rk29_device_camera = {
 	.name		  = RK29_CAM_DRV_NAME,
 	.id		  = RK29_CAM_PLATFORM_DEV_ID,               /* This is used to put cameras on this interface */
 	.num_resources	  = ARRAY_SIZE(rk29_camera_resource),
@@ -1042,6 +1071,7 @@ struct platform_device rk29_device_camera = {
 #define PWM_MUX_NAME      GPIO1B5_PWM0_NAME
 #define PWM_MUX_MODE      GPIO1L_PWM0
 #define PWM_MUX_MODE_GPIO GPIO1L_GPIO1B5
+#define PWM_GPIO_PIN			RK29_PIN1_PB5
 #define PWM_EFFECT_VALUE  1
 
 //#define LCD_DISP_ON_PIN
@@ -1053,6 +1083,29 @@ struct platform_device rk29_device_camera = {
 #define BL_EN_PIN         GPIO0L_GPIO0A5
 #define BL_EN_VALUE       GPIO_HIGH
 #endif
+static void rk29_backlight_close(void){
+	 int ret;
+	 ret = gpio_request(FB_DISPLAY_ON_PIN, NULL);
+   if(ret != 0)
+   {
+            gpio_free(FB_DISPLAY_ON_PIN);
+            printk(">>>>>> FB_DISPLAY_ON_PIN gpio_request err \n ");
+   }
+   gpio_direction_output(FB_DISPLAY_ON_PIN, 0);
+   gpio_set_value(FB_DISPLAY_ON_PIN, GPIO_LOW);
+   gpio_free(FB_DISPLAY_ON_PIN);
+   
+   rk29_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
+   ret = gpio_request(PWM_GPIO_PIN, NULL);
+   if(ret != 0)
+   {
+            gpio_free(PWM_GPIO_PIN);
+            printk(">>>>>> FB_DISPLAY_ON_PIN gpio_request err \n ");
+   }
+   gpio_direction_output(PWM_GPIO_PIN, 0);
+   gpio_set_value(PWM_GPIO_PIN, GPIO_HIGH);
+   gpio_free(PWM_GPIO_PIN);
+}
 static int rk29_backlight_io_init(void)
 {
     int ret = 0;
@@ -1304,7 +1357,7 @@ static int rk29sdk_wifi_reset(int on)
         return 0;
 }
 
-static int rk29sdk_wifi_set_carddetect(int val)
+int rk29sdk_wifi_set_carddetect(int val)
 {
         pr_info("%s:%d\n", __func__, val);
         rk29sdk_wifi_cd = val;
@@ -1315,11 +1368,71 @@ static int rk29sdk_wifi_set_carddetect(int val)
         }
         return 0;
 }
+EXPORT_SYMBOL(rk29sdk_wifi_set_carddetect);
+
+static struct wifi_mem_prealloc wifi_mem_array[PREALLOC_WLAN_SEC_NUM] = {
+        {NULL, (WLAN_SECTION_SIZE_0 + PREALLOC_WLAN_SECTION_HEADER)},
+        {NULL, (WLAN_SECTION_SIZE_1 + PREALLOC_WLAN_SECTION_HEADER)},
+        {NULL, (WLAN_SECTION_SIZE_2 + PREALLOC_WLAN_SECTION_HEADER)},
+        {NULL, (WLAN_SECTION_SIZE_3 + PREALLOC_WLAN_SECTION_HEADER)}
+};
+
+static void *rk29sdk_mem_prealloc(int section, unsigned long size)
+{
+        if (section == PREALLOC_WLAN_SEC_NUM)
+                return wlan_static_skb;
+
+        if ((section < 0) || (section > PREALLOC_WLAN_SEC_NUM))
+                return NULL;
+
+        if (wifi_mem_array[section].size < size)
+                return NULL;
+
+        return wifi_mem_array[section].mem_ptr;
+}
+
+int __init rk29sdk_init_wifi_mem(void)
+{
+        int i;
+        int j;
+
+        for (i = 0 ; i < WLAN_SKB_BUF_NUM ; i++) {
+                wlan_static_skb[i] = dev_alloc_skb(
+                                ((i < (WLAN_SKB_BUF_NUM / 2)) ? 4096 : 8192));
+
+                if (!wlan_static_skb[i])
+                        goto err_skb_alloc;
+        }
+
+        for (i = 0 ; i < PREALLOC_WLAN_SEC_NUM ; i++) {
+                wifi_mem_array[i].mem_ptr =
+                                kmalloc(wifi_mem_array[i].size, GFP_KERNEL);
+
+                if (!wifi_mem_array[i].mem_ptr)
+                        goto err_mem_alloc;
+        }
+        return 0;
+
+ err_mem_alloc:
+        pr_err("Failed to mem_alloc for WLAN\n");
+        for (j = 0 ; j < i ; j++)
+                kfree(wifi_mem_array[j].mem_ptr);
+
+        i = WLAN_SKB_BUF_NUM;
+
+ err_skb_alloc:
+        pr_err("Failed to skb_alloc for WLAN\n");
+        for (j = 0 ; j < i ; j++)
+                dev_kfree_skb(wlan_static_skb[j]);
+
+        return -ENOMEM;
+}
 
 static struct wifi_platform_data rk29sdk_wifi_control = {
         .set_power = rk29sdk_wifi_power,
         .set_reset = rk29sdk_wifi_reset,
         .set_carddetect = rk29sdk_wifi_set_carddetect,
+        .mem_prealloc   = rk29sdk_mem_prealloc,
 };
 static struct platform_device rk29sdk_wifi_device = {
         .name = "bcm4329_wlan",
@@ -1359,7 +1472,7 @@ static struct resource resources_gpu[] = {
         .flags  = IORESOURCE_MEM,
     },
 };
-struct platform_device rk29_device_gpu = {
+static struct platform_device rk29_device_gpu = {
     .name             = "galcore",
     .id               = 0,
     .num_resources    = ARRAY_SIZE(resources_gpu),
@@ -1508,6 +1621,7 @@ static struct platform_device *devices[] __initdata = {
 
 #ifdef CONFIG_FB_RK29
 	&rk29_device_fb,
+	&rk29_device_dma_cpy,
 #endif
 #ifdef CONFIG_BACKLIGHT_RK29_BL
 	&rk29_device_backlight,
@@ -1544,6 +1658,9 @@ static struct platform_device *devices[] __initdata = {
 #ifdef CONFIG_RK29_IPP
 	&rk29_device_ipp,
 #endif
+#ifdef CONFIG_VIDEO_RK29XX_VOUT
+	&rk29_v4l2_output_devce,
+#endif
 };
 
 /*****************************************************************************************
@@ -1613,7 +1730,7 @@ struct rk29_vmac_platform_data rk29_vmac_pdata = {
  * author: cmc@rock-chips.com
  *****************************************************************************************/
 #define SPI_CHIPSELECT_NUM 2
-struct spi_cs_gpio rk29xx_spi0_cs_gpios[SPI_CHIPSELECT_NUM] = {
+static struct spi_cs_gpio rk29xx_spi0_cs_gpios[SPI_CHIPSELECT_NUM] = {
     {
 		.name = "spi0 cs0",
 		.cs_gpio = RK29_PIN2_PC1,
@@ -1627,7 +1744,7 @@ struct spi_cs_gpio rk29xx_spi0_cs_gpios[SPI_CHIPSELECT_NUM] = {
 	}
 };
 
-struct spi_cs_gpio rk29xx_spi1_cs_gpios[SPI_CHIPSELECT_NUM] = {
+static struct spi_cs_gpio rk29xx_spi1_cs_gpios[SPI_CHIPSELECT_NUM] = {
     {
 		.name = "spi1 cs0",
 		.cs_gpio = RK29_PIN2_PC5,
@@ -1853,6 +1970,8 @@ static void __init machine_rk29_board_init(void)
 #endif
 
 	spi_register_board_info(board_spi_devices, ARRAY_SIZE(board_spi_devices));
+
+        rk29sdk_init_wifi_mem();
 }
 
 static void __init machine_rk29_fixup(struct machine_desc *desc, struct tag *tags,
@@ -1867,6 +1986,7 @@ static void __init machine_rk29_fixup(struct machine_desc *desc, struct tag *tag
 static void __init machine_rk29_mapio(void)
 {
 	rk29_map_common_io();
+	rk29_sram_init();
 	rk29_clock_init();
 	rk29_iomux_init();
 }
diff --git a/arch/arm/mach-rk29/board-rk29malata-key.c b/arch/arm/mach-rk29/board-rk29malata-key.c
new file mode 100644
index 000000000000..7f027da8d208
--- /dev/null
+++ b/arch/arm/mach-rk29/board-rk29malata-key.c
@@ -0,0 +1,110 @@
+#include <mach/key.h>
+#include <mach/gpio.h>
+
+#define EV_ENCALL				KEY_F4
+#define EV_MENU					KEY_F1
+
+#define PRESS_LEV_LOW			1
+#define PRESS_LEV_HIGH			0
+
+static struct rk29_keys_button key_button[] = {
+#if 0
+	{
+		.desc	= "menu",
+		.code	= EV_MENU,
+		.gpio	= RK29_PIN6_PA0,
+		.active_low = PRESS_LEV_LOW,
+	},
+#endif
+	{
+		.desc	= "vol+",
+		.code	= KEY_VOLUMEUP,
+		.gpio	= RK29_PIN6_PA1,
+		.active_low = PRESS_LEV_LOW,
+	},
+	{
+		.desc	= "vol-",
+		.code	= KEY_VOLUMEDOWN,
+		.gpio	= RK29_PIN6_PA2,
+		.active_low = PRESS_LEV_LOW,
+	},
+#if 0
+	{
+		.desc	= "home",
+		.code	= KEY_HOME,
+		.gpio	= RK29_PIN6_PA3,
+		.active_low = PRESS_LEV_LOW,
+	},
+	{
+		.desc	= "search",
+		.code	= KEY_SEARCH,
+		.gpio	= RK29_PIN6_PA4,
+		.active_low = PRESS_LEV_LOW,
+	},
+	{
+		.desc	= "esc",
+		.code	= KEY_BACK,
+		.gpio	= RK29_PIN6_PA5,
+		.active_low = PRESS_LEV_LOW,
+	},
+	{
+		.desc	= "sensor",
+		.code	= KEY_CAMERA,
+		.gpio	= RK29_PIN6_PA6,
+		.active_low = PRESS_LEV_LOW,
+	},
+#endif
+	{
+		.desc	= "play",
+		.code	= EV_ENCALL,
+		.gpio	= RK29_PIN6_PA7,
+		.active_low = PRESS_LEV_LOW,
+		.wakeup	= 1,
+	},
+#if 0
+	{
+		.desc	= "vol+",
+		.code	= KEY_VOLUMEDOWN,
+		.adc_value	= 95,
+		.active_low = PRESS_LEV_LOW,
+	},
+	{
+		.desc	= "vol-",
+		.code	= KEY_VOLUMEUP,
+		.adc_value	= 249,
+		.active_low = PRESS_LEV_LOW,
+	},
+	{
+		.desc	= "menu",
+		.code	= EV_MENU,
+		.adc_value	= 406,
+		.active_low = PRESS_LEV_LOW,
+	},
+	{
+		.desc	= "home",
+		.code	= KEY_HOME,
+		.code_long_press = KEY_F4,
+		.adc_value	= 561,
+		.active_low = PRESS_LEV_LOW,
+	},
+	{
+		.desc	= "esc",
+		.code	= KEY_ESC,
+		.adc_value	= 726,
+		.active_low = PRESS_LEV_LOW,
+	},
+	{
+		.desc	= "adkey6",
+		.code	= KEY_BACK,
+		.code_long_press = EV_ENCALL,
+		.adc_value	= 899,
+		.active_low = PRESS_LEV_LOW,
+	},
+#endif
+};
+struct rk29_keys_platform_data rk29_keys_pdata = {
+	.buttons	= key_button,
+	.nbuttons	= ARRAY_SIZE(key_button),
+	.chn	= -1,  //chn: 0-7, if do not use ADC,set 'chn' -1
+};
+
diff --git a/drivers/video/backlight/rk29_backlight.c b/drivers/video/backlight/rk29_backlight.c
old mode 100644
new mode 100755
index ecb362ee57b4..f814790d6978
--- a/drivers/video/backlight/rk29_backlight.c
+++ b/drivers/video/backlight/rk29_backlight.c
@@ -388,4 +388,4 @@ static int __init rk29_backlight_init(void)
 	platform_driver_register(&rk29_backlight_driver);
 	return 0;
 }
-postcore_initcall_sync(rk29_backlight_init);
+late_initcall(rk29_backlight_init);
-- 
2.34.1