@@ -235,12 +235,20 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata)
return 0;
cleanup:
- amd_sfh_hid_client_deinit(privdata);
for (i = 0; i < cl_data->num_hid_devices; i++) {
+ if (cl_data->sensor_sts[i] == SENSOR_ENABLED) {
+ mp2_ops->stop(privdata, cl_data->sensor_idx[i]);
+ status = amd_sfh_wait_for_response
+ (privdata, cl_data->sensor_idx[i], DISABLE_SENSOR);
+ cl_data->sensor_sts[i] = (status == 0) ? SENSOR_ENABLED : SENSOR_DISABLED;
+ }
+ if (cl_data->sensor_idx[i] == SRA_IDX)
+ continue;
devm_kfree(dev, cl_data->feature_report[i]);
devm_kfree(dev, in_data->input_report[i]);
devm_kfree(dev, cl_data->report_descr[i]);
}
+ amd_sfh_hid_client_deinit(privdata);
return rc;
}