mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-06 13:16:22 +00:00
HID: amd_sfh: Avoid disabling the interrupt
[ Upstream commitc1db007321
] HP ProBook x360 435 G7 using older version of firmware which doesn't support disabling the interrupt for all commands. Hence avoid disabling the interrupt for that particular model. Link: https://bugzilla.kernel.org/show_bug.cgi?id=218104 Fixes:b300667b33
("HID: amd_sfh: Disable the interrupt for all command") Co-developed-by: Akshata MukundShetty <akshata.mukundshetty@amd.com> Signed-off-by: Akshata MukundShetty <akshata.mukundshetty@amd.com> Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
c6a05e45de
commit
fcb7e70482
@ -34,6 +34,8 @@ static int sensor_mask_override = -1;
|
||||
module_param_named(sensor_mask, sensor_mask_override, int, 0444);
|
||||
MODULE_PARM_DESC(sensor_mask, "override the detected sensors mask");
|
||||
|
||||
static bool intr_disable = true;
|
||||
|
||||
static int amd_sfh_wait_response_v2(struct amd_mp2_dev *mp2, u8 sid, u32 sensor_sts)
|
||||
{
|
||||
union cmd_response cmd_resp;
|
||||
@ -54,7 +56,7 @@ static void amd_start_sensor_v2(struct amd_mp2_dev *privdata, struct amd_mp2_sen
|
||||
|
||||
cmd_base.ul = 0;
|
||||
cmd_base.cmd_v2.cmd_id = ENABLE_SENSOR;
|
||||
cmd_base.cmd_v2.intr_disable = 1;
|
||||
cmd_base.cmd_v2.intr_disable = intr_disable;
|
||||
cmd_base.cmd_v2.period = info.period;
|
||||
cmd_base.cmd_v2.sensor_id = info.sensor_idx;
|
||||
cmd_base.cmd_v2.length = 16;
|
||||
@ -72,7 +74,7 @@ static void amd_stop_sensor_v2(struct amd_mp2_dev *privdata, u16 sensor_idx)
|
||||
|
||||
cmd_base.ul = 0;
|
||||
cmd_base.cmd_v2.cmd_id = DISABLE_SENSOR;
|
||||
cmd_base.cmd_v2.intr_disable = 1;
|
||||
cmd_base.cmd_v2.intr_disable = intr_disable;
|
||||
cmd_base.cmd_v2.period = 0;
|
||||
cmd_base.cmd_v2.sensor_id = sensor_idx;
|
||||
cmd_base.cmd_v2.length = 16;
|
||||
@ -86,7 +88,7 @@ static void amd_stop_all_sensor_v2(struct amd_mp2_dev *privdata)
|
||||
union sfh_cmd_base cmd_base;
|
||||
|
||||
cmd_base.cmd_v2.cmd_id = STOP_ALL_SENSORS;
|
||||
cmd_base.cmd_v2.intr_disable = 1;
|
||||
cmd_base.cmd_v2.intr_disable = intr_disable;
|
||||
cmd_base.cmd_v2.period = 0;
|
||||
cmd_base.cmd_v2.sensor_id = 0;
|
||||
|
||||
@ -288,6 +290,26 @@ int amd_sfh_irq_init(struct amd_mp2_dev *privdata)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mp2_disable_intr(const struct dmi_system_id *id)
|
||||
{
|
||||
intr_disable = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct dmi_system_id dmi_sfh_table[] = {
|
||||
{
|
||||
/*
|
||||
* https://bugzilla.kernel.org/show_bug.cgi?id=218104
|
||||
*/
|
||||
.callback = mp2_disable_intr,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "HP ProBook x360 435 G7"),
|
||||
},
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
static const struct dmi_system_id dmi_nodevs[] = {
|
||||
{
|
||||
/*
|
||||
@ -311,6 +333,8 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
|
||||
if (dmi_first_match(dmi_nodevs))
|
||||
return -ENODEV;
|
||||
|
||||
dmi_check_system(dmi_sfh_table);
|
||||
|
||||
privdata = devm_kzalloc(&pdev->dev, sizeof(*privdata), GFP_KERNEL);
|
||||
if (!privdata)
|
||||
return -ENOMEM;
|
||||
|
Loading…
Reference in New Issue
Block a user