* [RFC PATCH V2] Input: elan_i2c_smbus - resend ENABLE_TP on wake from sleep (NOT TESTED, NEEDS TESTER!) (v2: typo fixes)
@ 2026-09-22 23:35 R. Larocque
2026-09-28 4:59 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: R. Larocque @ 2026-09-22 23:35 UTC (permalink / raw)
To: linux-input
Cc: dmitry.torokhov, dave.wang, jingle.wu, linux-kernel,
Raphaël Larocque
From: "Raphaël Larocque" <rlarocque@disroot.org>
elan_smbus_sleep_control() sends ETP_SMBUS_SLEEP_CMD to put the
controller to sleep, but does nothing on wake, leaving a long-standing
XXX comment questioning whether ETP_SMBUS_ENABLE_TP should be re-sent.
elan_initialize() already treats sleep_control(client, false) as a
genuine "wake device up" primitive (see the ASUS special-firmware
branch and its accompanying dev_err() message), so this makes the
non-ASUS/default path resend ETP_SMBUS_ENABLE_TP symmetrically with
elan_smbus_initialize() instead of being a no-op.
Signed-off-by: Raphaël Larocque <rlarocque@disroot.org>
---
RFC: I don't have the Elan SMBus protocol datasheet and consequently
haven't been able to test this on any real hardware where the previous no-op
path was actually relied upon. Sending this for testing by
someone with access to affected devices before it is considered for
merge. A bad SMBus write to a sleeping controller could leave it
in a weird state on the wrong firmware revision if unlucky.
drivers/input/mouse/elan_i2c_smbus.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/input/mouse/elan_i2c_smbus.c b/drivers/input/mouse/elan_i2c_smbus.c
index 0287441cda46..95f5951e9549 100644
--- a/drivers/input/mouse/elan_i2c_smbus.c
+++ b/drivers/input/mouse/elan_i2c_smbus.c
@@ -93,10 +93,25 @@ static int elan_smbus_set_mode(struct i2c_client *client, u8 mode)
static int elan_smbus_sleep_control(struct i2c_client *client, bool sleep)
{
+ int error;
+
if (sleep)
return i2c_smbus_write_byte(client, ETP_SMBUS_SLEEP_CMD);
- else
- return 0; /* XXX should we send ETP_SMBUS_ENABLE_TP here? */
+
+ /*
+ * The controller stops touch reporting while asleep; resend
+ * ETP_SMBUS_ENABLE_TP on wake, mirroring what is done during
+ * elan_smbus_initialize(), so that reporting actually resumes.
+ */
+ error = i2c_smbus_write_byte(client, ETP_SMBUS_ENABLE_TP);
+ if (error) {
+ dev_err(&client->dev,
+ "failed to re-enable touchpad after wake: %d\n",
+ error);
+ return error;
+ }
+
+ return 0;
}
static int elan_smbus_power_control(struct i2c_client *client, bool enable)
--
2.55.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFC PATCH V2] Input: elan_i2c_smbus - resend ENABLE_TP on wake from sleep (NOT TESTED, NEEDS TESTER!) (v2: typo fixes)
2026-09-22 23:35 [RFC PATCH V2] Input: elan_i2c_smbus - resend ENABLE_TP on wake from sleep (NOT TESTED, NEEDS TESTER!) (v2: typo fixes) R. Larocque
@ 2026-09-28 4:59 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2026-09-28 4:59 UTC (permalink / raw)
To: R. Larocque; +Cc: linux-input, dave.wang, jingle.wu, linux-kernel
Hi Raphaël,
On Tue, Sep 22, 2026 at 07:35:47PM -0400, R. Larocque wrote:
> From: "Raphaël Larocque" <rlarocque@disroot.org>
>
> elan_smbus_sleep_control() sends ETP_SMBUS_SLEEP_CMD to put the
> controller to sleep, but does nothing on wake, leaving a long-standing
> XXX comment questioning whether ETP_SMBUS_ENABLE_TP should be re-sent.
>
> elan_initialize() already treats sleep_control(client, false) as a
> genuine "wake device up" primitive (see the ASUS special-firmware
> branch and its accompanying dev_err() message), so this makes the
> non-ASUS/default path resend ETP_SMBUS_ENABLE_TP symmetrically with
> elan_smbus_initialize() instead of being a no-op.
>
> Signed-off-by: Raphaël Larocque <rlarocque@disroot.org>
> ---
> RFC: I don't have the Elan SMBus protocol datasheet and consequently
> haven't been able to test this on any real hardware where the previous no-op
> path was actually relied upon. Sending this for testing by
> someone with access to affected devices before it is considered for
> merge. A bad SMBus write to a sleeping controller could leave it
> in a weird state on the wrong firmware revision if unlucky.
I do not have objections in principle, but this really needs testing on
real hardware...
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-28 4:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-22 23:35 [RFC PATCH V2] Input: elan_i2c_smbus - resend ENABLE_TP on wake from sleep (NOT TESTED, NEEDS TESTER!) (v2: typo fixes) R. Larocque
2026-09-28 4:59 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®