CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_CMDLINE="console=ttyFIQ0 androidboot.console=ttyFIQ0 init=/init"
-CONFIG_CPU_FREQ=y
-CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE=y
-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_GOV_HOTPLUG=y
CONFIG_CPU_IDLE=y
CONFIG_VFP=y
CONFIG_NEON=y
CONFIG_I2C=y
# CONFIG_I2C_COMPAT is not set
CONFIG_I2C0_CONTROLLER_RK30=y
-CONFIG_I2C1_CONTROLLER_RK30=y
+# CONFIG_I2C1_RK30 is not set
CONFIG_I2C2_CONTROLLER_RK30=y
CONFIG_I2C3_CONTROLLER_RK30=y
CONFIG_I2C4_CONTROLLER_RK30=y
+CONFIG_I2C_GPIO_RK30=y
CONFIG_SPI=y
CONFIG_SPIM_RK29=y
CONFIG_SPIM0_RK29=y
.y_max = 800,
.gpio_reset = TOUCH_GPIO_RESET,
.gpio_reset_active_low = 1,
- .gpio_pendown = TOUCH_GPIO_RESET,
+ .gpio_pendown = TOUCH_GPIO_INT,
.pendown_iomux_name = GPIO4C2_SMCDATA2_TRACEDATA2_NAME,
.resetpin_iomux_name = GPIO4D0_SMCDATA8_TRACEDATA8_NAME,
.pendown_iomux_mode = GPIO4C_GPIO4C2,
#endif
#ifdef CONFIG_I2C1_RK30
+#if 0
#include "board-rk30-phone-wm831x.c"
static struct i2c_board_info __initdata i2c1_info[] = {
#endif
};
#endif
+#endif
#ifdef CONFIG_I2C2_RK30
static struct i2c_board_info __initdata i2c2_info[] = {
};
#endif
+#ifdef CONFIG_I2C_GPIO_RK30
+#include "board-rk30-phone-wm831x.c"
+
+#define I2C_SDA_PIN RK30_PIN2_PD7 //set sda_pin here
+#define I2C_SCL_PIN RK30_PIN2_PD6 //set scl_pin here
+static int rk30_i2c_io_init(void)
+{
+ //set iomux (gpio) here
+ rk30_mux_api_set(GPIO2D7_I2C1SCL_NAME, GPIO2D_GPIO2D7);
+ rk30_mux_api_set(GPIO2D6_I2C1SDA_NAME, GPIO2D_GPIO2D6);
+
+ return 0;
+}
+struct i2c_gpio_platform_data default_i2c_gpio_data = {
+ .sda_pin = I2C_SDA_PIN,
+ .scl_pin = I2C_SCL_PIN,
+ .udelay = 5, // clk = 500/udelay = 100Khz
+ .timeout = 100,//msecs_to_jiffies(100),
+ .bus_num = 5,
+ .io_init = rk30_i2c_io_init,
+};
+static struct i2c_board_info __initdata i2c_gpio_info[] = {
+#if defined (CONFIG_MFD_WM831X_I2C)
+ {
+ .type = "wm8310",
+ .addr = 0x34,
+ .flags = 0,
+ .irq = RK30_PIN6_PA4,
+ .platform_data = &wm831x_platdata,
+ },
+#endif
+};
+#endif
+
+
static void __init rk30_i2c_register_board_info(void)
{
#ifdef CONFIG_I2C0_RK30
#ifdef CONFIG_I2C4_RK30
i2c_register_board_info(4, i2c4_info, ARRAY_SIZE(i2c4_info));
#endif
+#ifdef CONFIG_I2C_GPIO_RK30
+ i2c_register_board_info(5, i2c_gpio_info, ARRAY_SIZE(i2c_gpio_info));
+#endif
+
}
//end of i2c
msgs[0].buf = (unsigned char *)data;
msgs[0].len = len;
msgs[0].scl_rate = MPU_I2C_RATE;
- //msgs[0].udelay = 200;
res = i2c_transfer(i2c_adap, msgs, 1);
if (res == 1)
msgs[0].buf = ®
msgs[0].len = 1;
msgs[0].scl_rate = MPU_I2C_RATE;
- //msgs[0].udelay = 200;
msgs[1].addr = address;
msgs[1].flags = I2C_M_RD;
msgs[1].buf = data;
msgs[1].len = len;
msgs[1].scl_rate = MPU_I2C_RATE;
- //msgs[1].udelay = 200;
res = i2c_transfer(i2c_adap, msgs, 2);
if (res == 2)
unsigned char bank[2];
unsigned char addr[2];
unsigned char buf;
-
- struct i2c_msg msgs[4];
+ struct i2c_msg msgs[2];
int res;
if (!data || !i2c_adap) {
msgs[0].buf = bank;
msgs[0].len = sizeof(bank);
msgs[0].scl_rate = MPU_I2C_RATE;
- //msgs[0].udelay = 200;
+
+ res = i2c_transfer(i2c_adap, msgs, 1);
+ if (res != 1)
+ return res;
+
+ msgs[0].addr = mpu_addr;
+ msgs[0].flags = 0;
+ msgs[0].buf = addr;
+ msgs[0].len = sizeof(addr);
+ msgs[0].scl_rate = MPU_I2C_RATE;
+
+ res = i2c_transfer(i2c_adap, msgs, 1);
+ if (res != 1)
+ return res;
+
+ msgs[0].addr = mpu_addr;
+ msgs[0].flags = 0;
+ msgs[0].buf = &buf;
+ msgs[0].len = 1;
+ msgs[0].scl_rate = MPU_I2C_RATE;
msgs[1].addr = mpu_addr;
- msgs[1].flags = 0;
- msgs[1].buf = addr;
- msgs[1].len = sizeof(addr);
+ msgs[1].flags = I2C_M_RD;
+ msgs[1].buf = data;
+ msgs[1].len = len;
msgs[1].scl_rate = MPU_I2C_RATE;
- //msgs[1].udelay = 200;
-
- msgs[2].addr = mpu_addr;
- msgs[2].flags = 0;
- msgs[2].buf = &buf;
- msgs[2].len = 1;
- msgs[2].scl_rate = MPU_I2C_RATE;
- //msgs[2].udelay = 200;
-
- msgs[3].addr = mpu_addr;
- msgs[3].flags = I2C_M_RD;
- msgs[3].buf = data;
- msgs[3].len = len;
- msgs[3].scl_rate = MPU_I2C_RATE;
- //msgs[3].udelay = 200;
-
- res = i2c_transfer(i2c_adap, msgs, 4);
- if (res == 4)
+
+ res = i2c_transfer(i2c_adap, msgs, 2);
+ if (res == 2)
return 0;
else if(res == 0)
return -EBUSY;
unsigned char addr[2];
unsigned char buf[513];
- struct i2c_msg msgs[3];
+ struct i2c_msg msgs[2];
int res;
if (!data || !i2c_adap) {
msgs[0].buf = bank;
msgs[0].len = sizeof(bank);
msgs[0].scl_rate = MPU_I2C_RATE;
- //msgs[0].udelay = 200;
- msgs[1].addr = mpu_addr;
- msgs[1].flags = 0;
- msgs[1].buf = addr;
- msgs[1].len = sizeof(addr);
- msgs[1].scl_rate = MPU_I2C_RATE;
- //msgs[1].udelay = 200;
+ res = i2c_transfer(i2c_adap, msgs, 1);
+ if (res != 1)
+ return res;
+
+ msgs[0].addr = mpu_addr;
+ msgs[0].flags = 0;
+ msgs[0].buf = addr;
+ msgs[0].scl_rate = MPU_I2C_RATE;
+
+ res = i2c_transfer(i2c_adap, msgs, 1);
+ if (res != 1)
+ return res;
- msgs[2].addr = mpu_addr;
- msgs[2].flags = 0;
- msgs[2].buf = (unsigned char *)buf;
- msgs[2].len = len + 1;
- msgs[2].scl_rate = MPU_I2C_RATE;
- //msgs[2].udelay = 200;
+ msgs[0].addr = mpu_addr;
+ msgs[0].flags = 0;
+ msgs[0].buf = (unsigned char *)buf;
+ msgs[0].len = len + 1;
+ msgs[0].scl_rate = MPU_I2C_RATE;
- res = i2c_transfer(i2c_adap, msgs, 3);
- if (res == 3)
+ res = i2c_transfer(i2c_adap, msgs, 1);
+ if (res == 1)
return 0;
else if(res == 0)
return -EBUSY;