Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "R. Larocque" <rlarocque@disroot.org>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [RFC PATCH V2] Input: elan_i2c_smbus - resend ENABLE_TP on wake from sleep (NOT TESTED, NEEDS TESTER!) (v2: typo fixes)
Date: Tue, 22 Sep 2026 23:45:10 +0000	[thread overview]
Message-ID: <20260922234511.5D23B1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260922233549.10431-1-rlarocque@disroot.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] input: elan_i2c: ENABLE_TP command sent after set_mode() may clobber absolute mode
--

commit 37faf4759d30c6532910d41f48a2708415776398
Author: Raphaël Larocque <rlarocque@disroot.org>
Input: elan_i2c_smbus - resend ENABLE_TP on wake from sleep (NOT TESTED, NEEDS TESTER!) (v2: typo fixes)

This commit updates elan_smbus_sleep_control() to resend the
ETP_SMBUS_ENABLE_TP command when waking the controller from sleep.

> diff --git a/drivers/input/mouse/elan_i2c_smbus.c b/drivers/input/mouse/elan_i2c_smbus.c
> index 0287441cda46d..dd86bd1739c55 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)
>  {
[ ... ]
> +	/*
> +	 * 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);

[Severity: Medium]
Could this clobber the absolute mode configuration for non-ASUS devices?

Looking at __elan_initialize() in drivers/input/mouse/elan_i2c_core.c,
non-ASUS devices first configure absolute mode via set_mode(), and then
call sleep_control() to wake the device:

	data->mode |= ETP_ENABLE_ABS;
	error = data->ops->set_mode(client, data->mode);
	if (error) {
		...
	}

	if (!woken_up) {
		error = data->ops->sleep_control(client, false);
		...
	}

Since this patch now sends ETP_SMBUS_ENABLE_TP in sleep_control() on
wake, it gets transmitted after set_mode() for these non-ASUS devices.
Could sending this command after configuring absolute mode reset the
hardware to its default relative mode, breaking absolute touch reporting?

> +	if (error) {
> +		dev_err(&client->dev,
> +			"failed to re-enable touchpad after wake: %d\n",
> +			error);
> +		return error;
> +	}
> +
> +	return 0;
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260922233549.10431-1-rlarocque@disroot.org?part=1

  reply	other threads:[~2026-09-22 23:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-22 23:45 ` sashiko-bot [this message]
2026-09-28  4:59 ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260922234511.5D23B1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=rlarocque@disroot.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox