mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
HID: amd_sfh: Handle "no sensors" in PM operations
[ Upstream commit077e3e3bc8
] Resume or suspend each sensor device based on the num_hid_devices. Therefore, add a check to handle the special case where no sensors are present. Fixes:93ce5e0231
("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
5bd3880e86
commit
673b92ef42
@ -227,6 +227,11 @@ static void amd_sfh_resume(struct amd_mp2_dev *mp2)
|
||||
struct amd_mp2_sensor_info info;
|
||||
int i, status;
|
||||
|
||||
if (!cl_data->is_any_sensor_enabled) {
|
||||
amd_sfh_clear_intr(mp2);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < cl_data->num_hid_devices; i++) {
|
||||
if (cl_data->sensor_sts[i] == SENSOR_DISABLED) {
|
||||
info.sensor_idx = cl_data->sensor_idx[i];
|
||||
@ -252,6 +257,11 @@ static void amd_sfh_suspend(struct amd_mp2_dev *mp2)
|
||||
struct amdtp_cl_data *cl_data = mp2->cl_data;
|
||||
int i, status;
|
||||
|
||||
if (!cl_data->is_any_sensor_enabled) {
|
||||
amd_sfh_clear_intr(mp2);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < cl_data->num_hid_devices; i++) {
|
||||
if (cl_data->sensor_idx[i] != HPD_IDX &&
|
||||
cl_data->sensor_sts[i] == SENSOR_ENABLED) {
|
||||
|
Loading…
Reference in New Issue
Block a user