Skip to contentSkip to conversation

AMD_SFH: Add a DMI quirk entry for Chromebooks

PATCH Superseded Akihiko Odaki 3 participants 3 messages Aug 16, 2022 – Aug 25, 2022

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 AMD_SFH: Add a DMI quirk entry for Chromebooks

Google Chromebooks use Chrome OS Embedded Controller Sensor Hub instead of Sensor Hub Fusion and leaves MP2 uninitialized, which disables all functionalities, even including the registers necessary for feature detections.

The behavior was observed with Lenovo ThinkPad C13 Yoga.

---
 drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +18 -0
index 4b90c86ee5f8..47774b9ab3de 100644
@@ -288,11 +288,29 @@ int amd_sfh_irq_init(struct amd_mp2_dev *privdata)
 	return 0;
 }
 
+static const struct dmi_system_id dmi_nodevs[] = {
+	{
+		/*
+		 * Google Chromebooks use Chrome OS Embedded Controller Sensor
+		 * Hub instead of Sensor Hub Fusion and leaves MP2
+		 * uninitialized, which disables all functionalities, even
+		 * including the registers necessary for feature detections.
+		 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Google"),
+		},
+	},
+	{ }
+};
+
 static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
 	struct amd_mp2_dev *privdata;
 	int rc;
 
+	if (dmi_first_match(dmi_nodevs))
+		return -ENODEV;
+
 	privdata = devm_kzalloc(&pdev->dev, sizeof(*privdata), GFP_KERNEL);
 	if (!privdata)
 		return -ENOMEM;
Signature · 1 line
2.37.2
Acked-by on v3 1/1
#1 lore raw
Quoted 37 lines · Akihiko Odaki

Google Chromebooks use Chrome OS Embedded Controller Sensor Hub instead of Sensor Hub Fusion and leaves MP2 uninitialized, which disables all functionalities, even including the registers necessary for feature detections.

The behavior was observed with Lenovo ThinkPad C13 Yoga.

---
 drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +15 -0
index 4b90c86ee5f8..47774b9ab3de 100644
@@ -288,11 +288,29 @@ int amd_sfh_irq_init(struct amd_mp2_dev *privdata)
 	return 0;
 }
 
+static const struct dmi_system_id dmi_nodevs[] = {
+	{
+		/*
+		 * Google Chromebooks use Chrome OS Embedded Controller Sensor
+		 * Hub instead of Sensor Hub Fusion and leaves MP2
+		 * uninitialized, which disables all functionalities, even
+		 * including the registers necessary for feature detections.
+		 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Google"),
+		},
+	},
+	{ }
+};
+
 static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)

drivers/hid/amd-sfh-hid/amd_sfh_pcie.c int amd_sfh_irq_init(struct amd_mp2_dev *privdata) · line 316

Quoted 10 lines
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +3 -0
 {
 	struct amd_mp2_dev *privdata;
 	int rc;
 
+	if (dmi_first_match(dmi_nodevs))
+		return -ENODEV;
+
 	privdata = devm_kzalloc(&pdev->dev, sizeof(*privdata), GFP_KERNEL);
 	if (!privdata)
 		return -ENOMEM;

Could you please prefix amd_sfh patches with 'HID: amd_sfh:' With that addressed,

Thanks,
--
Basavaraj

maintainer
#2 lore raw
Quoted 52 lines · Basavaraj Natikar
Quoted 37 lines · Akihiko Odaki

Google Chromebooks use Chrome OS Embedded Controller Sensor Hub instead of Sensor Hub Fusion and leaves MP2 uninitialized, which disables all functionalities, even including the registers necessary for feature detections.

The behavior was observed with Lenovo ThinkPad C13 Yoga.

---
 drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +15 -0
index 4b90c86ee5f8..47774b9ab3de 100644
@@ -288,11 +288,29 @@ int amd_sfh_irq_init(struct amd_mp2_dev *privdata)
 	return 0;
 }
 
+static const struct dmi_system_id dmi_nodevs[] = {
+	{
+		/*
+		 * Google Chromebooks use Chrome OS Embedded Controller Sensor
+		 * Hub instead of Sensor Hub Fusion and leaves MP2
+		 * uninitialized, which disables all functionalities, even
+		 * including the registers necessary for feature detections.
+		 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Google"),
+		},
+	},
+	{ }
+};
+
 static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)

drivers/hid/amd-sfh-hid/amd_sfh_pcie.c int amd_sfh_irq_init(struct amd_mp2_dev *privdata) · line 316

Quoted 10 lines
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +3 -0
 {
 	struct amd_mp2_dev *privdata;
 	int rc;
 
+	if (dmi_first_match(dmi_nodevs))
+		return -ENODEV;
+
 	privdata = devm_kzalloc(&pdev->dev, sizeof(*privdata), GFP_KERNEL);
 	if (!privdata)
 		return -ENOMEM;

Could you please prefix amd_sfh patches with 'HID: amd_sfh:' With that addressed,

Quoted 1 line

I have fixed that up and applied. Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs