touch: temporary fix for IC wake issue.
authormakarand.karvekar <makarand.karvekar@motorola.com>
Fri, 6 Aug 2010 20:26:20 +0000 (15:26 -0500)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:33:33 +0000 (16:33 -0700)
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 <makarand.karvekar@motorola.com>
drivers/input/touchscreen/qtouch_obp_ts.c
include/linux/qtouch_obp_ts.h

index 20650d78c3c29390f5073ba3fe8e01d5084b121c..e17ebd2a6748bf9d5f102d73d28558b7902fb5ad 100644 (file)
@@ -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;
index ba6915d2c95b2b3cb8ba338166ee7eebf8eea8c6..7d79c35544952868122491f4d03b1a271dc097cb 100644 (file)
@@ -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,