Skip to content

Commit c7e37cc

Browse files
jwrdegoededtor
authored andcommitted
Input: goodix - try resetting the controller when no config is set
On ACPI systems (irq_pin_access_method == IRQ_PIN_ACCESS_ACPI_*) the driver does not reset the controller at probe time, because sometimes the system firmware loads a config and resetting might loose this config. On the Nanote UMPC-01 device OTOH the config is in flash of the controller, the controller needs a reset to load this; and the system firmware does not reset the controller on a cold boot. To fix the Nanote UMPC-01 touchscreen not working on a cold boot, try resetting the controller and then re-reading the config when encountering a config with 0 width/height/max_touch_num value and the controller has not already been reset by goodix_ts_probe(). This should be safe to do in general because normally we should never encounter a config with 0 width/height/max_touch_num. Doing this in general not only avoids the need for a DMI quirk, but also might help other systems. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Bastien Nocera <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent a01aca4 commit c7e37cc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/input/touchscreen/goodix.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,13 +1158,24 @@ static int goodix_configure_dev(struct goodix_ts_data *ts)
11581158
input_set_abs_params(ts->input_dev, ABS_MT_WIDTH_MAJOR, 0, 255, 0, 0);
11591159
input_set_abs_params(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);
11601160

1161+
retry_read_config:
11611162
/* Read configuration and apply touchscreen parameters */
11621163
goodix_read_config(ts);
11631164

11641165
/* Try overriding touchscreen parameters via device properties */
11651166
touchscreen_parse_properties(ts->input_dev, true, &ts->prop);
11661167

11671168
if (!ts->prop.max_x || !ts->prop.max_y || !ts->max_touch_num) {
1169+
if (!ts->reset_controller_at_probe &&
1170+
ts->irq_pin_access_method != IRQ_PIN_ACCESS_NONE) {
1171+
dev_info(&ts->client->dev, "Config not set, resetting controller\n");
1172+
/* Retry after a controller reset */
1173+
ts->reset_controller_at_probe = true;
1174+
error = goodix_reset(ts);
1175+
if (error)
1176+
return error;
1177+
goto retry_read_config;
1178+
}
11681179
dev_err(&ts->client->dev,
11691180
"Invalid config (%d, %d, %d), using defaults\n",
11701181
ts->prop.max_x, ts->prop.max_y, ts->max_touch_num);

0 commit comments

Comments
 (0)