summaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorBasavaraj Natikar <Basavaraj.Natikar@amd.com>2022-02-08 17:51:08 +0530
committerJiri Kosina <jkosina@suse.cz>2022-02-14 16:28:51 +0100
commit0cf74235f4403b760a37f77271d2ca3424001ff9 (patch)
tree4291e33f2d79d3eb48162334d9438f797bc2c638 /drivers/hid
parentfd5dd6acd8f823ea804f76d3af64fa1be9d5fb78 (diff)
downloadlinux-0cf74235f4403b760a37f77271d2ca3424001ff9.tar.gz
linux-0cf74235f4403b760a37f77271d2ca3424001ff9.tar.xz
HID: amd_sfh: Handle amd_sfh work buffer in PM ops
Since in the current amd_sfh design the sensor data is periodically obtained in the form of poll data, during the suspend/resume cycle, scheduling a delayed work adds no value. So, cancel the work and restart back during the suspend/resume cycle respectively. Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/amd-sfh-hid/amd_sfh_pcie.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
index d3f32ffe299a..dacac30a6b27 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
@@ -290,6 +290,8 @@ static int __maybe_unused amd_mp2_pci_resume(struct device *dev)
}
}
+ schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP));
+
return 0;
}
@@ -312,6 +314,8 @@ static int __maybe_unused amd_mp2_pci_suspend(struct device *dev)
}
}
+ cancel_delayed_work_sync(&cl_data->work_buffer);
+
return 0;
}