summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/atmel_mxt_ts.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/atmel_mxt_ts.c')
-rw-r--r--drivers/input/touchscreen/atmel_mxt_ts.c29
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;
}