Skip to content

Commit 7363096

Browse files
mwelchukdtor
authored andcommitted
Input: goodix - remove setting of RST pin to input
The reset line is being set to input on non-ACPI devices apparently to save power. This isn't being done on ACPI devices as it's been found that some ACPI devices don't have a pull-up resistor fitted. This can also be the case for non-ACPI devices, resulting in: [ 941.672207] Goodix-TS 1-0014: Error reading 10 bytes from 0x814e: -110 [ 942.696168] Goodix-TS 1-0014: Error reading 10 bytes from 0x814e: -110 [ 945.832208] Goodix-TS 1-0014: Error reading 10 bytes from 0x814e: -110 This behaviour appears to have been initialing introduced in ec6e1b4. This doesn't seem to be based on information in either the GT911 or GT9271 datasheets cited as sources of information for this change. Thus it seems likely that it is based on functionality in the Android driver which it also lists. This behaviour may be viable in very specific instances where the hardware is well known, but seems unwise in the upstream kernel where such hardware requirements can't be guaranteed. Remove this over optimisation to improve reliability on non-ACPI devices. Signed-off-by: Martyn Welch <martyn.welch@collabora.com> Reviewed-by: Hans de Goede <hansg@kernel.org> Link: https://lore.kernel.org/r/20251009134138.686215-1-martyn.welch@collabora.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent c6d99e4 commit 7363096

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

drivers/input/touchscreen/goodix.c

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -796,17 +796,6 @@ int goodix_reset_no_int_sync(struct goodix_ts_data *ts)
796796

797797
usleep_range(6000, 10000); /* T4: > 5ms */
798798

799-
/*
800-
* Put the reset pin back in to input / high-impedance mode to save
801-
* power. Only do this in the non ACPI case since some ACPI boards
802-
* don't have a pull-up, so there the reset pin must stay active-high.
803-
*/
804-
if (ts->irq_pin_access_method == IRQ_PIN_ACCESS_GPIO) {
805-
error = gpiod_direction_input(ts->gpiod_rst);
806-
if (error)
807-
goto error;
808-
}
809-
810799
return 0;
811800

812801
error:
@@ -957,14 +946,6 @@ static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts)
957946
return -EINVAL;
958947
}
959948

960-
/*
961-
* Normally we put the reset pin in input / high-impedance mode to save
962-
* power. But some x86/ACPI boards don't have a pull-up, so for the ACPI
963-
* case, leave the pin as is. This results in the pin not being touched
964-
* at all on x86/ACPI boards, except when needed for error-recover.
965-
*/
966-
ts->gpiod_rst_flags = GPIOD_ASIS;
967-
968949
return devm_acpi_dev_add_driver_gpios(dev, gpio_mapping);
969950
}
970951
#else
@@ -989,12 +970,6 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts)
989970
return -EINVAL;
990971
dev = &ts->client->dev;
991972

992-
/*
993-
* By default we request the reset pin as input, leaving it in
994-
* high-impedance when not resetting the controller to save power.
995-
*/
996-
ts->gpiod_rst_flags = GPIOD_IN;
997-
998973
ts->avdd28 = devm_regulator_get(dev, "AVDD28");
999974
if (IS_ERR(ts->avdd28))
1000975
return dev_err_probe(dev, PTR_ERR(ts->avdd28), "Failed to get AVDD28 regulator\n");
@@ -1019,7 +994,7 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts)
1019994
ts->gpiod_int = gpiod;
1020995

1021996
/* Get the reset line GPIO pin number */
1022-
gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_RST_NAME, ts->gpiod_rst_flags);
997+
gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_RST_NAME, GPIOD_ASIS);
1023998
if (IS_ERR(gpiod))
1024999
return dev_err_probe(dev, PTR_ERR(gpiod), "Failed to get %s GPIO\n",
10251000
GOODIX_GPIO_RST_NAME);

drivers/input/touchscreen/goodix.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ struct goodix_ts_data {
8888
struct gpio_desc *gpiod_rst;
8989
int gpio_count;
9090
int gpio_int_idx;
91-
enum gpiod_flags gpiod_rst_flags;
9291
char id[GOODIX_ID_MAX_LEN + 1];
9392
char cfg_name[64];
9493
u16 version;

0 commit comments

Comments
 (0)