soc-acpi-intel-byt-match.c 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * soc-acpi-intel-byt-match.c - tables and support for BYT ACPI enumeration.
  4. *
  5. * Copyright (c) 2017, Intel Corporation.
  6. */
  7. #include <linux/dmi.h>
  8. #include <sound/soc-acpi.h>
  9. #include <sound/soc-acpi-intel-match.h>
  10. static unsigned long byt_machine_id;
  11. #define BYT_RT5672 1
  12. #define BYT_POV_P1006W 2
  13. static int byt_rt5672_quirk_cb(const struct dmi_system_id *id)
  14. {
  15. byt_machine_id = BYT_RT5672;
  16. return 1;
  17. }
  18. static int byt_pov_p1006w_quirk_cb(const struct dmi_system_id *id)
  19. {
  20. byt_machine_id = BYT_POV_P1006W;
  21. return 1;
  22. }
  23. static const struct dmi_system_id byt_table[] = {
  24. {
  25. .callback = byt_rt5672_quirk_cb,
  26. .matches = {
  27. DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
  28. DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad 8"),
  29. },
  30. },
  31. {
  32. .callback = byt_rt5672_quirk_cb,
  33. .matches = {
  34. DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
  35. DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad 10"),
  36. },
  37. },
  38. {
  39. .callback = byt_rt5672_quirk_cb,
  40. .matches = {
  41. DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
  42. DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad Tablet B"),
  43. },
  44. },
  45. {
  46. .callback = byt_rt5672_quirk_cb,
  47. .matches = {
  48. DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
  49. DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Miix 2 10"),
  50. },
  51. },
  52. {
  53. /* Point of View mobii wintab p1006w (v1.0) */
  54. .callback = byt_pov_p1006w_quirk_cb,
  55. .matches = {
  56. DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Insyde"),
  57. DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "BayTrail"),
  58. /* Note 105b is Foxcon's USB/PCI vendor id */
  59. DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "105B"),
  60. DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"),
  61. },
  62. },
  63. {
  64. /* Aegex 10 tablet (RU2) */
  65. .callback = byt_rt5672_quirk_cb,
  66. .matches = {
  67. DMI_MATCH(DMI_SYS_VENDOR, "AEGEX"),
  68. DMI_MATCH(DMI_PRODUCT_VERSION, "RU2"),
  69. },
  70. },
  71. {
  72. /* Dell Venue 10 Pro 5055 */
  73. .callback = byt_rt5672_quirk_cb,
  74. .matches = {
  75. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  76. DMI_MATCH(DMI_PRODUCT_NAME, "Venue 10 Pro 5055"),
  77. },
  78. },
  79. { }
  80. };
  81. /* Various devices use an ACPI id of 10EC5640 while using a rt5672 codec */
  82. static struct snd_soc_acpi_mach byt_rt5672 = {
  83. .id = "10EC5640",
  84. .drv_name = "cht-bsw-rt5672",
  85. .fw_filename = "intel/fw_sst_0f28.bin",
  86. .board = "cht-bsw",
  87. .sof_tplg_filename = "sof-byt-rt5670.tplg",
  88. };
  89. static struct snd_soc_acpi_mach byt_pov_p1006w = {
  90. .id = "10EC5640",
  91. .drv_name = "bytcr_rt5651",
  92. .fw_filename = "intel/fw_sst_0f28.bin",
  93. .board = "bytcr_rt5651",
  94. .sof_tplg_filename = "sof-byt-rt5651.tplg",
  95. };
  96. static struct snd_soc_acpi_mach *byt_quirk(void *arg)
  97. {
  98. struct snd_soc_acpi_mach *mach = arg;
  99. dmi_check_system(byt_table);
  100. switch (byt_machine_id) {
  101. case BYT_RT5672:
  102. return &byt_rt5672;
  103. case BYT_POV_P1006W:
  104. return &byt_pov_p1006w;
  105. default:
  106. return mach;
  107. }
  108. }
  109. static const struct snd_soc_acpi_codecs rt5640_comp_ids = {
  110. .num_codecs = 3,
  111. .codecs = { "10EC5640", "10EC5642", "INTCCFFD"},
  112. };
  113. static const struct snd_soc_acpi_codecs wm5102_comp_ids = {
  114. .num_codecs = 3,
  115. .codecs = { "10WM5102", "WM510204", "WM510205"},
  116. };
  117. static const struct snd_soc_acpi_codecs da7213_comp_ids = {
  118. .num_codecs = 2,
  119. .codecs = { "DGLS7212", "DGLS7213"},
  120. };
  121. static const struct snd_soc_acpi_codecs rt5645_comp_ids = {
  122. .num_codecs = 2,
  123. .codecs = { "10EC5645", "10EC5648"},
  124. };
  125. struct snd_soc_acpi_mach snd_soc_acpi_intel_baytrail_machines[] = {
  126. {
  127. .comp_ids = &rt5640_comp_ids,
  128. .drv_name = "bytcr_rt5640",
  129. .fw_filename = "intel/fw_sst_0f28.bin",
  130. .board = "bytcr_rt5640",
  131. .machine_quirk = byt_quirk,
  132. .sof_tplg_filename = "sof-byt-rt5640.tplg",
  133. },
  134. {
  135. .id = "10EC5651",
  136. .drv_name = "bytcr_rt5651",
  137. .fw_filename = "intel/fw_sst_0f28.bin",
  138. .board = "bytcr_rt5651",
  139. .sof_tplg_filename = "sof-byt-rt5651.tplg",
  140. },
  141. {
  142. .comp_ids = &wm5102_comp_ids,
  143. .drv_name = "bytcr_wm5102",
  144. .fw_filename = "intel/fw_sst_0f28.bin",
  145. .board = "bytcr_wm5102",
  146. .sof_tplg_filename = "sof-byt-wm5102.tplg",
  147. },
  148. {
  149. .comp_ids = &da7213_comp_ids,
  150. .drv_name = "bytcht_da7213",
  151. .fw_filename = "intel/fw_sst_0f28.bin",
  152. .board = "bytcht_da7213",
  153. .sof_tplg_filename = "sof-byt-da7213.tplg",
  154. },
  155. {
  156. .id = "ESSX8316",
  157. .drv_name = "bytcht_es8316",
  158. .fw_filename = "intel/fw_sst_0f28.bin",
  159. .board = "bytcht_es8316",
  160. .sof_tplg_filename = "sof-byt-es8316.tplg",
  161. },
  162. {
  163. .id = "10EC5682",
  164. .drv_name = "sof_rt5682",
  165. .sof_tplg_filename = "sof-byt-rt5682.tplg",
  166. },
  167. /* some Baytrail platforms rely on RT5645, use CHT machine driver */
  168. {
  169. .comp_ids = &rt5645_comp_ids,
  170. .drv_name = "cht-bsw-rt5645",
  171. .fw_filename = "intel/fw_sst_0f28.bin",
  172. .board = "cht-bsw",
  173. .sof_tplg_filename = "sof-byt-rt5645.tplg",
  174. },
  175. /* use CHT driver to Baytrail Chromebooks */
  176. {
  177. .id = "193C9890",
  178. .drv_name = "cht-bsw-max98090",
  179. .fw_filename = "intel/fw_sst_0f28.bin",
  180. .board = "cht-bsw",
  181. .sof_tplg_filename = "sof-byt-max98090.tplg",
  182. },
  183. {
  184. .id = "14F10720",
  185. .drv_name = "bytcht_cx2072x",
  186. .fw_filename = "intel/fw_sst_0f28.bin",
  187. .board = "bytcht_cx2072x",
  188. .sof_tplg_filename = "sof-byt-cx2072x.tplg",
  189. },
  190. #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)
  191. /*
  192. * This is always last in the table so that it is selected only when
  193. * enabled explicitly and there is no codec-related information in SSDT
  194. */
  195. {
  196. .id = "80860F28",
  197. .drv_name = "bytcht_nocodec",
  198. .fw_filename = "intel/fw_sst_0f28.bin",
  199. .board = "bytcht_nocodec",
  200. },
  201. #endif
  202. {},
  203. };
  204. EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_baytrail_machines);