mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] HID: Intel-thc-hid: Intel-quicki2c: Add power management for touch device
@ 2025-12-22  1:41 Even Xu
  2026-01-07 21:04 ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Even Xu @ 2025-12-22  1:41 UTC (permalink / raw)
  To: bentiss, jikos; +Cc: srinivas.pandruvada, linux-input, linux-kernel, Even Xu

Send POWER_SLEEP command to touch device when system enters into sleep
mode or hibernate mode to save more power; and send POWER_ON command to
take device back when system exits sleep mode.

Signed-off-by: Even Xu <even.xu@intel.com>
---
 .../intel-thc-hid/intel-quicki2c/pci-quicki2c.c    | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c b/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c
index 0156ab391778..c9fb7f71942f 100644
--- a/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c
+++ b/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c
@@ -809,6 +809,12 @@ static int quicki2c_suspend(struct device *device)
 	if (!qcdev)
 		return -ENODEV;
 
+	if (!device_may_wakeup(qcdev->dev)) {
+		ret = quicki2c_set_power(qcdev, HIDI2C_SLEEP);
+		if (ret)
+			return ret;
+	}
+
 	/*
 	 * As I2C is THC subsystem, no register auto save/restore support,
 	 * need driver to do that explicitly for every D3 case.
@@ -858,6 +864,9 @@ static int quicki2c_resume(struct device *device)
 	if (ret)
 		return ret;
 
+	if (!device_may_wakeup(qcdev->dev))
+		return quicki2c_set_power(qcdev, HIDI2C_ON);
+
 	return 0;
 }
 
@@ -915,6 +924,9 @@ static int quicki2c_poweroff(struct device *device)
 	if (!qcdev)
 		return -ENODEV;
 
+	/* Ignore the return value as platform will be poweroff soon */
+	quicki2c_set_power(qcdev, HIDI2C_SLEEP);
+
 	ret = thc_interrupt_quiesce(qcdev->thc_hw, true);
 	if (ret)
 		return ret;
@@ -968,7 +980,7 @@ static int quicki2c_restore(struct device *device)
 
 	thc_change_ltr_mode(qcdev->thc_hw, THC_LTR_MODE_ACTIVE);
 
-	return 0;
+	return quicki2c_set_power(qcdev, HIDI2C_ON);
 }
 
 static int quicki2c_runtime_suspend(struct device *device)
-- 
2.40.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] HID: Intel-thc-hid: Intel-quicki2c: Add power management for touch device
  2025-12-22  1:41 [PATCH] HID: Intel-thc-hid: Intel-quicki2c: Add power management for touch device Even Xu
@ 2026-01-07 21:04 ` Jiri Kosina
  2026-01-07 23:59   ` Xu, Even
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Kosina @ 2026-01-07 21:04 UTC (permalink / raw)
  To: Even Xu; +Cc: bentiss, srinivas.pandruvada, linux-input, linux-kernel

On Mon, 22 Dec 2025, Even Xu wrote:

> Send POWER_SLEEP command to touch device when system enters into sleep
> mode or hibernate mode to save more power; and send POWER_ON command to
> take device back when system exits sleep mode.
> 
> Signed-off-by: Even Xu <even.xu@intel.com>

Applied on top of hid.git#for-6.20/intel-thc, thank you.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] HID: Intel-thc-hid: Intel-quicki2c: Add power management for touch device
  2026-01-07 21:04 ` Jiri Kosina
@ 2026-01-07 23:59   ` Xu, Even
  0 siblings, 0 replies; 3+ messages in thread
From: Xu, Even @ 2026-01-07 23:59 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: bentiss, srinivas.pandruvada, linux-input, linux-kernel

Thanks Jiri and Happy New Year!!!

Best Regards,
Even Xu

> -----Original Message-----
> From: Jiri Kosina <jikos@kernel.org>
> Sent: Thursday, January 8, 2026 5:05 AM
> To: Xu, Even <even.xu@intel.com>
> Cc: bentiss@kernel.org; srinivas.pandruvada@linux.intel.com; linux-
> input@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] HID: Intel-thc-hid: Intel-quicki2c: Add power management
> for touch device
> 
> On Mon, 22 Dec 2025, Even Xu wrote:
> 
> > Send POWER_SLEEP command to touch device when system enters into sleep
> > mode or hibernate mode to save more power; and send POWER_ON command
> > to take device back when system exits sleep mode.
> >
> > Signed-off-by: Even Xu <even.xu@intel.com>
> 
> Applied on top of hid.git#for-6.20/intel-thc, thank you.
> 
> --
> Jiri Kosina
> SUSE Labs


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-07 23:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-22  1:41 [PATCH] HID: Intel-thc-hid: Intel-quicki2c: Add power management for touch device Even Xu
2026-01-07 21:04 ` Jiri Kosina
2026-01-07 23:59   ` Xu, Even

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®