From 0efe0dcfe76eccaccbc14ba432163e2d12f93df0 Mon Sep 17 00:00:00 2001 From: "makarand.karvekar" Date: Fri, 6 Aug 2010 15:26:20 -0500 Subject: [PATCH] touch: temporary fix for IC wake issue. reset commented out in resume. reset address pointer to message object. adjusted wait time after reset upon recommendation from Atmel. Change-Id: I0dd983ce0545c6ca2e48d4ed06b90d8c1ac1a390 Signed-off-by: makarand.karvekar --- drivers/input/touchscreen/qtouch_obp_ts.c | 18 +++++++++++++++--- include/linux/qtouch_obp_ts.h | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/qtouch_obp_ts.c b/drivers/input/touchscreen/qtouch_obp_ts.c index 20650d78c3c2..e17ebd2a6748 100644 --- a/drivers/input/touchscreen/qtouch_obp_ts.c +++ b/drivers/input/touchscreen/qtouch_obp_ts.c @@ -1675,6 +1675,7 @@ static int qtouch_ts_probe(struct i2c_client *client, ts->ypos_lshift_msb, ts->ypos_rshift_lsb); qtouch_force_reset(ts, 0); + msleep(QTM_OBP_SLEEP_WAIT_FOR_HW_RESET); err = qtouch_process_info_block(ts); if (err == 0) { @@ -1699,7 +1700,7 @@ static int qtouch_ts_probe(struct i2c_client *client, /* Reset the chip into bootloader mode */ if (ts->fw_version >= ts->base_fw_version) { qtouch_force_reset(ts, 2); - msleep(QTM_OBP_SLEEP_WAIT_FOR_RESET); + msleep(QTM_OBP_SLEEP_WAIT_FOR_HW_RESET); ts->org_i2c_addr = ts->client->addr; ts->client->addr = ts->pdata->boot_i2c_addr; @@ -1713,7 +1714,7 @@ static int qtouch_ts_probe(struct i2c_client *client, pr_info("%s:Cannot read info block %i, checking for bootloader mode.\n", __func__, err); qtouch_force_reset(ts, 0); - msleep(QTM_OBP_SLEEP_WAIT_FOR_RESET); + msleep(QTM_OBP_SLEEP_WAIT_FOR_HW_RESET); ts->org_i2c_addr = ts->client->addr; ts->client->addr = ts->pdata->boot_i2c_addr; @@ -1767,6 +1768,7 @@ static int qtouch_ts_probe(struct i2c_client *client, ts->client->addr = ts->org_i2c_addr; qtouch_force_reset(ts, 0); + msleep(QTM_OBP_SLEEP_WAIT_FOR_HW_RESET); pr_err("%s: I2C address is 0x%X\n", __func__, ts->client->addr); err = qtouch_process_info_block(ts); @@ -1906,6 +1908,7 @@ static int qtouch_ts_resume(struct i2c_client *client) struct qtouch_ts_data *ts = i2c_get_clientdata(client); int ret; int i; + struct qtm_object *obj; if (qtouch_tsdebug & 4) pr_info("%s: Resuming\n", __func__); @@ -1936,7 +1939,16 @@ static int qtouch_ts_resume(struct i2c_client *client) pr_err("%s: Cannot write power config\n", __func__); return -EIO; } - qtouch_force_reset(ts, 0); + /* HACK: temporary fix for IC wake issue + qtouch_force_reset(ts, 0); */ + /* Point the address pointer to the message processor. + * Must do this before enabling interrupts */ + obj = find_obj(ts, QTM_OBJ_GEN_MSG_PROC); + ret = qtouch_set_addr(ts, obj->entry.addr); + if (ret != 0) { + pr_err("%s: Can't to set addr to msg processor\n", __func__); + } + /* end of HACK */ enable_irq(ts->client->irq); return 0; diff --git a/include/linux/qtouch_obp_ts.h b/include/linux/qtouch_obp_ts.h index ba6915d2c95b..7d79c3554495 100644 --- a/include/linux/qtouch_obp_ts.h +++ b/include/linux/qtouch_obp_ts.h @@ -36,7 +36,7 @@ #define QTM_OBP_SLEEP_WAIT_FOR_RESET 6000 #define QTM_OBP_SLEEP_WAIT_FOR_BACKUP 500 #define QTM_OBP_SLEEP_RESET_HOLD 20 -#define QTM_OBP_SLEEP_WAIT_FOR_HW_RESET 40 +#define QTM_OBP_SLEEP_WAIT_FOR_HW_RESET 150 enum { QTM_OBJ_RESERVED0 = 0, -- 2.34.1