Skip to content

Commit

Permalink
HID: amd_sfh: Correct the sensor enable and disable command
Browse files Browse the repository at this point in the history
[ Upstream commit 0b9255b ]

In order to start or stop sensors, the firmware command needs to be
changed to add an additional default subcommand value. For this reason,
add a subcommand value to enable or disable sensors accordingly.

Fixes: 93ce5e0 ("HID: amd_sfh: Implement SFH1.1 functionality")
Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Basavaraj Natikar authored and gregkh committed May 11, 2023
1 parent eb8c6b5 commit dfa2769
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ static void amd_start_sensor(struct amd_mp2_dev *privdata, struct amd_mp2_sensor
cmd_base.ul = 0;
cmd_base.cmd.cmd_id = ENABLE_SENSOR;
cmd_base.cmd.intr_disable = 0;
cmd_base.cmd.sub_cmd_value = 1;
cmd_base.cmd.sensor_id = info.sensor_idx;

writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG(0));
Expand All @@ -45,6 +46,7 @@ static void amd_stop_sensor(struct amd_mp2_dev *privdata, u16 sensor_idx)
cmd_base.ul = 0;
cmd_base.cmd.cmd_id = DISABLE_SENSOR;
cmd_base.cmd.intr_disable = 0;
cmd_base.cmd.sub_cmd_value = 1;
cmd_base.cmd.sensor_id = sensor_idx;

writeq(0x0, privdata->mmio + AMD_C2P_MSG(1));
Expand Down

0 comments on commit dfa2769

Please sign in to comment.