diff options
author | Joel Kenny <jkenny@nvidia.com> | 2011-09-02 15:35:42 -0700 |
---|---|---|
committer | Ryan Wong <ryanw@nvidia.com> | 2011-10-06 16:05:24 -0700 |
commit | 0f8ea54fae662422b4b04eb1602049a8c9e6511b (patch) | |
tree | cf166ab5310a342ebf3d2a04ca6b9da28050bc5c | |
parent | cb6cf12edad45b0e125638fbd335336069739e27 (diff) |
input: touch: atmel_mxt_ts: Prevent touchscreen from becoming unresponsive in some situationstegra-12r10-android-3.2
BUG 868649
Change-Id: I731b15981c37b52651978538ba53ae78d6cbdb5f
Reviewed-on: http://git-master/r/56319
Reviewed-by: Ryan Wong <ryanw@nvidia.com>
Tested-by: Ryan Wong <ryanw@nvidia.com>
-rw-r--r-- | drivers/input/touchscreen/atmel_mxt_ts.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index e89b876a7ba6..7143f7a95c85 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -784,13 +784,13 @@ static int mxt_check_reg_init(struct mxt_data *data) MXT_BACKUP_VALUE); msleep(MXT_BACKUP_TIME); do { - error = mxt_read_object(data, MXT_GEN_COMMAND, + error = mxt_read_object(data, MXT_GEN_COMMAND, MXT_COMMAND_BACKUPNV, &command_register); - if (error) - return error; + if (error) + return error; msleep(2); - } while ((command_register != 0) && (timeout_counter++ <= 100)); + } while ((command_register != 0) && (timeout_counter++ <= 100)); if (timeout_counter >= 100) { dev_err(&client->dev, "No response after backup!\n"); return -EIO; @@ -953,6 +953,13 @@ static int mxt_initialize(struct mxt_data *data) &actv_cycle_time); if (error) return error; + + dev_info(&client->dev, "in mxt_initialize(), Active Cycle Time: %d Idle Cycle Time: %d\n", + actv_cycle_time, idle_cycle_time); + + data->actv_cycle_time = actv_cycle_time; + data->idle_cycle_time = idle_cycle_time; + dev_info(&client->dev, "Family ID: %d Variant ID: %d Version: %d Build: %d\n", info->family_id, info->variant_id, info->version, @@ -1140,6 +1147,10 @@ static void mxt_start(struct mxt_data *data) { int error; struct device *dev = &data->client->dev; + + if (data->is_stopped == 0) + return; + dev_info(dev, "in MXT_START(), idle time: %d %d", data->idle_cycle_time, data->actv_cycle_time); /* Restore the cycle time settings to wake from sleep */ error = mxt_write_object(data, MXT_GEN_POWER, MXT_POWER_ACTVACQINT, @@ -1202,9 +1213,15 @@ i2c_error: static int mxt_input_open(struct input_dev *dev) { - /* struct mxt_data *data = input_get_drvdata(dev); - */ + u8 n; + + /* A dummy read to wake up the chip */ + mxt_read_object(data, MXT_GEN_POWER, MXT_POWER_IDLEACQINT, &n); + msleep(MXT_WAKEUP_TIME); + + mxt_start(data); + return 0; } |