summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Xu <even.xu@intel.com>2026-03-18 06:25:47 +0300
committerJiri Kosina <jkosina@suse.com>2026-03-27 15:30:40 +0300
commit4ba38ee380555a5aeb4291d5111faaf7852d63bd (patch)
treefcf0bde9ae07496aa2f6938116f4a72b157914ba
parentf0caa1d49cc07b30a7e2f104d3853ec6dc1c3cad (diff)
downloadlinux-4ba38ee380555a5aeb4291d5111faaf7852d63bd.tar.xz
HID: intel-thc-hid: Intel-quickspi: Improve power management for touch devices
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> Signed-off-by: Jiri Kosina <jkosina@suse.com>
-rw-r--r--drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c16
1 files 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 ad6bd59963b2..4c64994e4215 100644
--- a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
+++ b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
@@ -749,9 +749,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)
@@ -790,9 +792,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;
}
@@ -851,6 +852,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;