soc-acpi-intel-icl-match.c 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * soc-acpi-intel-icl-match.c - tables and support for ICL ACPI enumeration.
  4. *
  5. * Copyright (c) 2018, Intel Corporation.
  6. *
  7. */
  8. #include <sound/soc-acpi.h>
  9. #include <sound/soc-acpi-intel-match.h>
  10. #include "../skylake/skl.h"
  11. static const struct snd_soc_acpi_codecs essx_83x6 = {
  12. .num_codecs = 3,
  13. .codecs = { "ESSX8316", "ESSX8326", "ESSX8336"},
  14. };
  15. static struct skl_machine_pdata icl_pdata = {
  16. .use_tplg_pcm = true,
  17. };
  18. struct snd_soc_acpi_mach snd_soc_acpi_intel_icl_machines[] = {
  19. {
  20. .id = "INT34C2",
  21. .drv_name = "icl_rt274",
  22. .fw_filename = "intel/dsp_fw_icl.bin",
  23. .pdata = &icl_pdata,
  24. .sof_tplg_filename = "sof-icl-rt274.tplg",
  25. },
  26. {
  27. .id = "10EC5682",
  28. .drv_name = "sof_rt5682",
  29. .sof_tplg_filename = "sof-icl-rt5682.tplg",
  30. },
  31. {
  32. .comp_ids = &essx_83x6,
  33. .drv_name = "sof-essx8336",
  34. .sof_tplg_filename = "sof-icl-es8336", /* the tplg suffix is added at run time */
  35. .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |
  36. SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |
  37. SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,
  38. },
  39. {},
  40. };
  41. EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_icl_machines);
  42. static const struct snd_soc_acpi_endpoint single_endpoint = {
  43. .num = 0,
  44. .aggregated = 0,
  45. .group_position = 0,
  46. .group_id = 0,
  47. };
  48. static const struct snd_soc_acpi_endpoint spk_l_endpoint = {
  49. .num = 0,
  50. .aggregated = 1,
  51. .group_position = 0,
  52. .group_id = 1,
  53. };
  54. static const struct snd_soc_acpi_endpoint spk_r_endpoint = {
  55. .num = 0,
  56. .aggregated = 1,
  57. .group_position = 1,
  58. .group_id = 1,
  59. };
  60. static const struct snd_soc_acpi_adr_device rt700_0_adr[] = {
  61. {
  62. .adr = 0x000010025D070000ull,
  63. .num_endpoints = 1,
  64. .endpoints = &single_endpoint,
  65. .name_prefix = "rt700"
  66. }
  67. };
  68. static const struct snd_soc_acpi_link_adr icl_rvp[] = {
  69. {
  70. .mask = BIT(0),
  71. .num_adr = ARRAY_SIZE(rt700_0_adr),
  72. .adr_d = rt700_0_adr,
  73. },
  74. {}
  75. };
  76. static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {
  77. {
  78. .adr = 0x000020025D071100ull,
  79. .num_endpoints = 1,
  80. .endpoints = &single_endpoint,
  81. .name_prefix = "rt711"
  82. }
  83. };
  84. static const struct snd_soc_acpi_adr_device rt1308_1_adr[] = {
  85. {
  86. .adr = 0x000120025D130800ull,
  87. .num_endpoints = 1,
  88. .endpoints = &single_endpoint,
  89. .name_prefix = "rt1308-1"
  90. }
  91. };
  92. static const struct snd_soc_acpi_adr_device rt1308_1_group1_adr[] = {
  93. {
  94. .adr = 0x000120025D130800ull,
  95. .num_endpoints = 1,
  96. .endpoints = &spk_l_endpoint,
  97. .name_prefix = "rt1308-1"
  98. }
  99. };
  100. static const struct snd_soc_acpi_adr_device rt1308_2_group1_adr[] = {
  101. {
  102. .adr = 0x000220025D130800ull,
  103. .num_endpoints = 1,
  104. .endpoints = &spk_r_endpoint,
  105. .name_prefix = "rt1308-2"
  106. }
  107. };
  108. static const struct snd_soc_acpi_adr_device rt715_3_adr[] = {
  109. {
  110. .adr = 0x000320025D071500ull,
  111. .num_endpoints = 1,
  112. .endpoints = &single_endpoint,
  113. .name_prefix = "rt715"
  114. }
  115. };
  116. static const struct snd_soc_acpi_link_adr icl_3_in_1_default[] = {
  117. {
  118. .mask = BIT(0),
  119. .num_adr = ARRAY_SIZE(rt711_0_adr),
  120. .adr_d = rt711_0_adr,
  121. },
  122. {
  123. .mask = BIT(1),
  124. .num_adr = ARRAY_SIZE(rt1308_1_group1_adr),
  125. .adr_d = rt1308_1_group1_adr,
  126. },
  127. {
  128. .mask = BIT(2),
  129. .num_adr = ARRAY_SIZE(rt1308_2_group1_adr),
  130. .adr_d = rt1308_2_group1_adr,
  131. },
  132. {
  133. .mask = BIT(3),
  134. .num_adr = ARRAY_SIZE(rt715_3_adr),
  135. .adr_d = rt715_3_adr,
  136. },
  137. {}
  138. };
  139. static const struct snd_soc_acpi_link_adr icl_3_in_1_mono_amp[] = {
  140. {
  141. .mask = BIT(0),
  142. .num_adr = ARRAY_SIZE(rt711_0_adr),
  143. .adr_d = rt711_0_adr,
  144. },
  145. {
  146. .mask = BIT(1),
  147. .num_adr = ARRAY_SIZE(rt1308_1_adr),
  148. .adr_d = rt1308_1_adr,
  149. },
  150. {
  151. .mask = BIT(3),
  152. .num_adr = ARRAY_SIZE(rt715_3_adr),
  153. .adr_d = rt715_3_adr,
  154. },
  155. {}
  156. };
  157. struct snd_soc_acpi_mach snd_soc_acpi_intel_icl_sdw_machines[] = {
  158. {
  159. .link_mask = 0xF, /* 4 active links required */
  160. .links = icl_3_in_1_default,
  161. .drv_name = "sof_sdw",
  162. .sof_tplg_filename = "sof-icl-rt711-rt1308-rt715.tplg",
  163. },
  164. {
  165. .link_mask = 0xB, /* 3 active links required */
  166. .links = icl_3_in_1_mono_amp,
  167. .drv_name = "sof_sdw",
  168. .sof_tplg_filename = "sof-icl-rt711-rt1308-rt715-mono.tplg",
  169. },
  170. {
  171. .link_mask = 0x1, /* rt700 connected on link0 */
  172. .links = icl_rvp,
  173. .drv_name = "sof_sdw",
  174. .sof_tplg_filename = "sof-icl-rt700.tplg",
  175. },
  176. {},
  177. };
  178. EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_icl_sdw_machines);