* [PATCH] Hid: Intel-thc-hid: Intel-quickspi: Improve power management for touch devices
@ 2026-03-18 3:25 Even Xu
2026-03-27 12:32 ` Jiri Kosina
0 siblings, 1 reply; 2+ messages in thread
From: Even Xu @ 2026-03-18 3:25 UTC (permalink / raw)
To: bentiss, jikos
Cc: srinivas.pandruvada, linux-input, linux-kernel, Even Xu,
Rui Zhang
Enhance power management with two key improvements:
1. Hibernate support: Send POWER_OFF command when entering hibernate
mode.
2. Conditional sleep commands: Only send POWER_SLEEP/POWER_ON commands
during system suspend/resume when the touch device is not configured
as a wake source, preserving Wake-on-Touch (WoT) functionality. This
ensures proper power states while maintaining expected wake behavior.
Signed-off-by: Even Xu <even.xu@intel.com>
Tested-by: Rui Zhang <rui1.zhang@intel.com>
---
.../intel-thc-hid/intel-quickspi/pci-quickspi.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
index b6a69995692c..f669235f1883 100644
--- a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
+++ b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
@@ -753,9 +753,11 @@ static int quickspi_suspend(struct device *device)
if (!qsdev)
return -ENODEV;
- ret = quickspi_set_power(qsdev, HIDSPI_SLEEP);
- if (ret)
- return ret;
+ if (!device_may_wakeup(qsdev->dev)) {
+ ret = quickspi_set_power(qsdev, HIDSPI_SLEEP);
+ if (ret)
+ return ret;
+ }
ret = thc_interrupt_quiesce(qsdev->thc_hw, true);
if (ret)
@@ -794,9 +796,8 @@ static int quickspi_resume(struct device *device)
if (ret)
return ret;
- ret = quickspi_set_power(qsdev, HIDSPI_ON);
- if (ret)
- return ret;
+ if (!device_may_wakeup(qsdev->dev))
+ return quickspi_set_power(qsdev, HIDSPI_ON);
return 0;
}
@@ -855,6 +856,9 @@ static int quickspi_poweroff(struct device *device)
if (!qsdev)
return -ENODEV;
+ /* Ignore the return value as platform will be poweroff soon */
+ quickspi_set_power(qsdev, HIDSPI_OFF);
+
ret = thc_interrupt_quiesce(qsdev->thc_hw, true);
if (ret)
return ret;
--
2.40.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Hid: Intel-thc-hid: Intel-quickspi: Improve power management for touch devices
2026-03-18 3:25 [PATCH] Hid: Intel-thc-hid: Intel-quickspi: Improve power management for touch devices Even Xu
@ 2026-03-27 12:32 ` Jiri Kosina
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2026-03-27 12:32 UTC (permalink / raw)
To: Even Xu; +Cc: bentiss, srinivas.pandruvada, linux-input, linux-kernel,
Rui Zhang
On Wed, 18 Mar 2026, Even Xu wrote:
> Enhance power management with two key improvements:
> 1. Hibernate support: Send POWER_OFF command when entering hibernate
> mode.
> 2. Conditional sleep commands: Only send POWER_SLEEP/POWER_ON commands
> during system suspend/resume when the touch device is not configured
> as a wake source, preserving Wake-on-Touch (WoT) functionality. This
> ensures proper power states while maintaining expected wake behavior.
>
> Signed-off-by: Even Xu <even.xu@intel.com>
> Tested-by: Rui Zhang <rui1.zhang@intel.com>
Applied to hid.git#for-7.1/intel-thc, thanks.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-27 12:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-18 3:25 [PATCH] Hid: Intel-thc-hid: Intel-quickspi: Improve power management for touch devices Even Xu
2026-03-27 12:32 ` Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox