diff --git a/drivers/input/touchscreen/lge_touch_core.c b/drivers/input/touchscreen/lge_touch_core.c index 58a3c4bf8f6..a0edc68f0df 100644 --- a/drivers/input/touchscreen/lge_touch_core.c +++ b/drivers/input/touchscreen/lge_touch_core.c @@ -390,6 +390,8 @@ static int touch_ic_init(struct lge_touch_data *ts) } } +//FIXME: Disable Ghost Stage due to touch mal function +#if 0 if (ts->gf_ctrl.stage & GHOST_STAGE_2) { ts->gf_ctrl.stage = GHOST_STAGE_2 | GHOST_STAGE_3; if (touch_device_func->ic_ctrl) { @@ -421,6 +423,7 @@ static int touch_ic_init(struct lge_touch_data *ts) TOUCH_INFO_MSG("irq_pin[%d] next_work[%d] ghost_stage[0x%x]\n", int_pin, next_work, ts->gf_ctrl.stage); } +#endif ts->gf_ctrl.count = 0; ts->gf_ctrl.ghost_check_count = 0; diff --git a/drivers/input/touchscreen/touch_synaptics.c b/drivers/input/touchscreen/touch_synaptics.c index 040d7274d77..4a91d6439a5 100644 --- a/drivers/input/touchscreen/touch_synaptics.c +++ b/drivers/input/touchscreen/touch_synaptics.c @@ -375,9 +375,7 @@ static int read_page_description_table(struct i2c_client* client) ts->finger_dsc.id = 0; ts->button_dsc.id = 0; ts->flash_dsc.id = 0; -#if defined(CONFIG_TOUCH_REG_MAP_TM2000) || defined(CONFIG_TOUCH_REG_MAP_TM2372) ts->analog_dsc.id = 0; -#endif for (u_address = DESCRIPTION_TABLE_START; u_address > 10; u_address -= sizeof(struct ts_function_descriptor)) { @@ -399,6 +397,7 @@ static int read_page_description_table(struct i2c_client* client) break; case FLASH_MEMORY_MANAGEMENT: ts->flash_dsc = buffer; + break; } } @@ -408,18 +407,13 @@ static int read_page_description_table(struct i2c_client* client) return -EIO; } - u_address = DESCRIPTION_TABLE_START; - - if (unlikely(touch_i2c_read(client, u_address, sizeof(buffer), - (unsigned char *)&buffer) < 0)) { + if (unlikely(touch_i2c_read(client, ANALOG_TABLE_START, sizeof(buffer), (unsigned char *)&buffer) < 0)) { TOUCH_ERR_MSG("RMI4 Function Descriptor read fail\n"); return -EIO; } - switch (buffer.id) { - case ANALOG_CONTROL: + if (buffer.id == ANALOG_CONTROL) { ts->analog_dsc = buffer; - break; } if (unlikely(touch_i2c_write_byte(client, PAGE_SELECT_REG, 0x02) < 0)) { @@ -427,19 +421,13 @@ static int read_page_description_table(struct i2c_client* client) return -EIO; } - u_address -= sizeof(struct ts_function_descriptor); - - if (unlikely(touch_i2c_read(ts->client, u_address, sizeof(buffer), - (unsigned char *)&buffer))) { + if (unlikely(touch_i2c_read(ts->client, BUTTON_TABLE_START, sizeof(buffer), (unsigned char *)&buffer))) { TOUCH_ERR_MSG("Button ts_function_descriptor read fail\n"); return -EIO; } - switch (buffer.id) { - case CAPACITIVE_BUTTON_SENSORS: + if (buffer.id == CAPACITIVE_BUTTON_SENSORS) ts->button_dsc = buffer; - break; - } if (unlikely(touch_i2c_write_byte(client, PAGE_SELECT_REG, 0x00) < 0)) { TOUCH_ERR_MSG("PAGE_SELECT_REG write fail\n"); @@ -911,6 +899,9 @@ int synaptics_ts_ic_ctrl(struct i2c_client *client, u8 code, u16 value) case IC_CTRL_BASELINE: switch (value) { case BASELINE_OPEN: + if (!ts->analog_dsc.id) /* If not supported, ignore */ + break; + #if defined(CONFIG_TOUCH_REG_MAP_TM2000) || defined(CONFIG_TOUCH_REG_MAP_TM2372) if (unlikely(touch_i2c_write_byte(client, PAGE_SELECT_REG, 0x01) < 0)) { @@ -952,6 +943,9 @@ int synaptics_ts_ic_ctrl(struct i2c_client *client, u8 code, u16 value) #endif break; case BASELINE_FIX: + if (!ts->analog_dsc.id) /* If not supported, ignore */ + break; + #if defined(CONFIG_TOUCH_REG_MAP_TM2000) || defined(CONFIG_TOUCH_REG_MAP_TM2372) if (unlikely(touch_i2c_write_byte(client, PAGE_SELECT_REG, 0x01) < 0)) { diff --git a/include/linux/input/touch_synaptics.h b/include/linux/input/touch_synaptics.h index 396d6b50a35..15fd281361e 100644 --- a/include/linux/input/touch_synaptics.h +++ b/include/linux/input/touch_synaptics.h @@ -27,6 +27,8 @@ #define MAX_NUM_OF_FINGERS 10 #define DESCRIPTION_TABLE_START 0xe9 +#define ANALOG_TABLE_START 0xe9 +#define BUTTON_TABLE_START 0xe3 struct ts_function_descriptor { u8 query_base;