diff options
author | Joel Kenny <jkenny@nvidia.com> | 2011-09-02 15:35:42 -0700 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-09-26 19:14:22 -0700 |
commit | ad1dbe0eda931f813b20d75400daaa9edf18c82a (patch) | |
tree | 9695407e150e69611e615ea6eb1476094eb3fa2b | |
parent | c23a24625f5720adb5ede209b60793b5790ead80 (diff) |
input: touch: atmel_mxt_ts: Prevent touchscreen from becoming unresponsive in some situations
BUG 868649
Change-Id: I4db69fd28bba82b9fed73e63947c0fb5ad56f732
Reviewed-on: http://git-master/r/50598
Reviewed-by: Robert Collins <rcollins@nvidia.com>
Tested-by: Robert Collins <rcollins@nvidia.com>
Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@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; } |