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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. /*
  2. * soc-apci-intel-byt-match.c - tables and support for BYT ACPI enumeration.
  3. *
  4. * Copyright (c) 2017, Intel Corporation.
  5. *
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms and conditions of the GNU General Public License,
  9. * version 2, as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope it will be useful, but WITHOUT
  12. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  14. * more details.
  15. */
  16. #include <linux/dmi.h>
  17. #include <sound/soc-acpi.h>
  18. #include <sound/soc-acpi-intel-match.h>
  19. static unsigned long byt_machine_id;
  20. #define BYT_THINKPAD_10 1
  21. static int byt_thinkpad10_quirk_cb(const struct dmi_system_id *id)
  22. {
  23. byt_machine_id = BYT_THINKPAD_10;
  24. return 1;
  25. }
  26. static const struct dmi_system_id byt_table[] = {
  27. {
  28. .callback = byt_thinkpad10_quirk_cb,
  29. .matches = {
  30. DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
  31. DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad 10"),
  32. },
  33. },
  34. {
  35. .callback = byt_thinkpad10_quirk_cb,
  36. .matches = {
  37. DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
  38. DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad Tablet B"),
  39. },
  40. },
  41. {
  42. .callback = byt_thinkpad10_quirk_cb,
  43. .matches = {
  44. DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
  45. DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Miix 2 10"),
  46. },
  47. },
  48. { }
  49. };
  50. static struct snd_soc_acpi_mach byt_thinkpad_10 = {
  51. .id = "10EC5640",
  52. .drv_name = "cht-bsw-rt5672",
  53. .fw_filename = "intel/fw_sst_0f28.bin",
  54. .board = "cht-bsw",
  55. .sof_fw_filename = "intel/sof-byt.ri",
  56. .sof_tplg_filename = "intel/sof-byt-rt5670.tplg",
  57. .asoc_plat_name = "sst-mfld-platform",
  58. };
  59. static struct snd_soc_acpi_mach *byt_quirk(void *arg)
  60. {
  61. struct snd_soc_acpi_mach *mach = arg;
  62. dmi_check_system(byt_table);
  63. if (byt_machine_id == BYT_THINKPAD_10)
  64. return &byt_thinkpad_10;
  65. else
  66. return mach;
  67. }
  68. struct snd_soc_acpi_mach snd_soc_acpi_intel_baytrail_legacy_machines[] = {
  69. {
  70. .id = "10EC5640",
  71. .drv_name = "byt-rt5640",
  72. .fw_filename = "intel/fw_sst_0f28.bin-48kHz_i2s_master",
  73. },
  74. {
  75. .id = "193C9890",
  76. .drv_name = "byt-max98090",
  77. .fw_filename = "intel/fw_sst_0f28.bin-48kHz_i2s_master",
  78. },
  79. {}
  80. };
  81. EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_baytrail_legacy_machines);
  82. struct snd_soc_acpi_mach snd_soc_acpi_intel_baytrail_machines[] = {
  83. {
  84. .id = "10EC5640",
  85. .drv_name = "bytcr_rt5640",
  86. .fw_filename = "intel/fw_sst_0f28.bin",
  87. .board = "bytcr_rt5640",
  88. .machine_quirk = byt_quirk,
  89. .sof_fw_filename = "intel/sof-byt.ri",
  90. .sof_tplg_filename = "intel/sof-byt-rt5640.tplg",
  91. .asoc_plat_name = "sst-mfld-platform",
  92. },
  93. {
  94. .id = "10EC5642",
  95. .drv_name = "bytcr_rt5640",
  96. .fw_filename = "intel/fw_sst_0f28.bin",
  97. .board = "bytcr_rt5640",
  98. .sof_fw_filename = "intel/sof-byt.ri",
  99. .sof_tplg_filename = "intel/sof-byt-rt5640.tplg",
  100. .asoc_plat_name = "sst-mfld-platform",
  101. },
  102. {
  103. .id = "INTCCFFD",
  104. .drv_name = "bytcr_rt5640",
  105. .fw_filename = "intel/fw_sst_0f28.bin",
  106. .board = "bytcr_rt5640",
  107. .sof_fw_filename = "intel/sof-byt.ri",
  108. .sof_tplg_filename = "intel/sof-byt-rt5640.tplg",
  109. .asoc_plat_name = "sst-mfld-platform",
  110. },
  111. {
  112. .id = "10EC5651",
  113. .drv_name = "bytcr_rt5651",
  114. .fw_filename = "intel/fw_sst_0f28.bin",
  115. .board = "bytcr_rt5651",
  116. .sof_fw_filename = "intel/sof-byt.ri",
  117. .sof_tplg_filename = "intel/sof-byt-rt5651.tplg",
  118. .asoc_plat_name = "sst-mfld-platform",
  119. },
  120. {
  121. .id = "DLGS7212",
  122. .drv_name = "bytcht_da7213",
  123. .fw_filename = "intel/fw_sst_0f28.bin",
  124. .board = "bytcht_da7213",
  125. .sof_fw_filename = "intel/sof-byt.ri",
  126. .sof_tplg_filename = "intel/sof-byt-da7213.tplg",
  127. .asoc_plat_name = "sst-mfld-platform",
  128. },
  129. {
  130. .id = "DLGS7213",
  131. .drv_name = "bytcht_da7213",
  132. .fw_filename = "intel/fw_sst_0f28.bin",
  133. .board = "bytcht_da7213",
  134. .sof_fw_filename = "intel/sof-byt.ri",
  135. .sof_tplg_filename = "intel/sof-byt-da7213.tplg",
  136. .asoc_plat_name = "sst-mfld-platform",
  137. },
  138. /* some Baytrail platforms rely on RT5645, use CHT machine driver */
  139. {
  140. .id = "10EC5645",
  141. .drv_name = "cht-bsw-rt5645",
  142. .fw_filename = "intel/fw_sst_0f28.bin",
  143. .board = "cht-bsw",
  144. .sof_fw_filename = "intel/sof-byt.ri",
  145. .sof_tplg_filename = "intel/sof-byt-rt5645.tplg",
  146. .asoc_plat_name = "sst-mfld-platform",
  147. },
  148. {
  149. .id = "10EC5648",
  150. .drv_name = "cht-bsw-rt5645",
  151. .fw_filename = "intel/fw_sst_0f28.bin",
  152. .board = "cht-bsw",
  153. .sof_fw_filename = "intel/sof-byt.ri",
  154. .sof_tplg_filename = "intel/sof-byt-rt5645.tplg",
  155. .asoc_plat_name = "sst-mfld-platform",
  156. },
  157. /* use CHT driver to Baytrail Chromebooks */
  158. {
  159. .id = "193C9890",
  160. .drv_name = "cht-bsw-max98090",
  161. .fw_filename = "intel/fw_sst_0f28.bin",
  162. .board = "cht-bsw",
  163. .sof_fw_filename = "intel/sof-byt.ri",
  164. .sof_tplg_filename = "intel/sof-byt-max98090.tplg",
  165. .asoc_plat_name = "sst-mfld-platform",
  166. },
  167. #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)
  168. /*
  169. * This is always last in the table so that it is selected only when
  170. * enabled explicitly and there is no codec-related information in SSDT
  171. */
  172. {
  173. .id = "80860F28",
  174. .drv_name = "bytcht_nocodec",
  175. .fw_filename = "intel/fw_sst_0f28.bin",
  176. .board = "bytcht_nocodec",
  177. },
  178. #endif
  179. {},
  180. };
  181. EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_baytrail_machines);
  182. MODULE_LICENSE("GPL v2");
  183. MODULE_DESCRIPTION("Intel Common ACPI Match module");