board config: fix i2c1 and i2c3 transfer is not IRQ
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-rk29 / board-rk29-phonesdk.c
index 45d2e65d435c4eacf5647697b96837d985b99a3c..0af0074b720d96f1b16f9c5cb66e5d4824691fbd 100755 (executable)
@@ -72,6 +72,7 @@
 #endif
 
 #include "../../../drivers/misc/gps/rk29_gps.h"
+#include "../../../drivers/serial/sc8800.h"
 
 /* Set memory size of pmem */
 #ifdef CONFIG_RK29_MEM_SIZE_M
@@ -547,12 +548,12 @@ struct rk29_gpio_expander_info  wm831x_gpio_settinginfo[] = {
 
 
 #if defined(CONFIG_MFD_WM831X)
-
+static struct wm831x *gWm831x;
 int wm831x_pre_init(struct wm831x *parm)
 {
        int ret;
        printk("%s\n", __FUNCTION__);
-
+       gWm831x = parm;
        //ILIM = 900ma
        ret = wm831x_reg_read(parm, WM831X_POWER_STATE) & 0xffff;
        wm831x_reg_write(parm, WM831X_POWER_STATE, (ret&0xfff8) | 0x04);        
@@ -568,7 +569,6 @@ int wm831x_post_init(struct wm831x *parm)
        struct regulator *dcdc;
        struct regulator *ldo;
        
-
        dcdc = regulator_get(NULL, "dcdc3");            // 1th IO
        regulator_set_voltage(dcdc,3000000,3000000);
        regulator_enable(dcdc);                 
@@ -1399,6 +1399,18 @@ struct wm8994_pdata wm8994_platdata = {
        .jd_thr = 0,
 
        .PA_control =0,
+
+       .speaker_incall_vol = 0,
+       .speaker_incall_mic_vol = -9,
+       .speaker_normal_vol = 6,
+       .earpiece_incall_vol = 0,
+       .headset_incall_vol = 6,
+       .headset_incall_mic_vol = -6,
+       .headset_normal_vol = 6,
+       .BT_incall_vol = 0,
+       .BT_incall_mic_vol = 0,
+       .recorder_vol = 50,
+       
 };
 //#endif 
 
@@ -1496,7 +1508,7 @@ struct rk29_i2c_platform_data default_i2c1_data = {
        .flags      = 0,
        .slave_addr = 0xff,
        .scl_rate  = 400*1000,
-       .mode           = I2C_MODE_POLL,
+       .mode           = I2C_MODE_IRQ,
        .io_init = rk29_i2c1_io_init,
 };
 
@@ -1514,7 +1526,7 @@ struct rk29_i2c_platform_data default_i2c3_data = {
        .flags      = 0,
        .slave_addr = 0xff,
        .scl_rate  = 400*1000,
-       .mode           = I2C_MODE_POLL,
+       .mode           = I2C_MODE_IRQ,
        .io_init = rk29_i2c3_io_init,
 };
 
@@ -2921,6 +2933,16 @@ static struct xpt2046_platform_data xpt2046_info = {
 };
 #endif
 
+#if defined(CONFIG_SERIAL_SC8800)
+static struct plat_sc8800 sc8800_plat_data = {
+       .slav_rts_pin = RK29_PIN4_PD4,
+       .slav_rdy_pin = RK29_PIN4_PD1,
+       .master_rts_pin = RK29_PIN4_PD2,
+       .master_rdy_pin = RK29_PIN4_PD3,
+       //.poll_time = 100,
+};
+#endif
+
 static struct spi_board_info board_spi_devices[] = {
 #if defined(CONFIG_TOUCHSCREEN_XPT2046_SPI)
        {
@@ -2943,7 +2965,15 @@ static struct spi_board_info board_spi_devices[] = {
                .platform_data = &wm831x_platdata,
        },
 #endif
-
+#if defined(CONFIG_SERIAL_SC8800)
+       {
+               .modalias  = "sc8800",
+               .bus_num = 0,
+               .platform_data = &sc8800_plat_data,
+               .max_speed_hz  = 12*1000*1000,
+               .chip_select   = 0,
+       },
+#endif
 };
 
 
@@ -3030,6 +3060,9 @@ static void rk29_pm_power_off(void)
 {
        printk(KERN_ERR "rk29_pm_power_off start...\n");
        gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
+#if defined(CONFIG_MFD_WM831X)
+       wm831x_device_shutdown(gWm831x);
+#endif
        while (1);
 }
 
@@ -3042,11 +3075,6 @@ static void __init machine_rk29_board_init(void)
        gpio_direction_output(POWER_ON_PIN, GPIO_HIGH);
        pm_power_off = rk29_pm_power_off;
 
-// codec                
-       gpio_request(RK29_PIN5_PA1, NULL);                       
-       gpio_direction_output(RK29_PIN5_PA1,GPIO_HIGH);                 
-       gpio_free(RK29_PIN5_PA1);
-
        platform_add_devices(devices, ARRAY_SIZE(devices));
 #ifdef CONFIG_I2C0_RK29
        i2c_register_board_info(default_i2c0_data.bus_num, board_i2c0_devices,