soc-acpi-intel-cht-match.c 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /*
  2. * soc-apci-intel-cht-match.c - tables and support for CHT 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 cht_machine_id;
  20. #define CHT_SURFACE_MACH 1
  21. static int cht_surface_quirk_cb(const struct dmi_system_id *id)
  22. {
  23. cht_machine_id = CHT_SURFACE_MACH;
  24. return 1;
  25. }
  26. static const struct dmi_system_id cht_table[] = {
  27. {
  28. .callback = cht_surface_quirk_cb,
  29. .matches = {
  30. DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
  31. DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"),
  32. },
  33. },
  34. { }
  35. };
  36. static struct snd_soc_acpi_mach cht_surface_mach = {
  37. .id = "10EC5640",
  38. .drv_name = "cht-bsw-rt5645",
  39. .fw_filename = "intel/fw_sst_22a8.bin",
  40. .board = "cht-bsw",
  41. .sof_fw_filename = "intel/sof-cht.ri",
  42. .sof_tplg_filename = "intel/sof-cht-rt5645.tplg",
  43. .asoc_plat_name = "sst-mfld-platform",
  44. };
  45. static struct snd_soc_acpi_mach *cht_quirk(void *arg)
  46. {
  47. struct snd_soc_acpi_mach *mach = arg;
  48. dmi_check_system(cht_table);
  49. if (cht_machine_id == CHT_SURFACE_MACH)
  50. return &cht_surface_mach;
  51. else
  52. return mach;
  53. }
  54. /* Cherryview-based platforms: CherryTrail and Braswell */
  55. struct snd_soc_acpi_mach snd_soc_acpi_intel_cherrytrail_machines[] = {
  56. {
  57. .id = "10EC5670",
  58. .drv_name = "cht-bsw-rt5672",
  59. .fw_filename = "intel/fw_sst_22a8.bin",
  60. .board = "cht-bsw",
  61. .sof_fw_filename = "intel/sof-cht.ri",
  62. .sof_tplg_filename = "intel/sof-cht-rt5670.tplg",
  63. .asoc_plat_name = "sst-mfld-platform",
  64. },
  65. {
  66. .id = "10EC5672",
  67. .drv_name = "cht-bsw-rt5672",
  68. .fw_filename = "intel/fw_sst_22a8.bin",
  69. .board = "cht-bsw",
  70. .sof_fw_filename = "intel/sof-cht.ri",
  71. .sof_tplg_filename = "intel/sof-cht-rt5670.tplg",
  72. .asoc_plat_name = "sst-mfld-platform",
  73. },
  74. {
  75. .id = "10EC5645",
  76. .drv_name = "cht-bsw-rt5645",
  77. .fw_filename = "intel/fw_sst_22a8.bin",
  78. .board = "cht-bsw",
  79. .sof_fw_filename = "intel/sof-cht.ri",
  80. .sof_tplg_filename = "intel/sof-cht-rt5645.tplg",
  81. .asoc_plat_name = "sst-mfld-platform",
  82. },
  83. {
  84. .id = "10EC5650",
  85. .drv_name = "cht-bsw-rt5645",
  86. .fw_filename = "intel/fw_sst_22a8.bin",
  87. .board = "cht-bsw",
  88. .sof_fw_filename = "intel/sof-cht.ri",
  89. .sof_tplg_filename = "intel/sof-cht-rt5645.tplg",
  90. .asoc_plat_name = "sst-mfld-platform",
  91. },
  92. {
  93. .id = "10EC3270",
  94. .drv_name = "cht-bsw-rt5645",
  95. .fw_filename = "intel/fw_sst_22a8.bin",
  96. .board = "cht-bsw",
  97. .sof_fw_filename = "intel/sof-cht.ri",
  98. .sof_tplg_filename = "intel/sof-cht-rt5645.tplg",
  99. .asoc_plat_name = "sst-mfld-platform",
  100. },
  101. {
  102. .id = "193C9890",
  103. .drv_name = "cht-bsw-max98090",
  104. .fw_filename = "intel/fw_sst_22a8.bin",
  105. .board = "cht-bsw",
  106. .sof_fw_filename = "intel/sof-cht.ri",
  107. .sof_tplg_filename = "intel/sof-cht-max98090.tplg",
  108. .asoc_plat_name = "sst-mfld-platform",
  109. },
  110. {
  111. .id = "10508824",
  112. .drv_name = "cht-bsw-nau8824",
  113. .fw_filename = "intel/fw_sst_22a8.bin",
  114. .board = "cht-bsw",
  115. .sof_fw_filename = "intel/sof-cht.ri",
  116. .sof_tplg_filename = "intel/sof-cht-nau8824.tplg",
  117. .asoc_plat_name = "sst-mfld-platform",
  118. },
  119. {
  120. .id = "DLGS7212",
  121. .drv_name = "bytcht_da7213",
  122. .fw_filename = "intel/fw_sst_22a8.bin",
  123. .board = "bytcht_da7213",
  124. .sof_fw_filename = "intel/sof-cht.ri",
  125. .sof_tplg_filename = "intel/sof-cht-da7213.tplg",
  126. .asoc_plat_name = "sst-mfld-platform",
  127. },
  128. {
  129. .id = "DLGS7213",
  130. .drv_name = "bytcht_da7213",
  131. .fw_filename = "intel/fw_sst_22a8.bin",
  132. .board = "bytcht_da7213",
  133. .sof_fw_filename = "intel/sof-cht.ri",
  134. .sof_tplg_filename = "intel/sof-cht-da7213.tplg",
  135. .asoc_plat_name = "sst-mfld-platform",
  136. },
  137. {
  138. .id = "ESSX8316",
  139. .drv_name = "bytcht_es8316",
  140. .fw_filename = "intel/fw_sst_22a8.bin",
  141. .board = "bytcht_es8316",
  142. .sof_fw_filename = "intel/sof-cht.ri",
  143. .sof_tplg_filename = "intel/sof-cht-es8316.tplg",
  144. .asoc_plat_name = "sst-mfld-platform",
  145. },
  146. /* some CHT-T platforms rely on RT5640, use Baytrail machine driver */
  147. {
  148. .id = "10EC5640",
  149. .drv_name = "bytcr_rt5640",
  150. .fw_filename = "intel/fw_sst_22a8.bin",
  151. .board = "bytcr_rt5640",
  152. .machine_quirk = cht_quirk,
  153. .sof_fw_filename = "intel/sof-cht.ri",
  154. .sof_tplg_filename = "intel/sof-cht-rt5640.tplg",
  155. .asoc_plat_name = "sst-mfld-platform",
  156. },
  157. {
  158. .id = "10EC3276",
  159. .drv_name = "bytcr_rt5640",
  160. .fw_filename = "intel/fw_sst_22a8.bin",
  161. .board = "bytcr_rt5640",
  162. .sof_fw_filename = "intel/sof-cht.ri",
  163. .sof_tplg_filename = "intel/sof-cht-rt5640.tplg",
  164. .asoc_plat_name = "sst-mfld-platform",
  165. },
  166. /* some CHT-T platforms rely on RT5651, use Baytrail machine driver */
  167. {
  168. .id = "10EC5651",
  169. .drv_name = "bytcr_rt5651",
  170. .fw_filename = "intel/fw_sst_22a8.bin",
  171. .board = "bytcr_rt5651",
  172. .sof_fw_filename = "intel/sof-cht.ri",
  173. .sof_tplg_filename = "intel/sof-cht-rt5651.tplg",
  174. .asoc_plat_name = "sst-mfld-platform",
  175. },
  176. #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)
  177. /*
  178. * This is always last in the table so that it is selected only when
  179. * enabled explicitly and there is no codec-related information in SSDT
  180. */
  181. {
  182. .id = "808622A8",
  183. .drv_name = "bytcht_nocodec",
  184. .fw_filename = "intel/fw_sst_22a8.bin",
  185. .board = "bytcht_nocodec",
  186. },
  187. #endif
  188. {},
  189. };
  190. EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cherrytrail_machines);
  191. MODULE_LICENSE("GPL v2");
  192. MODULE_DESCRIPTION("Intel Common ACPI Match module");