diff options
| author | Yaroslav Furman <yaro330@gmail.com> | 2018-10-20 21:12:24 +0300 |
|---|---|---|
| committer | Davide Garberi <dade.garberi@gmail.com> | 2022-07-27 18:58:54 +0200 |
| commit | 29044edd21287f267593ecce47a4956cf1763003 (patch) | |
| tree | 5dd6b719f706525af00b939ae318910422b3a419 | |
| parent | a5cf5cbb98189ae683276546c30d46e769e9ae25 (diff) | |
gt1151: gt1x_generic: update guitar reset function
Our touchscreen only worked fine with HZ 100, before this.
Code taken from: [1] and cleaned up.
[1]: https://github.com/goodix/gt1x_driver_generic/blob/master/gt1x_generic.c#L884
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
| -rw-r--r-- | drivers/input/touchscreen/gt1151/gt1x_generic.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/drivers/input/touchscreen/gt1151/gt1x_generic.c b/drivers/input/touchscreen/gt1151/gt1x_generic.c index 2bac11f17337..291d5eb371e1 100644 --- a/drivers/input/touchscreen/gt1151/gt1x_generic.c +++ b/drivers/input/touchscreen/gt1151/gt1x_generic.c @@ -810,21 +810,30 @@ s32 gt1x_reset_guitar(void) GTP_INFO("GTP RESET!"); -#if GTP_INCELL_PANEL +#ifdef CONFIG_GTP_INCELL_PANEL ret = gt1x_incell_reset(); if (ret < 0) return ret; -#else +#else gt1x_select_addr(); - msleep(8); //must >= 6ms -#endif - - /* int synchronization */ - msleep(10); + usleep_range(8000, 8000); //must >= 6ms +#endif + +/* INT gpio is used to select i2c slave address + * during hardware reset, and INT synchronization + * flow informs the firmware that address selection + * has finished,if the kernel restricts the output + * of the gpio tied to IRQ line(kernel3.13 and + * later version), do the following steps: + * 1) select N to CONFIG_GTP_INT_SEL_SYNC + * in menuconfig. + * 2) config pinctrl dts, pull-up INT gpio. + * 3) chose falling-edge IRQ trigger type. + */ + GTP_GPIO_OUTPUT(GTP_INT_PORT, 0); + msleep(50); GTP_GPIO_AS_INT(GTP_INT_PORT); - /* this operation is necessary even when the esd check - fucntion dose not turn on */ ret = gt1x_set_reset_status(); return ret; } |
