Skip to content

Commit 25615e4

Browse files
jwrdegoedeJiri Kosina
authored andcommitted
AMD_SFH: Add DMI quirk table for BIOS-es which don't set the activestatus bits
Some BIOS-es do not initialize the activestatus bits of the AMD_P2C_MSG3 register. This cause the AMD_SFH driver to not register any sensors even though the laptops in question do have sensors. Add a DMI quirk-table for specifying sensor-mask overrides based on DMI match, to make the sensors work OOTB on these laptop models. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199715 BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1651886 Fixes: 4f567b9 ("SFH: PCIe driver to add support of AMD sensor fusion hub") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Sandeep Singh <sandeep.singh@amd.com Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 952f7d1 commit 25615e4

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

drivers/hid/amd-sfh-hid/amd_sfh_pcie.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/bitops.h>
1111
#include <linux/delay.h>
1212
#include <linux/dma-mapping.h>
13+
#include <linux/dmi.h>
1314
#include <linux/interrupt.h>
1415
#include <linux/io-64-nonatomic-lo-hi.h>
1516
#include <linux/module.h>
@@ -77,11 +78,34 @@ void amd_stop_all_sensors(struct amd_mp2_dev *privdata)
7778
writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0);
7879
}
7980

81+
static const struct dmi_system_id dmi_sensor_mask_overrides[] = {
82+
{
83+
.matches = {
84+
DMI_MATCH(DMI_PRODUCT_NAME, "HP ENVY x360 Convertible 13-ag0xxx"),
85+
},
86+
.driver_data = (void *)(ACEL_EN | MAGNO_EN),
87+
},
88+
{
89+
.matches = {
90+
DMI_MATCH(DMI_PRODUCT_NAME, "HP ENVY x360 Convertible 15-cp0xxx"),
91+
},
92+
.driver_data = (void *)(ACEL_EN | MAGNO_EN),
93+
},
94+
{ }
95+
};
96+
8097
int amd_mp2_get_sensor_num(struct amd_mp2_dev *privdata, u8 *sensor_id)
8198
{
8299
int activestatus, num_of_sensors = 0;
100+
const struct dmi_system_id *dmi_id;
83101
u32 activecontrolstatus;
84102

103+
if (sensor_mask_override == -1) {
104+
dmi_id = dmi_first_match(dmi_sensor_mask_overrides);
105+
if (dmi_id)
106+
sensor_mask_override = (long)dmi_id->driver_data;
107+
}
108+
85109
if (sensor_mask_override >= 0) {
86110
activestatus = sensor_mask_override;
87111
} else {

0 commit comments

Comments
 (0)