File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
drivers/input/touchscreen Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1268,6 +1268,7 @@ static int __maybe_unused goodix_resume(struct device *dev)
1268
1268
{
1269
1269
struct i2c_client * client = to_i2c_client (dev );
1270
1270
struct goodix_ts_data * ts = i2c_get_clientdata (client );
1271
+ u8 config_ver ;
1271
1272
int error ;
1272
1273
1273
1274
if (ts -> irq_pin_access_method == IRQ_PIN_ACCESS_NONE ) {
@@ -1289,6 +1290,27 @@ static int __maybe_unused goodix_resume(struct device *dev)
1289
1290
if (error )
1290
1291
return error ;
1291
1292
1293
+ error = goodix_i2c_read (ts -> client , ts -> chip -> config_addr ,
1294
+ & config_ver , 1 );
1295
+ if (error )
1296
+ dev_warn (dev , "Error reading config version: %d, resetting controller\n" ,
1297
+ error );
1298
+ else if (config_ver != ts -> config [0 ])
1299
+ dev_info (dev , "Config version mismatch %d != %d, resetting controller\n" ,
1300
+ config_ver , ts -> config [0 ]);
1301
+
1302
+ if (error != 0 || config_ver != ts -> config [0 ]) {
1303
+ error = goodix_reset (ts );
1304
+ if (error ) {
1305
+ dev_err (dev , "Controller reset failed.\n" );
1306
+ return error ;
1307
+ }
1308
+
1309
+ error = goodix_send_cfg (ts , ts -> config , ts -> chip -> config_len );
1310
+ if (error )
1311
+ return error ;
1312
+ }
1313
+
1292
1314
error = goodix_request_irq (ts );
1293
1315
if (error )
1294
1316
return error ;
You can’t perform that action at this time.
0 commit comments