Skip to content

Commit ac15e91

Browse files
basuamdJiri Kosina
authored andcommitted
HID: amd_sfh: Move hid probe after sensor is enabled
Earlier platforms don’t have sensor status checking mechanism. Sensors are always enabled without checking sensor status. Hence invoke hid probe only after the sensor is enabled by checking sensor status. Reviewed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 173709f commit ac15e91

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

drivers/hid/amd-sfh-hid/amd_sfh_client.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,16 +205,23 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata)
205205
goto cleanup;
206206
}
207207
rc = get_report_descriptor(cl_idx, cl_data->report_descr[i]);
208-
if (rc)
209-
return rc;
210-
rc = amdtp_hid_probe(cl_data->cur_hid_dev, cl_data);
211208
if (rc)
212209
return rc;
213210
privdata->mp2_ops->start(privdata, info);
214211
status = amd_sfh_wait_for_response
215212
(privdata, cl_data->sensor_idx[i], SENSOR_ENABLED);
216-
if (status == SENSOR_ENABLED)
213+
if (status == SENSOR_ENABLED) {
217214
cl_data->sensor_sts[i] = SENSOR_ENABLED;
215+
rc = amdtp_hid_probe(cl_data->cur_hid_dev, cl_data);
216+
if (rc) {
217+
privdata->mp2_ops->stop(privdata, cl_data->sensor_idx[i]);
218+
status = amd_sfh_wait_for_response
219+
(privdata, cl_data->sensor_idx[i], SENSOR_DISABLED);
220+
if (status != SENSOR_ENABLED)
221+
cl_data->sensor_sts[i] = SENSOR_DISABLED;
222+
goto cleanup;
223+
}
224+
}
218225
}
219226
schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP));
220227
return 0;

0 commit comments

Comments
 (0)