summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorMario Limonciello (AMD) <superm1@kernel.org>2025-11-24 09:54:31 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-12-01 11:41:53 +0100
commitf38b91f7adedf9250167de1d6c7e358a56f3eee0 (patch)
treea9b6414a5d4cbbd9d89d1b0b518b96f2ab5dca7c /drivers/hid
parent4948db9c9ca8be8fbe8e8d8f6d24c1384ef677d8 (diff)
downloadlinux-f38b91f7adedf9250167de1d6c7e358a56f3eee0.tar.gz
linux-f38b91f7adedf9250167de1d6c7e358a56f3eee0.tar.bz2
linux-f38b91f7adedf9250167de1d6c7e358a56f3eee0.zip
HID: amd_sfh: Stop sensor before starting
[ Upstream commit 4d3a13afa8b64dc49293b3eab3e7beac11072c12 ] 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: 93ce5e0231d79 ("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>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c
index 862ca8d07232..e2047ef864eb 100644
--- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c
+++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c
@@ -163,6 +163,8 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata)
if (rc)
goto cleanup;
+ mp2_ops->stop(privdata, cl_data->sensor_idx[i]);
+ amd_sfh_wait_for_response(privdata, cl_data->sensor_idx[i], DISABLE_SENSOR);
writel(0, privdata->mmio + AMD_P2C_MSG(0));
mp2_ops->start(privdata, info);
status = amd_sfh_wait_for_response