Skip to content

Commit 1921dac

Browse files
jwrdegoededtor
authored andcommitted
Input: goodix - make resetting the controller at probe independent from the GPIO setup
Before this commit we would always reset the controller at probe when we have access to the GPIOs which are necessary to do a reset. Doing the reset requires access to the GPIOs, but just because we have access to the GPIOs does not mean that we should always reset the controller at probe. On X86 ACPI platforms the BIOS / UEFI firmware will already have reset the controller and it will have loaded the device specific config into the controller. Doing the reset sometimes causes the controller to lose its configuration, so on X86 ACPI platforms this is not a good idea. This commit adds a new reset_controller_at_probe boolean to control the reset at probe behavior. This commits sets the new bool to true when we set irq_pin_access_method to IRQ_PIN_ACCESS_GPIO, so there are no functional changes. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1786317 BugLink: nexus511/gpd-ubuntu-packages#10 BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199207 Reviewed-by: Bastien Nocera <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent e070a97 commit 1921dac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/input/touchscreen/goodix.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ struct goodix_ts_data {
5656
u16 id;
5757
u16 version;
5858
const char *cfg_name;
59+
bool reset_controller_at_probe;
5960
bool load_cfg_from_disk;
6061
struct completion firmware_loading_complete;
6162
unsigned long irq_flags;
@@ -672,6 +673,7 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts)
672673
ts->gpiod_rst = gpiod;
673674

674675
if (ts->gpiod_int && ts->gpiod_rst) {
676+
ts->reset_controller_at_probe = true;
675677
ts->load_cfg_from_disk = true;
676678
ts->irq_pin_access_method = IRQ_PIN_ACCESS_GPIO;
677679
}
@@ -954,7 +956,7 @@ static int goodix_ts_probe(struct i2c_client *client,
954956
if (error)
955957
return error;
956958

957-
if (ts->irq_pin_access_method == IRQ_PIN_ACCESS_GPIO) {
959+
if (ts->reset_controller_at_probe) {
958960
/* reset the controller */
959961
error = goodix_reset(ts);
960962
if (error) {

0 commit comments

Comments
 (0)