Skip to content

Commit f38b91f

Browse files
superm1gregkh
authored andcommitted
HID: amd_sfh: Stop sensor before starting
[ Upstream commit 4d3a13a ] Titas reports that the accelerometer sensor on their laptop only works after a warm boot or unloading/reloading the amd-sfh kernel module. Presumably the sensor is in a bad state on cold boot and failing to start, so explicitly stop it before starting. Cc: stable@vger.kernel.org Fixes: 93ce5e0 ("HID: amd_sfh: Implement SFH1.1 functionality") Reported-by: Titas <novatitas366@gmail.com> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220670 Tested-by: Titas <novatitas366@gmail.com> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: Jiri Kosina <jkosina@suse.com> [ Adjust context ] Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4948db9 commit f38b91f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata)
163163
if (rc)
164164
goto cleanup;
165165

166+
mp2_ops->stop(privdata, cl_data->sensor_idx[i]);
167+
amd_sfh_wait_for_response(privdata, cl_data->sensor_idx[i], DISABLE_SENSOR);
166168
writel(0, privdata->mmio + AMD_P2C_MSG(0));
167169
mp2_ops->start(privdata, info);
168170
status = amd_sfh_wait_for_response

0 commit comments

Comments
 (0)