Skip to content

Commit

Permalink
(surface3-oemb) add DMI matches for Surface 3 with broken DMI table
Browse files Browse the repository at this point in the history
On some Surface 3, the DMI table gets corrupted for unknown reasons
and breaks existing DMI matching used for device-specific quirks.

This commit adds the (broken) DMI data into dmi_system_id tables used
for quirks so that each driver can enable quirks even on the affected
systems.

On affected systems, DMI data will look like this:
    $ grep . /sys/devices/virtual/dmi/id/{bios_vendor,board_name,board_vendor,\
    chassis_vendor,product_name,sys_vendor}
    /sys/devices/virtual/dmi/id/bios_vendor:American Megatrends Inc.
    /sys/devices/virtual/dmi/id/board_name:OEMB
    /sys/devices/virtual/dmi/id/board_vendor:OEMB
    /sys/devices/virtual/dmi/id/chassis_vendor:OEMB
    /sys/devices/virtual/dmi/id/product_name:OEMB
    /sys/devices/virtual/dmi/id/sys_vendor:OEMB

Expected:
    $ grep . /sys/devices/virtual/dmi/id/{bios_vendor,board_name,board_vendor,\
    chassis_vendor,product_name,sys_vendor}
    /sys/devices/virtual/dmi/id/bios_vendor:American Megatrends Inc.
    /sys/devices/virtual/dmi/id/board_name:Surface 3
    /sys/devices/virtual/dmi/id/board_vendor:Microsoft Corporation
    /sys/devices/virtual/dmi/id/chassis_vendor:Microsoft Corporation
    /sys/devices/virtual/dmi/id/product_name:Surface 3
    /sys/devices/virtual/dmi/id/sys_vendor:Microsoft Corporation

Signed-off-by: Tsuchiya Yuto <kitakar@gmail.com>
Patchset: surface3-oemb
  • Loading branch information
kitakar5525 authored and qzed committed Oct 14, 2022
1 parent 409b53c commit 1b2da72
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/platform/surface/surface3-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ static const struct dmi_system_id surface3_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"),
},
},
{
.matches = {
DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
DMI_MATCH(DMI_SYS_VENDOR, "OEMB"),
DMI_MATCH(DMI_PRODUCT_NAME, "OEMB"),
},
},
#endif
{ }
};
Expand Down
9 changes: 9 additions & 0 deletions sound/soc/codecs/rt5645.c
Original file line number Diff line number Diff line change
Expand Up @@ -3717,6 +3717,15 @@ static const struct dmi_system_id dmi_platform_data[] = {
},
.driver_data = (void *)&intel_braswell_platform_data,
},
{
.ident = "Microsoft Surface 3",
.matches = {
DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
DMI_MATCH(DMI_SYS_VENDOR, "OEMB"),
DMI_MATCH(DMI_PRODUCT_NAME, "OEMB"),
},
.driver_data = (void *)&intel_braswell_platform_data,
},
{
/*
* Match for the GPDwin which unfortunately uses somewhat
Expand Down
8 changes: 8 additions & 0 deletions sound/soc/intel/common/soc-acpi-intel-cht-match.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ static const struct dmi_system_id cht_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"),
},
},
{
.callback = cht_surface_quirk_cb,
.matches = {
DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
DMI_MATCH(DMI_SYS_VENDOR, "OEMB"),
DMI_MATCH(DMI_PRODUCT_NAME, "OEMB"),
},
},
{ }
};

Expand Down

0 comments on commit 1b2da72

Please sign in to comment.