* [PATCH] Input: goodix - sync the irq controller while starting firmware
@ 2026-10-20 12:26 Luca Leonardo Scorcia
2026-11-13 1:30 ` Dmitry Torokhov
0 siblings, 1 reply; 4+ messages in thread
From: Luca Leonardo Scorcia @ 2026-10-20 12:26 UTC (permalink / raw)
To: linux-input
Cc: Luca Leonardo Scorcia, Hans de Goede, Dmitry Torokhov,
Matthias Brugger, AngeloGioacchino Del Regno, linux-kernel,
linux-arm-kernel, linux-mediatek
On the Lenovo Tab E7 TB-7104F which has a Goodix GT-912F touch screen,
the touch screen fails to come online after loading firmware, producing
the error "Error reading 1 bytes from 0x8041: -6".
Comparing the upstream code with the Android stock sources a call to
goodix_int_sync is required between the upload of the firmware and the
watchdog restart. With this change the touchscreen is correctly detected
and working.
Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail.com>
---
Relevant bit of the stock source driver at [1].
Credits for noticing the issue and finding its cause go to matemiller992
on the postmarketOS forums, I cannot provide tags as he wants to stay
anonymous.
[1] https://github.com/lscorcia/linux-lenovo-tb7104f/blob/2dad69c9f28611ac6d3db2f1ee11b480a60d83ee/kernel-4.4/drivers/input/touchscreen/mediatek/gt912_p98996/gt9xx_driver.c#L1529
drivers/input/touchscreen/goodix_fwupload.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/input/touchscreen/goodix_fwupload.c b/drivers/input/touchscreen/goodix_fwupload.c
index 5ae9a109ba0d..01e7705ef515 100644
--- a/drivers/input/touchscreen/goodix_fwupload.c
+++ b/drivers/input/touchscreen/goodix_fwupload.c
@@ -155,6 +155,7 @@ static int goodix_enter_upload_mode(struct i2c_client *client)
static int goodix_start_firmware(struct i2c_client *client)
{
+ struct goodix_ts_data *ts = i2c_get_clientdata(client);
int error;
u8 val;
@@ -168,6 +169,10 @@ static int goodix_start_firmware(struct i2c_client *client)
if (error)
return error;
+ error = goodix_int_sync(ts);
+ if (error)
+ return error;
+
error = goodix_i2c_read(client, GOODIX_REG_SW_WDT, &val, 1);
if (error)
return error;
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: goodix - sync the irq controller while starting firmware
2026-10-20 12:26 [PATCH] Input: goodix - sync the irq controller while starting firmware Luca Leonardo Scorcia
@ 2026-11-13 1:30 ` Dmitry Torokhov
2026-11-16 18:53 ` Luca Leonardo Scorcia
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2026-11-13 1:30 UTC (permalink / raw)
To: Luca Leonardo Scorcia
Cc: linux-input, Hans de Goede, Matthias Brugger,
AngeloGioacchino Del Regno, linux-kernel, linux-arm-kernel,
linux-mediatek
Hi Luca,
On Tue, Oct 20, 2026 at 02:26:48PM +0200, Luca Leonardo Scorcia wrote:
> On the Lenovo Tab E7 TB-7104F which has a Goodix GT-912F touch screen,
> the touch screen fails to come online after loading firmware, producing
> the error "Error reading 1 bytes from 0x8041: -6".
>
> Comparing the upstream code with the Android stock sources a call to
> goodix_int_sync is required between the upload of the firmware and the
> watchdog restart. With this change the touchscreen is correctly detected
> and working.
>
> Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail.com>
> ---
> Relevant bit of the stock source driver at [1].
>
> Credits for noticing the issue and finding its cause go to matemiller992
> on the postmarketOS forums, I cannot provide tags as he wants to stay
> anonymous.
>
> [1] https://github.com/lscorcia/linux-lenovo-tb7104f/blob/2dad69c9f28611ac6d3db2f1ee11b480a60d83ee/kernel-4.4/drivers/input/touchscreen/mediatek/gt912_p98996/gt9xx_driver.c#L1529
>
> drivers/input/touchscreen/goodix_fwupload.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/input/touchscreen/goodix_fwupload.c b/drivers/input/touchscreen/goodix_fwupload.c
> index 5ae9a109ba0d..01e7705ef515 100644
> --- a/drivers/input/touchscreen/goodix_fwupload.c
> +++ b/drivers/input/touchscreen/goodix_fwupload.c
> @@ -155,6 +155,7 @@ static int goodix_enter_upload_mode(struct i2c_client *client)
>
> static int goodix_start_firmware(struct i2c_client *client)
> {
> + struct goodix_ts_data *ts = i2c_get_clientdata(client);
> int error;
> u8 val;
>
> @@ -168,6 +169,10 @@ static int goodix_start_firmware(struct i2c_client *client)
> if (error)
> return error;
>
> + error = goodix_int_sync(ts);
> + if (error)
> + return error;
> +
There is call to goodix_int_sync() right after call to
goodix_start_firmware(). Is it still needed if we call it here? I think
the vendor drivers does not do it.
> error = goodix_i2c_read(client, GOODIX_REG_SW_WDT, &val, 1);
> if (error)
> return error;
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: goodix - sync the irq controller while starting firmware
2026-11-13 1:30 ` Dmitry Torokhov
@ 2026-11-16 18:53 ` Luca Leonardo Scorcia
2026-11-23 23:24 ` Dmitry Torokhov
0 siblings, 1 reply; 4+ messages in thread
From: Luca Leonardo Scorcia @ 2026-11-16 18:53 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-input, Hans de Goede, Matthias Brugger,
AngeloGioacchino Del Regno, linux-kernel, linux-arm-kernel,
linux-mediatek
> There is call to goodix_int_sync() right after call to
> goodix_start_firmware(). Is it still needed if we call it here? I think
> the vendor drivers does not do it.
Hi,
unfortunately yes, it's needed right there on the Lenovo Tab E7.
Without it, the REG_SW_WDT right after it fails with the error "Error
reading 1 bytes from 0x8041: -6".
The vendor sources for this device [1] show the call to
goodix_int_sync exactly between the two interactions with the WDT
register.
Actually, in the same sources I see no trace of a second
goodix_int_sync after firmware has loaded, so the existing call could
be moved a little earlier instead of introducing a duplicated new one.
I tested moving the existing call on my device and it works just as
fine (basically, my patch + commenting out the existing call at the
end of goodix_firmware_upload.
Which vendor sources are you using for your reference?
Thank you,
Luca
[1] https://github.com/lscorcia/linux-lenovo-tb7104f/blob/2dad69c9f28611ac6d3db2f1ee11b480a60d83ee/kernel-4.4/drivers/input/touchscreen/mediatek/gt912_p98996/gt9xx_driver.c#L1529
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: goodix - sync the irq controller while starting firmware
2026-11-16 18:53 ` Luca Leonardo Scorcia
@ 2026-11-23 23:24 ` Dmitry Torokhov
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2026-11-23 23:24 UTC (permalink / raw)
To: Luca Leonardo Scorcia
Cc: linux-input, Hans de Goede, Matthias Brugger,
AngeloGioacchino Del Regno, linux-kernel, linux-arm-kernel,
linux-mediatek
Hi Luca,
On Mon, Nov 16, 2026 at 07:53:58PM +0100, Luca Leonardo Scorcia wrote:
> > There is call to goodix_int_sync() right after call to
> > goodix_start_firmware(). Is it still needed if we call it here? I think
> > the vendor drivers does not do it.
>
> Hi,
> unfortunately yes, it's needed right there on the Lenovo Tab E7.
> Without it, the REG_SW_WDT right after it fails with the error "Error
> reading 1 bytes from 0x8041: -6".
> The vendor sources for this device [1] show the call to
> goodix_int_sync exactly between the two interactions with the WDT
> register.
>
> Actually, in the same sources I see no trace of a second
> goodix_int_sync after firmware has loaded, so the existing call could
> be moved a little earlier instead of introducing a duplicated new one.
> I tested moving the existing call on my device and it works just as
> fine (basically, my patch + commenting out the existing call at the
> end of goodix_firmware_upload.
>
> Which vendor sources are you using for your reference?
Sorry for not being clear. I was looking at the same vendor driver you
linked to, and I was asking whether the second goodix_int_sync() at the
end of goodix_firmware_upload() was still needed once we call it inside
goodix_start_firmware(), since the vendor driver only does it once.
Since moving the call works on your device, please send a v2 that calls
goodix_int_sync() inside goodix_start_firmware() and removes the second
goodix_int_sync() call at the end of goodix_firmware_upload(). Also,
please change goodix_start_firmware() to take struct goodix_ts_data *ts
directly and use a local "struct i2c_client *client = ts->client;" temp
instead of going through i2c_get_clientdata().
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-23 23:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-20 12:26 [PATCH] Input: goodix - sync the irq controller while starting firmware Luca Leonardo Scorcia
2026-11-13 1:30 ` Dmitry Torokhov
2026-11-16 18:53 ` Luca Leonardo Scorcia
2026-11-23 23:24 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox