summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/silead.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2018-10-22 22:04:33 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2018-10-22 22:04:33 +0300
commitcacd9759eea2f1c7e8792ecd91ed4602f963b1a5 (patch)
tree59281a932bf0b3d736044eb33067cf1507ada1d7 /drivers/input/touchscreen/silead.c
parent13c1c5e4d7f887cba36c5e3df3faa22071c1469f (diff)
parentf39f8688888ae74fa8deae2d01289b69b4727394 (diff)
downloadlinux-cacd9759eea2f1c7e8792ecd91ed4602f963b1a5.tar.xz
Merge branch 'next' into for-linus
Prepare input updates for 4.20 merge window.
Diffstat (limited to 'drivers/input/touchscreen/silead.c')
-rw-r--r--drivers/input/touchscreen/silead.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c
index d196ac3d8b8c..09241d4cdebc 100644
--- a/drivers/input/touchscreen/silead.c
+++ b/drivers/input/touchscreen/silead.c
@@ -558,20 +558,33 @@ static int __maybe_unused silead_ts_suspend(struct device *dev)
static int __maybe_unused silead_ts_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
+ bool second_try = false;
int error, status;
silead_ts_set_power(client, SILEAD_POWER_ON);
+ retry:
error = silead_ts_reset(client);
if (error)
return error;
+ if (second_try) {
+ error = silead_ts_load_fw(client);
+ if (error)
+ return error;
+ }
+
error = silead_ts_startup(client);
if (error)
return error;
status = silead_ts_get_status(client);
if (status != SILEAD_STATUS_OK) {
+ if (!second_try) {
+ second_try = true;
+ dev_dbg(dev, "Reloading firmware after unsuccessful resume\n");
+ goto retry;
+ }
dev_err(dev, "Resume error, status: 0x%02x\n", status);
return -ENODEV;
}