0001-surface3-oemb.patch 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. From 212c5559ce9393295461b2872db2b058924a1079 Mon Sep 17 00:00:00 2001
  2. From: Tsuchiya Yuto <kitakar@gmail.com>
  3. Date: Sun, 18 Oct 2020 16:42:44 +0900
  4. Subject: [PATCH] (surface3-oemb) add DMI matches for Surface 3 with broken DMI
  5. table
  6. On some Surface 3, the DMI table gets corrupted for unknown reasons
  7. and breaks existing DMI matching used for device-specific quirks.
  8. This commit adds the (broken) DMI data into dmi_system_id tables used
  9. for quirks so that each driver can enable quirks even on the affected
  10. systems.
  11. On affected systems, DMI data will look like this:
  12. $ grep . /sys/devices/virtual/dmi/id/{bios_vendor,board_name,board_vendor,\
  13. chassis_vendor,product_name,sys_vendor}
  14. /sys/devices/virtual/dmi/id/bios_vendor:American Megatrends Inc.
  15. /sys/devices/virtual/dmi/id/board_name:OEMB
  16. /sys/devices/virtual/dmi/id/board_vendor:OEMB
  17. /sys/devices/virtual/dmi/id/chassis_vendor:OEMB
  18. /sys/devices/virtual/dmi/id/product_name:OEMB
  19. /sys/devices/virtual/dmi/id/sys_vendor:OEMB
  20. Expected:
  21. $ grep . /sys/devices/virtual/dmi/id/{bios_vendor,board_name,board_vendor,\
  22. chassis_vendor,product_name,sys_vendor}
  23. /sys/devices/virtual/dmi/id/bios_vendor:American Megatrends Inc.
  24. /sys/devices/virtual/dmi/id/board_name:Surface 3
  25. /sys/devices/virtual/dmi/id/board_vendor:Microsoft Corporation
  26. /sys/devices/virtual/dmi/id/chassis_vendor:Microsoft Corporation
  27. /sys/devices/virtual/dmi/id/product_name:Surface 3
  28. /sys/devices/virtual/dmi/id/sys_vendor:Microsoft Corporation
  29. Signed-off-by: Tsuchiya Yuto <kitakar@gmail.com>
  30. Patchset: surface3-oemb
  31. ---
  32. drivers/platform/surface/surface3-wmi.c | 7 +++++++
  33. sound/soc/codecs/rt5645.c | 9 +++++++++
  34. sound/soc/intel/common/soc-acpi-intel-cht-match.c | 8 ++++++++
  35. 3 files changed, 24 insertions(+)
  36. diff --git a/drivers/platform/surface/surface3-wmi.c b/drivers/platform/surface/surface3-wmi.c
  37. index ca4602bcc7de..490b9731068a 100644
  38. --- a/drivers/platform/surface/surface3-wmi.c
  39. +++ b/drivers/platform/surface/surface3-wmi.c
  40. @@ -37,6 +37,13 @@ static const struct dmi_system_id surface3_dmi_table[] = {
  41. DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"),
  42. },
  43. },
  44. + {
  45. + .matches = {
  46. + DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
  47. + DMI_MATCH(DMI_SYS_VENDOR, "OEMB"),
  48. + DMI_MATCH(DMI_PRODUCT_NAME, "OEMB"),
  49. + },
  50. + },
  51. #endif
  52. { }
  53. };
  54. diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
  55. index 7c7cbb6362ea..81a8ff40e86e 100644
  56. --- a/sound/soc/codecs/rt5645.c
  57. +++ b/sound/soc/codecs/rt5645.c
  58. @@ -3717,6 +3717,15 @@ static const struct dmi_system_id dmi_platform_data[] = {
  59. },
  60. .driver_data = (void *)&intel_braswell_platform_data,
  61. },
  62. + {
  63. + .ident = "Microsoft Surface 3",
  64. + .matches = {
  65. + DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
  66. + DMI_MATCH(DMI_SYS_VENDOR, "OEMB"),
  67. + DMI_MATCH(DMI_PRODUCT_NAME, "OEMB"),
  68. + },
  69. + .driver_data = (void *)&intel_braswell_platform_data,
  70. + },
  71. {
  72. /*
  73. * Match for the GPDwin which unfortunately uses somewhat
  74. diff --git a/sound/soc/intel/common/soc-acpi-intel-cht-match.c b/sound/soc/intel/common/soc-acpi-intel-cht-match.c
  75. index cdcbf04b8832..958305779b12 100644
  76. --- a/sound/soc/intel/common/soc-acpi-intel-cht-match.c
  77. +++ b/sound/soc/intel/common/soc-acpi-intel-cht-match.c
  78. @@ -27,6 +27,14 @@ static const struct dmi_system_id cht_table[] = {
  79. DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"),
  80. },
  81. },
  82. + {
  83. + .callback = cht_surface_quirk_cb,
  84. + .matches = {
  85. + DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
  86. + DMI_MATCH(DMI_SYS_VENDOR, "OEMB"),
  87. + DMI_MATCH(DMI_PRODUCT_NAME, "OEMB"),
  88. + },
  89. + },
  90. { }
  91. };
  92. --
  93. 2.41.0