Merge remote-tracking branch 'kernel-2.6.32/develop' into develop-2.6.36
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-rk29 / board-rk29-phonesdk.c
old mode 100644 (file)
new mode 100755 (executable)
index 10d8830..ac57fc8
 #else
 #define SDRAM_SIZE          SZ_512M
 #endif
-#define PMEM_GPU_SIZE       SZ_64M
+#define PMEM_GPU_SIZE       SZ_16M
 #define PMEM_UI_SIZE        SZ_32M
 #define PMEM_VPU_SIZE       SZ_64M
 #define PMEM_CAM_SIZE       PMEM_CAM_NECESSARY
 #endif
 #define MEM_FB_SIZE         (3*SZ_2M)
 #ifdef CONFIG_FB_WORK_IPP
+#ifdef CONFIG_FB_SCALING_OSD_1080P
+#define MEM_FBIPP_SIZE      SZ_16M   //1920 x 1080 x 2 x 2  //RGB565 = x2;RGB888 = x4
+#else
 #define MEM_FBIPP_SIZE      SZ_8M   //1920 x 1080 x 2 x 2  //RGB565 = x2;RGB888 = x4
+#endif
 #else
 #define MEM_FBIPP_SIZE      0
 #endif
@@ -381,7 +385,7 @@ static struct android_pmem_platform_data android_pmem_pdata = {
        .name           = "pmem",
        .start          = PMEM_UI_BASE,
        .size           = PMEM_UI_SIZE,
-       .no_allocator   = 0,
+       .no_allocator   = 1,
        .cached         = 1,
 };
 
@@ -465,7 +469,7 @@ static struct gt801_platform_data gt801_info = {
        .gpio_reset_active_low = 0,
        .gpio_pendown           = GT801_GPIO_INT,
     .pendown_iomux_name = GPIO4D5_CPUTRACECTL_NAME,
-    .resetpin_iomux_name = "",
+    .resetpin_iomux_name = NULL,
     .pendown_iomux_mode = GPIO4H_GPIO4D5,
     .resetpin_iomux_mode = 0,
 };
@@ -487,7 +491,7 @@ static struct gt818_platform_data gt818_info = {
        .gpio_reset_active_low = 0,
        .gpio_pendown           = GT818_GPIO_INT,
     .pendown_iomux_name = GPIO4D5_CPUTRACECTL_NAME,
-    .resetpin_iomux_name = "",
+    .resetpin_iomux_name = NULL,
     .pendown_iomux_mode = GPIO4H_GPIO4D5,
     .resetpin_iomux_mode = 0,
 };
@@ -575,44 +579,57 @@ static struct mma8452_platform_data mma8452_info = {
 };
 #endif
 
-#if defined (CONFIG_SENSORS_MPU3050)
+#if defined (CONFIG_MPU_SENSORS_MPU3050)
 /*mpu3050*/
 static struct mpu3050_platform_data mpu3050_data = {
                .int_config = 0x10,
                //.orientation = { 1, 0, 0,0, -1, 0,0, 0, 1 },
                //.orientation = { 0, 1, 0,-1, 0, 0,0, 0, -1 },
+               //.orientation = { -1, 0, 0,0, -1, 0,0, 0, -1 },
+               //.orientation = { 0, 1, 0, -1, 0, 0, 0, 0, 1 },
                .orientation = { 1, 0, 0,0, 1, 0, 0, 0, 1 },
                .level_shifter = 0,
-#if defined (CONFIG_SENSORS_KXTF9)
+#if defined (CONFIG_MPU_SENSORS_KXTF9)
                .accel = {
-                               .get_slave_descr = kxtf9_get_slave_descr ,
+#ifdef CONFIG_MPU_SENSORS_MPU3050_MODULE
+                               .get_slave_descr = NULL ,
+#else
+                               .get_slave_descr = get_accel_slave_descr ,                      
+#endif
                                .adapt_num = 0, // The i2c bus to which the mpu device is
                                // connected
-                               .irq = RK29_PIN6_PC4,
+                               //.irq = RK29_PIN6_PC4,
                                .bus = EXT_SLAVE_BUS_SECONDARY,  //The secondary I2C of MPU
                                .address = 0x0f,
                                //.orientation = { 1, 0, 0,0, 1, 0,0, 0, 1 },
                                //.orientation = { 0, -1, 0,-1, 0, 0,0, 0, -1 },
                                //.orientation = { 0, 1, 0,1, 0, 0,0, 0, -1 },
+                               //.orientation = { 0, 1 ,0, -1 ,0, 0, 0, 0, 1 },
                                .orientation = {1, 0, 0, 0, 1, 0, 0, 0, 1},
                },
 #endif
-#if defined (CONFIG_SENSORS_AK8975)
+#if defined (CONFIG_MPU_SENSORS_AK8975)
                .compass = {
-                               .get_slave_descr = ak8975_get_slave_descr,/*ak5883_get_slave_descr,*/
+#ifdef CONFIG_MPU_SENSORS_MPU3050_MODULE
+                               .get_slave_descr = NULL,/*ak5883_get_slave_descr,*/
+#else
+                               .get_slave_descr = get_compass_slave_descr,
+#endif                                         
                                .adapt_num = 0, // The i2c bus to which the compass device is. 
                                // It can be difference with mpu
                                // connected
-                               .irq = RK29_PIN6_PC5,
+                               //.irq = RK29_PIN6_PC5,
                                .bus = EXT_SLAVE_BUS_PRIMARY,
                                .address = 0x0d,
                                //.orientation = { -1, 0, 0,0, -1, 0,0, 0, 1 },
                                //.orientation = { 0, -1, 0,-1, 0, 0,0, 0, -1 },
+                               //.orientation = { 0, 1, 0,1, 0, 0,0, 0, -1 },
+                               //.orientation = { 0, -1, 0, 1, 0, 0, 0, 0, 1 },
                                .orientation = {0, 1, 0, -1, 0, 0, 0, 0, 1},
                },
-#endif
 };
 #endif
+#endif
 
 #if defined(CONFIG_GPIO_WM831X)
 struct rk29_gpio_expander_info  wm831x_gpio_settinginfo[] = {
@@ -693,6 +710,12 @@ int wm831x_pre_init(struct wm831x *parm)
        //ILIM = 900ma
        ret = wm831x_reg_read(parm, WM831X_POWER_STATE) & 0xffff;
        wm831x_reg_write(parm, WM831X_POWER_STATE, (ret&0xfff8) | 0x04);        
+       
+       //BATT_FET_ENA = 1
+       wm831x_set_bits(parm, WM831X_RESET_CONTROL,0x1000,0x1000);
+       ret = wm831x_reg_read(parm, WM831X_RESET_CONTROL) & 0xffff;
+       printk("%s:WM831X_RESET_CONTROL=0x%x\n",__FUNCTION__,ret);
+       
 #if 0
        wm831x_set_bits(parm, WM831X_LDO_ENABLE, (1 << 3), 0);
        wm831x_set_bits(parm, WM831X_LDO_ENABLE, (1 << 7), 0);
@@ -747,7 +770,7 @@ int wm831x_post_init(struct wm831x *parm)
        
        ldo = regulator_get(NULL, "ldo4");              // 4th usb
        regulator_set_voltage(ldo,2500000,2500000);
-       regulator_set_suspend_voltage(ldo,2500000);
+       regulator_set_suspend_voltage(ldo,0000000);
        regulator_enable(ldo);  
        printk("%s set ldo4=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
        regulator_put(ldo);
@@ -911,9 +934,9 @@ struct wm831x_battery_pdata wm831x_battery_platdata = {
        .off_mask = 1,       /** Mask OFF while charging */
        .trickle_ilim = 200,   /** Trickle charge current limit, in mA */
        .vsel = 4200,           /** Target voltage, in mV */
-       .eoc_iterm = 90,      /** End of trickle charge current, in mA */
+       .eoc_iterm = 50,      /** End of trickle charge current, in mA */
        .fast_ilim = 500,      /** Fast charge current limit, in mA */
-       .timeout = 240,        /** Charge cycle timeout, in minutes */
+       .timeout = 480,        /** Charge cycle timeout, in minutes */
        .syslo = 3300,    /* syslo threshold, in mV*/
        .sysok = 3500,    /* sysko threshold, in mV*/
 };
@@ -1435,7 +1458,184 @@ struct wm831x_pdata wm831x_platdata = {
 };
 #endif
 
+#if defined(CONFIG_RK29_GPIO_SUSPEND)
+static void gpio_set_request(void)
+{
+       gpio_request(RK29_PIN6_PA0, NULL);
+       gpio_request(RK29_PIN6_PA1, NULL);
+       gpio_request(RK29_PIN6_PA2, NULL);
+       gpio_request(RK29_PIN6_PA3, NULL);
+       gpio_request(RK29_PIN6_PA4, NULL);
+       gpio_request(RK29_PIN6_PA5, NULL);
+       gpio_request(RK29_PIN6_PA6, NULL);
+
+       gpio_request(RK29_PIN2_PA5, NULL);
+       gpio_request(RK29_PIN2_PA4, NULL);
+       gpio_request(RK29_PIN2_PB0, NULL);
+       gpio_request(RK29_PIN2_PB1, NULL);
+       gpio_request(RK29_PIN2_PB2, NULL);
+       gpio_request(RK29_PIN2_PB3, NULL);
+
+       gpio_request(RK29_PIN1_PA4, NULL);
+       gpio_request(RK29_PIN1_PA3, NULL);
+
+       gpio_request(RK29_PIN2_PC7, NULL);
+       gpio_request(RK29_PIN2_PC6, NULL);
+       gpio_request(RK29_PIN2_PC5, NULL);
+       gpio_request(RK29_PIN2_PC4, NULL);
+       gpio_request(RK29_PIN2_PC3, NULL);
+       gpio_request(RK29_PIN2_PC2, NULL);
+       gpio_request(RK29_PIN2_PC1, NULL);
+       gpio_request(RK29_PIN2_PC0, NULL);
+}
+
+static void gpio_set_free(void)
+{
+       gpio_free(RK29_PIN6_PA0);
+       gpio_free(RK29_PIN6_PA1);
+       gpio_free(RK29_PIN6_PA2);
+       gpio_free(RK29_PIN6_PA3);
+       gpio_free(RK29_PIN6_PA4);
+       gpio_free(RK29_PIN6_PA5);
+       gpio_free(RK29_PIN6_PA6);
+
+       gpio_free(RK29_PIN2_PA5);
+       gpio_free(RK29_PIN2_PA4);
+       gpio_free(RK29_PIN2_PB0);
+       gpio_free(RK29_PIN2_PB1);
+       gpio_free(RK29_PIN2_PB2);
+       gpio_free(RK29_PIN2_PB3);
+
+       gpio_free(RK29_PIN1_PA4);
+       gpio_free(RK29_PIN1_PA3);
+
+       gpio_free(RK29_PIN2_PC7);
+       gpio_free(RK29_PIN2_PC6);
+       gpio_free(RK29_PIN2_PC5);
+       gpio_free(RK29_PIN2_PC4);
+       gpio_free(RK29_PIN2_PC3);
+       gpio_free(RK29_PIN2_PC2);
+       gpio_free(RK29_PIN2_PC1);
+       gpio_free(RK29_PIN2_PC0);
+}
+
+static void rk29_keygpio_suspend(void)
+{
+       gpio_pull_updown(RK29_PIN6_PA0, 0);
+       gpio_pull_updown(RK29_PIN6_PA1, 0);
+       gpio_pull_updown(RK29_PIN6_PA2, 0);
+       gpio_pull_updown(RK29_PIN6_PA3, 0);
+       gpio_pull_updown(RK29_PIN6_PA4, 0);
+       gpio_pull_updown(RK29_PIN6_PA5, 0);
+       gpio_pull_updown(RK29_PIN6_PA6, 0);//key pullup/pulldown disable
+
+       gpio_pull_updown(RK29_PIN2_PA4, 0);
+       gpio_pull_updown(RK29_PIN2_PA5, 0);
+       gpio_pull_updown(RK29_PIN2_PB0, 0);
+       gpio_pull_updown(RK29_PIN2_PB1, 0);
+       gpio_pull_updown(RK29_PIN2_PB2, 0);
+       gpio_pull_updown(RK29_PIN2_PB3, 0);
+}
+
+static void rk29_keygpio_resume(void)
+{
+       gpio_pull_updown(RK29_PIN6_PA0, 1);
+       gpio_pull_updown(RK29_PIN6_PA1, 1);
+       gpio_pull_updown(RK29_PIN6_PA2, 1);
+       gpio_pull_updown(RK29_PIN6_PA3, 1);
+       gpio_pull_updown(RK29_PIN6_PA4, 1);
+       gpio_pull_updown(RK29_PIN6_PA5, 1);
+       gpio_pull_updown(RK29_PIN6_PA6, 1);//key pullup/pulldown enable
+
+       gpio_pull_updown(RK29_PIN2_PA4, 1);
+       gpio_pull_updown(RK29_PIN2_PA5, 1);
+       gpio_pull_updown(RK29_PIN2_PB0, 1);
+       gpio_pull_updown(RK29_PIN2_PB1, 1);
+       gpio_pull_updown(RK29_PIN2_PB2, 1);
+       gpio_pull_updown(RK29_PIN2_PB3, 1);
+}
+
+static void spi_gpio_suspend(void)
+{      
+       rk29_mux_api_set(GPIO1A4_EMMCWRITEPRT_SPI0CS1_NAME,GPIO1L_GPIO1A4);  //set iomux is gpio mode
+       rk29_mux_api_set(GPIO1A3_EMMCDETECTN_SPI1CS1_NAME,GPIO1L_GPIO1A3);
+
+       rk29_mux_api_set(GPIO2C7_SPI1RXD_NAME,GPIO2H_GPIO2C7);
+       rk29_mux_api_set(GPIO2C6_SPI1TXD_NAME,GPIO2H_GPIO2C6);
+       //rk29_mux_api_set(GPIO2C5_SPI1CSN0_NAME,GPIO2H_GPIO2C5);
+       rk29_mux_api_set(GPIO2C4_SPI1CLK_NAME,GPIO2H_GPIO2C4);
+       rk29_mux_api_set(GPIO2C3_SPI0RXD_NAME,GPIO2H_GPIO2C3);
+       rk29_mux_api_set(GPIO2C2_SPI0TXD_NAME,GPIO2H_GPIO2C2);
+       rk29_mux_api_set(GPIO2C1_SPI0CSN0_NAME,GPIO2H_GPIO2C1);
+       rk29_mux_api_set(GPIO2C0_SPI0CLK_NAME,GPIO2H_GPIO2C0);
+
+       gpio_direction_input(RK29_PIN1_PA4);             //set gpio is input
+       gpio_direction_input(RK29_PIN1_PA3);
+       gpio_direction_input(RK29_PIN2_PC7);
+       gpio_direction_input(RK29_PIN2_PC6);
+       // gpio_direction_input(RK29_PIN2_PC5);
+       gpio_direction_input(RK29_PIN2_PC4);
+       gpio_direction_input(RK29_PIN2_PC3);
+       gpio_direction_input(RK29_PIN2_PC2);
+       gpio_direction_input(RK29_PIN2_PC1);
+       gpio_direction_input(RK29_PIN2_PC0);
+
+       gpio_pull_updown(RK29_PIN1_PA4, 0);   //set gpio pullup/down disable
+       gpio_pull_updown(RK29_PIN1_PA3, 0);
+
+       gpio_pull_updown(RK29_PIN2_PC7, 0);
+       gpio_pull_updown(RK29_PIN2_PC6, 0);
+       //gpio_pull_updown(RK29_PIN2_PC5, 0);
+       gpio_pull_updown(RK29_PIN2_PC4, 0);
+       gpio_pull_updown(RK29_PIN2_PC3, 0);
+       gpio_pull_updown(RK29_PIN2_PC2, 0);
+       gpio_pull_updown(RK29_PIN2_PC1, 0);
+       gpio_pull_updown(RK29_PIN2_PC0, 0);
+}
+
+static void spi_gpio_resume(void)
+{      
+       gpio_pull_updown(RK29_PIN1_PA4, 1);         //set gpio pullup/down enable
+       gpio_pull_updown(RK29_PIN1_PA3, 1);
+
+       gpio_pull_updown(RK29_PIN2_PC7, 1);
+       gpio_pull_updown(RK29_PIN2_PC6, 1);
+       //gpio_pull_updown(RK29_PIN2_PC5, 1);
+       gpio_pull_updown(RK29_PIN2_PC4, 1);
+       gpio_pull_updown(RK29_PIN2_PC3, 1);
+       gpio_pull_updown(RK29_PIN2_PC2, 1);
+       gpio_pull_updown(RK29_PIN2_PC1, 1);
+       gpio_pull_updown(RK29_PIN2_PC0, 1);
+
+       rk29_mux_api_set(GPIO1A4_EMMCWRITEPRT_SPI0CS1_NAME,GPIO1L_SPI0_CSN1);   //set iomux is spi mode
+       rk29_mux_api_set(GPIO1A3_EMMCDETECTN_SPI1CS1_NAME,GPIO1L_SPI1_CSN1);
+
+       rk29_mux_api_set(GPIO2C7_SPI1RXD_NAME,GPIO2H_SPI1_RXD);
+       rk29_mux_api_set(GPIO2C6_SPI1TXD_NAME,GPIO2H_SPI1_TXD);
+       //rk29_mux_api_set(GPIO2C5_SPI1CSN0_NAME,GPIO2H_SPI1_CSN0);
+       rk29_mux_api_set(GPIO2C4_SPI1CLK_NAME, GPIO2H_SPI1_CLK);
+       rk29_mux_api_set(GPIO2C3_SPI0RXD_NAME,GPIO2H_SPI0_RXD);
+       rk29_mux_api_set(GPIO2C2_SPI0TXD_NAME,GPIO2H_SPI0_TXD);
+       rk29_mux_api_set(GPIO2C1_SPI0CSN0_NAME,GPIO2H_SPI0_CSN0);
+       rk29_mux_api_set(GPIO2C0_SPI0CLK_NAME,GPIO2H_SPI0_CLK);
+}
+
+void rk29_setgpio_suspend_board(void)
+{
+       gpio_set_request();
+       rk29_keygpio_suspend();
+       spi_gpio_suspend();
+       gpio_set_free();
+}
 
+void rk29_setgpio_resume_board(void)
+{
+       gpio_set_request();
+       rk29_keygpio_resume();
+       spi_gpio_resume();
+       gpio_set_free();
+}
+#endif
 
 #if defined(CONFIG_RK29_GPS)
 
@@ -1493,110 +1693,14 @@ struct platform_device rk29_device_gps = {
  * wm8994  codec
  * author: qjb@rock-chips.com
  *****************************************************************************************/
-//#if defined(CONFIG_MFD_WM8994)
-#if defined (CONFIG_REGULATOR_WM8994)
-static struct regulator_consumer_supply wm8994_ldo1_consumers[] = {
-       {
-               .supply = "DBVDD",
-       },
-       {
-               .supply = "AVDD1",
-       },
-       {
-               .supply = "CPVDD",
-       },
-       {
-               .supply = "SPKVDD1",
-       }               
-};
-static struct regulator_consumer_supply wm8994_ldo2_consumers[] = {
-       {
-               .supply = "DCVDD",
-       },
-       {
-               .supply = "AVDD2",
-       },
-       {
-               .supply = "SPKVDD2",
-       }                       
-};
-struct regulator_init_data regulator_init_data_ldo1 = {
-       .constraints = {
-               .name = "wm8994-ldo1",
-               .min_uA = 00000,
-               .max_uA = 18000,
-               .always_on = true,
-               .apply_uV = true,               
-               .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_CURRENT,           
-       },
-       .num_consumer_supplies = ARRAY_SIZE(wm8994_ldo1_consumers),
-       .consumer_supplies = wm8994_ldo1_consumers,     
-};
-struct regulator_init_data regulator_init_data_ldo2 = {
-       .constraints = {
-               .name = "wm8994-ldo2",
-               .min_uA = 00000,
-               .max_uA = 18000,
-               .always_on = true,
-               .apply_uV = true,               
-               .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_CURRENT,           
-       },
-       .num_consumer_supplies = ARRAY_SIZE(wm8994_ldo2_consumers),
-       .consumer_supplies = wm8994_ldo2_consumers,     
-};
-#endif 
-struct wm8994_drc_cfg wm8994_drc_cfg_pdata = {
-       .name = "wm8994_DRC",
-       .regs = {0,0,0,0,0},
-};
-
-struct wm8994_retune_mobile_cfg wm8994_retune_mobile_cfg_pdata = {
-       .name = "wm8994_EQ",
-       .rate = 0,
-       .regs = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},
-}; 
-
 struct wm8994_pdata wm8994_platdata = {        
-#if defined (CONFIG_GPIO_WM8994)
-       .gpio_base = WM8994_GPIO_EXPANDER_BASE,
-       //Fill value to initialize the GPIO
-       .gpio_defaults ={},
-#endif 
-       //enable=0 disable ldo
-#if defined (CONFIG_REGULATOR_WM8994)  
-       .ldo = {
-               {
-                       .enable = 0,
-                       //RK29_PIN5_PA1
-                       .supply = NULL,
-                       .init_data = &regulator_init_data_ldo1,
-               },
-               {
-                       .enable = 0,
-                       .supply = NULL,         
-                       .init_data = &regulator_init_data_ldo2,
-               }
-       },
-#endif         
-       //DRC 0--use default
-       .num_drc_cfgs = 0,
-       .drc_cfgs = &wm8994_drc_cfg_pdata,
-       //EQ   0--use default 
-       .num_retune_mobile_cfgs = 0,
-       .retune_mobile_cfgs = &wm8994_retune_mobile_cfg_pdata,
-       
-       .lineout1_diff = 1,
-       .lineout2_diff = 1,
-       
-       .lineout1fb = 1,
-       .lineout2fb = 1,
+
+       .BB_input_diff = 0,
+       .BB_class = NO_PCM_BB,
        
-       .micbias1_lvl = 1,
-       .micbias2_lvl = 1,
+       .no_earpiece = 0,
+       .sp_hp_same_channel = 0,
        
-       .jd_scthr = 0,
-       .jd_thr = 0,
-
        .PA_control_pin = 0,    
        .Power_EN_Pin = RK29_PIN5_PA1,
 
@@ -1606,13 +1710,13 @@ struct wm8994_pdata wm8994_platdata = {
        .earpiece_incall_vol = 0,
        .headset_incall_vol = 6,
        .headset_incall_mic_vol = -6,
-       .headset_normal_vol = 6,
+       .headset_normal_vol = -6,
        .BT_incall_vol = 0,
        .BT_incall_mic_vol = 0,
-       .recorder_vol = 50,
+       .recorder_vol = 30,
        
 };
-//#endif 
+
 
 #ifdef CONFIG_RK_HEADSET_DET
 #define HEADSET_GPIO RK29_PIN4_PD2
@@ -1790,6 +1894,12 @@ struct i2c_gpio_platform_data default_i2c3_data = {
        .io_init = rk29_i2c3_io_init,
 };
 #endif
+
+#if defined (CONFIG_ANX7150)
+struct hdmi_platform_data anx7150_data = {
+       //.io_init = anx7150_io_init,
+};
+#endif
 #ifdef CONFIG_I2C0_RK29
 static struct i2c_board_info __initdata board_i2c0_devices[] = {
 #if defined (CONFIG_RK1000_CONTROL)
@@ -1884,6 +1994,7 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = {
         .addr           = 0x39,             //0x39, 0x3d
         .flags          = 0,
         .irq            = RK29_PIN2_PA3,
+               .platform_data  = &anx7150_data,
     },
 #endif
 #if defined (CONFIG_GS_L3G4200D)
@@ -1895,7 +2006,7 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = {
                .platform_data  = &l3g4200d_info,
        },
 #endif
-#if defined (CONFIG_SENSORS_MPU3050) 
+#if defined (CONFIG_MPU_SENSORS_MPU3050) 
        {
                .type                   = "mpu3050",
                .addr                   = 0x68,
@@ -2214,7 +2325,11 @@ static int rk29_sdmmc0_cfg_gpio(void)
        rk29_mux_api_set(GPIO1D3_SDMMC0DATA1_NAME, GPIO1H_SDMMC0_DATA1);
        rk29_mux_api_set(GPIO1D4_SDMMC0DATA2_NAME, GPIO1H_SDMMC0_DATA2);
        rk29_mux_api_set(GPIO1D5_SDMMC0DATA3_NAME, GPIO1H_SDMMC0_DATA3);
+#ifdef CONFIG_SDMMC_RK29_OLD   
        rk29_mux_api_set(GPIO2A2_SDMMC0DETECTN_NAME, GPIO2L_GPIO2A2);
+#else
+  rk29_mux_api_set(GPIO2A2_SDMMC0DETECTN_NAME, GPIO2L_SDMMC0_DETECT_N);//Modifyed by xbw.
+#endif 
        rk29_mux_api_set(GPIO5D5_SDMMC0PWREN_NAME, GPIO5H_GPIO5D5);   ///GPIO5H_SDMMC0_PWR_EN);  ///GPIO5H_GPIO5D5);
        gpio_request(RK29_PIN5_PD5,"sdmmc");
        gpio_set_value(RK29_PIN5_PD5,GPIO_HIGH);
@@ -2524,6 +2639,24 @@ static struct platform_device gpio_wave_device = {
 static void __init rk29_board_iomux_init(void)
 {
        int err;
+
+#ifdef CONFIG_UART1_RK29
+       //disable uart1 pull down
+       rk29_mux_api_set(GPIO2A5_UART1SOUT_NAME, GPIO2L_GPIO2A5);                       
+       rk29_mux_api_set(GPIO2A4_UART1SIN_NAME, GPIO2L_GPIO2A4);                
+
+       gpio_request(RK29_PIN2_PA5, NULL);
+       gpio_request(RK29_PIN2_PA4, NULL);
+
+       gpio_pull_updown(RK29_PIN2_PA5, PullDisable);
+       gpio_pull_updown(RK29_PIN2_PA4, PullDisable);
+
+       rk29_mux_api_set(GPIO2A5_UART1SOUT_NAME, GPIO2L_UART1_SOUT);                    
+       rk29_mux_api_set(GPIO2A4_UART1SIN_NAME, GPIO2L_UART1_SIN); 
+
+       gpio_free(RK29_PIN2_PA5);
+       gpio_free(RK29_PIN2_PA4);
+#endif
        #ifdef CONFIG_RK29_PWM_REGULATOR
        rk29_mux_api_set(REGULATOR_PWM_MUX_NAME,REGULATOR_PWM_MUX_MODE);
        #endif
@@ -2556,6 +2689,26 @@ static void __init rk29_board_iomux_init(void)
 
 }
 
+// For phone,just a disk only, add by phc,20110816
+#ifdef CONFIG_USB_ANDROID
+struct usb_mass_storage_platform_data phone_mass_storage_pdata = {
+       .nluns          = 1,  
+       .vendor         = "RockChip",
+       .product        = "rk29 sdk",
+       .release        = 0x0100,
+};
+
+//static 
+struct platform_device phone_usb_mass_storage_device = {
+       .name   = "usb_mass_storage",
+       .id     = -1,
+       .dev    = {
+               .platform_data = &phone_mass_storage_pdata,
+       },
+};
+#endif
+
+
 static struct platform_device *devices[] __initdata = {
 
 #ifdef CONFIG_RK29_WATCHDOG
@@ -2674,7 +2827,7 @@ static struct platform_device *devices[] __initdata = {
 #endif
 #ifdef CONFIG_USB_ANDROID
        &android_usb_device,
-       &usb_mass_storage_device,
+       &phone_usb_mass_storage_device,
 #endif
 #ifdef CONFIG_RK29_IPP
        &rk29_device_ipp,
@@ -3081,11 +3234,12 @@ static void rk29_pm_power_off(void)
        while (1);
 }
 
-static struct cpufreq_frequency_table freq_table[] = {
-
-       { .index = 1050000, .frequency =  408000 },
-    { .index = 1100000, .frequency =  576000 },
-       { .index = 1150000, .frequency =  816000 },
+static struct cpufreq_frequency_table freq_table[] =
+{
+       { .index = 1200000, .frequency =  408000 },
+       { .index = 1200000, .frequency =  600000 },
+       { .index = 1200000, .frequency =  816000 },
+       { .index = 1350000, .frequency = 1008000 },
        { .frequency = CPUFREQ_TABLE_END },
 };
 
@@ -3093,14 +3247,14 @@ static void __init machine_rk29_board_init(void)
 {
        rk29_board_iomux_init();
     
-    board_update_cpufreq_table(freq_table);
-    
        gpio_request(POWER_ON_PIN,"poweronpin");
        gpio_set_value(POWER_ON_PIN, GPIO_HIGH);
        gpio_direction_output(POWER_ON_PIN, GPIO_HIGH);
        pm_power_off = rk29_pm_power_off;
        //arm_pm_restart = rk29_pm_power_restart;
 
+       board_update_cpufreq_table(freq_table);
+
        platform_add_devices(devices, ARRAY_SIZE(devices));
 #ifdef CONFIG_I2C0_RK29
        i2c_register_board_info(default_i2c0_data.bus_num, board_i2c0_devices,
@@ -3138,7 +3292,6 @@ static void __init machine_rk29_fixup(struct machine_desc *desc, struct tag *tag
 {
        mi->nr_banks = 1;
        mi->bank[0].start = RK29_SDRAM_PHYS;
-       mi->bank[0].node = PHYS_TO_NID(RK29_SDRAM_PHYS);
        mi->bank[0].size = LINUX_SIZE;
 #if SDRAM_SIZE > SZ_512M
        mi->nr_banks = 2;