diff options
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/touchscreen/atmel_mxt_ts.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 7f51d39ce2fb..d5b30434c4ac 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c | |||
@@ -181,8 +181,8 @@ | |||
181 | #define MXT_BACKUP_VALUE 0x55 | 181 | #define MXT_BACKUP_VALUE 0x55 |
182 | #define MXT_BACKUP_TIME 50 /* msec */ | 182 | #define MXT_BACKUP_TIME 50 /* msec */ |
183 | #define MXT_RESET_TIME 200 /* msec */ | 183 | #define MXT_RESET_TIME 200 /* msec */ |
184 | 184 | #define MXT_FW_RESET_TIME 3000 /* msec */ | |
185 | #define MXT_FWRESET_TIME 175 /* msec */ | 185 | #define MXT_FW_CHG_TIMEOUT 300 /* msec */ |
186 | 186 | ||
187 | /* Command to unlock bootloader */ | 187 | /* Command to unlock bootloader */ |
188 | #define MXT_UNLOCK_CMD_MSB 0xaa | 188 | #define MXT_UNLOCK_CMD_MSB 0xaa |
@@ -375,7 +375,7 @@ recheck: | |||
375 | * CHG assertion before reading the status byte. | 375 | * CHG assertion before reading the status byte. |
376 | * Once the status byte has been read, the line is deasserted. | 376 | * Once the status byte has been read, the line is deasserted. |
377 | */ | 377 | */ |
378 | ret = mxt_wait_for_chg(data, 300); | 378 | ret = mxt_wait_for_chg(data, MXT_FW_CHG_TIMEOUT); |
379 | if (ret) { | 379 | if (ret) { |
380 | /* | 380 | /* |
381 | * TODO: handle -ERESTARTSYS better by terminating | 381 | * TODO: handle -ERESTARTSYS better by terminating |
@@ -1047,6 +1047,18 @@ static int mxt_load_fw(struct device *dev, const char *fn) | |||
1047 | dev_dbg(dev, "Updated %d bytes / %zd bytes\n", pos, fw->size); | 1047 | dev_dbg(dev, "Updated %d bytes / %zd bytes\n", pos, fw->size); |
1048 | } | 1048 | } |
1049 | 1049 | ||
1050 | /* Wait for flash. */ | ||
1051 | ret = mxt_wait_for_chg(data, MXT_FW_RESET_TIME); | ||
1052 | if (ret) | ||
1053 | goto disable_irq; | ||
1054 | |||
1055 | /* | ||
1056 | * Wait for device to reset. Some bootloader versions do not assert | ||
1057 | * the CHG line after bootloading has finished, so ignore potential | ||
1058 | * errors. | ||
1059 | */ | ||
1060 | mxt_wait_for_chg(data, MXT_FW_RESET_TIME); | ||
1061 | |||
1050 | data->in_bootloader = false; | 1062 | data->in_bootloader = false; |
1051 | 1063 | ||
1052 | disable_irq: | 1064 | disable_irq: |
@@ -1075,10 +1087,6 @@ static ssize_t mxt_update_fw_store(struct device *dev, | |||
1075 | count = error; | 1087 | count = error; |
1076 | } else { | 1088 | } else { |
1077 | dev_dbg(dev, "The firmware update succeeded\n"); | 1089 | dev_dbg(dev, "The firmware update succeeded\n"); |
1078 | |||
1079 | /* Wait for reset */ | ||
1080 | msleep(MXT_FWRESET_TIME); | ||
1081 | |||
1082 | mxt_free_object_table(data); | 1090 | mxt_free_object_table(data); |
1083 | 1091 | ||
1084 | mxt_initialize(data); | 1092 | mxt_initialize(data); |