Skip to content

Commit 19b60ac

Browse files
basuamdJiri Kosina
authored andcommitted
HID: amd_sfh: Split sensor and HID initialization for SFH1.1
Sensors are enabled independently of HID device initialization. Sensor initialization should be kept separate in this case, while HID devices should be initialized according to the sensor state. Hence split sensor initialization and HID initialization for SFH1.1 into separate blocks. Signed-off-by: Basavaraj Natikar <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent c0709c6 commit 19b60ac

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,16 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata)
168168
status = amd_sfh_wait_for_response
169169
(privdata, cl_data->sensor_idx[i], ENABLE_SENSOR);
170170

171-
status = (status == 0) ? SENSOR_ENABLED : SENSOR_DISABLED;
171+
cl_data->sensor_sts[i] = (status == 0) ? SENSOR_ENABLED : SENSOR_DISABLED;
172+
}
172173

173-
if (status == SENSOR_ENABLED) {
174+
for (i = 0; i < cl_data->num_hid_devices; i++) {
175+
cl_data->cur_hid_dev = i;
176+
if (cl_data->sensor_sts[i] == SENSOR_ENABLED) {
174177
cl_data->is_any_sensor_enabled = true;
175-
cl_data->sensor_sts[i] = SENSOR_ENABLED;
176178
rc = amdtp_hid_probe(i, cl_data);
177179
if (rc)
178180
goto cleanup;
179-
} else {
180-
cl_data->sensor_sts[i] = SENSOR_DISABLED;
181181
}
182182
dev_dbg(dev, "sid 0x%x (%s) status 0x%x\n",
183183
cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]),

0 commit comments

Comments
 (0)