Linux Input/HID development
 help / color / mirror / Atom feed
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
To: jikos@kernel.org, benjamin.tissoires@redhat.com
Cc: "Kai-Heng Feng" <kai.heng.feng@canonical.com>,
	"Douglas Anderson" <dianders@chromium.org>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	"Johan Hovold" <johan+linaro@kernel.org>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] HID: i2c-hid: Remove SET_POWER SLEEP on system suspend
Date: Wed,  3 Jan 2024 08:33:53 +0800	[thread overview]
Message-ID: <20240103003355.747335-1-kai.heng.feng@canonical.com> (raw)

There's a Cirque touchpad that wakes system up without anything touched
the touchpad. The input report is empty when this happens.
The reason is stated in HID over I2C spec, 7.2.8.2:
"If the DEVICE wishes to wake the HOST from its low power state, it can
issue a wake by asserting the interrupt."

This is fine if OS can put system back to suspend by identifying input
wakeup count stays the same on resume, like Chrome OS Dark Resume [0].
But for regular distro such policy is lacking.

According to commit d9f448e3d71f ("HID: i2c-hid: set power sleep before
shutdown"), SLEEP is required for shutdown, in addition to that, commit
67b18dfb8cfc ("HID: i2c-hid: Remove runtime power management") didn't
notice any power comsumption reduction from SET_POWER SLEEP, so also
remove that to avoid the device asserting the interrupt.

[0] https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/power_manager/docs/dark_resume.md

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 drivers/hid/i2c-hid/i2c-hid-core.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
index 2735cd585af0..dd513dc75cb9 100644
--- a/drivers/hid/i2c-hid/i2c-hid-core.c
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
@@ -957,9 +957,6 @@ static int i2c_hid_core_suspend(struct i2c_hid *ihid, bool force_poweroff)
 	if (ret < 0)
 		return ret;
 
-	/* Save some power */
-	i2c_hid_set_power(ihid, I2C_HID_PWR_SLEEP);
-
 	disable_irq(client->irq);
 
 	if (force_poweroff || !device_may_wakeup(&client->dev))
-- 
2.34.1


             reply	other threads:[~2024-01-03  0:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-03  0:33 Kai-Heng Feng [this message]
2024-01-08 21:24 ` [PATCH] HID: i2c-hid: Remove SET_POWER SLEEP on system suspend Doug Anderson
2024-01-10  7:31   ` Kai-Heng Feng
2024-01-10 18:34     ` Doug Anderson

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=20240103003355.747335-1-kai.heng.feng@canonical.com \
    --to=kai.heng.feng@canonical.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dianders@chromium.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jikos@kernel.org \
    --cc=johan+linaro@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=mripard@kernel.org \
    /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