soc-acpi-intel-mtl-match.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * soc-acpi-intel-mtl-match.c - tables and support for MTL ACPI enumeration.
  4. *
  5. * Copyright (c) 2022, Intel Corporation.
  6. *
  7. */
  8. #include <sound/soc-acpi.h>
  9. #include <sound/soc-acpi-intel-match.h>
  10. #include <sound/soc-acpi-intel-ssp-common.h>
  11. #include "soc-acpi-intel-sdw-mockup-match.h"
  12. static const struct snd_soc_acpi_codecs mtl_rt5682_rt5682s_hp = {
  13. .num_codecs = 2,
  14. .codecs = {RT5682_ACPI_HID, RT5682S_ACPI_HID},
  15. };
  16. static const struct snd_soc_acpi_codecs mtl_essx_83x6 = {
  17. .num_codecs = 3,
  18. .codecs = { "ESSX8316", "ESSX8326", "ESSX8336"},
  19. };
  20. static const struct snd_soc_acpi_codecs mtl_lt6911_hdmi = {
  21. .num_codecs = 1,
  22. .codecs = {"INTC10B0"}
  23. };
  24. struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_machines[] = {
  25. {
  26. .comp_ids = &mtl_essx_83x6,
  27. .drv_name = "mtl_es83x6_c1_h02",
  28. .machine_quirk = snd_soc_acpi_codec_list,
  29. .quirk_data = &mtl_lt6911_hdmi,
  30. .sof_tplg_filename = "sof-mtl-es83x6-ssp1-hdmi-ssp02.tplg",
  31. },
  32. {
  33. .comp_ids = &mtl_essx_83x6,
  34. .drv_name = "sof-essx8336",
  35. .sof_tplg_filename = "sof-mtl-es8336", /* the tplg suffix is added at run time */
  36. .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |
  37. SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |
  38. SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,
  39. },
  40. {
  41. .comp_ids = &mtl_rt5682_rt5682s_hp,
  42. .drv_name = "mtl_rt5682_c1_h02",
  43. .machine_quirk = snd_soc_acpi_codec_list,
  44. .quirk_data = &mtl_lt6911_hdmi,
  45. .sof_tplg_filename = "sof-mtl-rt5682-ssp1-hdmi-ssp02.tplg",
  46. },
  47. /* place boards for each headphone codec: sof driver will complete the
  48. * tplg name and machine driver will detect the amp type
  49. */
  50. {
  51. .id = CS42L42_ACPI_HID,
  52. .drv_name = "mtl_cs42l42_def",
  53. .sof_tplg_filename = "sof-mtl", /* the tplg suffix is added at run time */
  54. .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME |
  55. SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
  56. },
  57. {
  58. .id = DA7219_ACPI_HID,
  59. .drv_name = "mtl_da7219_def",
  60. .sof_tplg_filename = "sof-mtl", /* the tplg suffix is added at run time */
  61. .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME |
  62. SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
  63. },
  64. {
  65. .id = NAU8825_ACPI_HID,
  66. .drv_name = "mtl_nau8825_def",
  67. .sof_tplg_filename = "sof-mtl", /* the tplg suffix is added at run time */
  68. .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME |
  69. SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
  70. },
  71. {
  72. .id = RT5650_ACPI_HID,
  73. .drv_name = "mtl_rt5682_def",
  74. .sof_tplg_filename = "sof-mtl", /* the tplg suffix is added at run time */
  75. .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME |
  76. SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
  77. },
  78. {
  79. .comp_ids = &mtl_rt5682_rt5682s_hp,
  80. .drv_name = "mtl_rt5682_def",
  81. .sof_tplg_filename = "sof-mtl", /* the tplg suffix is added at run time */
  82. .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME |
  83. SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
  84. },
  85. /* place amp-only boards in the end of table */
  86. {
  87. .id = "INTC10B0",
  88. .drv_name = "mtl_lt6911_hdmi_ssp",
  89. .sof_tplg_filename = "sof-mtl-hdmi-ssp02.tplg",
  90. },
  91. {},
  92. };
  93. EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_mtl_machines);
  94. static const struct snd_soc_acpi_endpoint single_endpoint = {
  95. .num = 0,
  96. .aggregated = 0,
  97. .group_position = 0,
  98. .group_id = 0,
  99. };
  100. static const struct snd_soc_acpi_endpoint spk_l_endpoint = {
  101. .num = 0,
  102. .aggregated = 1,
  103. .group_position = 0,
  104. .group_id = 1,
  105. };
  106. static const struct snd_soc_acpi_endpoint spk_r_endpoint = {
  107. .num = 0,
  108. .aggregated = 1,
  109. .group_position = 1,
  110. .group_id = 1,
  111. };
  112. static const struct snd_soc_acpi_endpoint rt712_endpoints[] = {
  113. {
  114. .num = 0,
  115. .aggregated = 0,
  116. .group_position = 0,
  117. .group_id = 0,
  118. },
  119. {
  120. .num = 1,
  121. .aggregated = 0,
  122. .group_position = 0,
  123. .group_id = 0,
  124. },
  125. };
  126. /*
  127. * RT722 is a multi-function codec, three endpoints are created for
  128. * its headset, amp and dmic functions.
  129. */
  130. static const struct snd_soc_acpi_endpoint rt722_endpoints[] = {
  131. {
  132. .num = 0,
  133. .aggregated = 0,
  134. .group_position = 0,
  135. .group_id = 0,
  136. },
  137. {
  138. .num = 1,
  139. .aggregated = 0,
  140. .group_position = 0,
  141. .group_id = 0,
  142. },
  143. {
  144. .num = 2,
  145. .aggregated = 0,
  146. .group_position = 0,
  147. .group_id = 0,
  148. },
  149. };
  150. static const struct snd_soc_acpi_endpoint spk_2_endpoint = {
  151. .num = 0,
  152. .aggregated = 1,
  153. .group_position = 2,
  154. .group_id = 1,
  155. };
  156. static const struct snd_soc_acpi_endpoint spk_3_endpoint = {
  157. .num = 0,
  158. .aggregated = 1,
  159. .group_position = 3,
  160. .group_id = 1,
  161. };
  162. static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {
  163. {
  164. .adr = 0x000030025D071101ull,
  165. .num_endpoints = 1,
  166. .endpoints = &single_endpoint,
  167. .name_prefix = "rt711"
  168. }
  169. };
  170. static const struct snd_soc_acpi_adr_device rt712_0_single_adr[] = {
  171. {
  172. .adr = 0x000030025D071201ull,
  173. .num_endpoints = ARRAY_SIZE(rt712_endpoints),
  174. .endpoints = rt712_endpoints,
  175. .name_prefix = "rt712"
  176. }
  177. };
  178. static const struct snd_soc_acpi_adr_device rt1712_3_single_adr[] = {
  179. {
  180. .adr = 0x000330025D171201ull,
  181. .num_endpoints = 1,
  182. .endpoints = &single_endpoint,
  183. .name_prefix = "rt712-dmic"
  184. }
  185. };
  186. static const struct snd_soc_acpi_adr_device rt722_0_single_adr[] = {
  187. {
  188. .adr = 0x000030025d072201ull,
  189. .num_endpoints = ARRAY_SIZE(rt722_endpoints),
  190. .endpoints = rt722_endpoints,
  191. .name_prefix = "rt722"
  192. }
  193. };
  194. static const struct snd_soc_acpi_adr_device rt713_0_single_adr[] = {
  195. {
  196. .adr = 0x000031025D071301ull,
  197. .num_endpoints = 1,
  198. .endpoints = &single_endpoint,
  199. .name_prefix = "rt713"
  200. }
  201. };
  202. static const struct snd_soc_acpi_adr_device rt1713_3_single_adr[] = {
  203. {
  204. .adr = 0x000331025D171301ull,
  205. .num_endpoints = 1,
  206. .endpoints = &single_endpoint,
  207. .name_prefix = "rt713-dmic"
  208. }
  209. };
  210. static const struct snd_soc_acpi_adr_device mx8373_0_adr[] = {
  211. {
  212. .adr = 0x000023019F837300ull,
  213. .num_endpoints = 1,
  214. .endpoints = &spk_l_endpoint,
  215. .name_prefix = "Left"
  216. },
  217. {
  218. .adr = 0x000027019F837300ull,
  219. .num_endpoints = 1,
  220. .endpoints = &spk_r_endpoint,
  221. .name_prefix = "Right"
  222. }
  223. };
  224. static const struct snd_soc_acpi_adr_device rt5682_2_adr[] = {
  225. {
  226. .adr = 0x000221025D568200ull,
  227. .num_endpoints = 1,
  228. .endpoints = &single_endpoint,
  229. .name_prefix = "rt5682"
  230. }
  231. };
  232. static const struct snd_soc_acpi_adr_device rt1316_2_group1_adr[] = {
  233. {
  234. .adr = 0x000230025D131601ull,
  235. .num_endpoints = 1,
  236. .endpoints = &spk_l_endpoint,
  237. .name_prefix = "rt1316-1"
  238. }
  239. };
  240. static const struct snd_soc_acpi_adr_device rt1316_3_group1_adr[] = {
  241. {
  242. .adr = 0x000331025D131601ull,
  243. .num_endpoints = 1,
  244. .endpoints = &spk_r_endpoint,
  245. .name_prefix = "rt1316-2"
  246. }
  247. };
  248. static const struct snd_soc_acpi_adr_device rt1316_1_group2_adr[] = {
  249. {
  250. .adr = 0x000131025D131601ull,
  251. .num_endpoints = 1,
  252. .endpoints = &spk_l_endpoint,
  253. .name_prefix = "rt1316-1"
  254. }
  255. };
  256. static const struct snd_soc_acpi_adr_device rt1316_2_group2_adr[] = {
  257. {
  258. .adr = 0x000230025D131601ull,
  259. .num_endpoints = 1,
  260. .endpoints = &spk_r_endpoint,
  261. .name_prefix = "rt1316-2"
  262. }
  263. };
  264. static const struct snd_soc_acpi_adr_device rt1316_3_single_adr[] = {
  265. {
  266. .adr = 0x000330025D131601ull,
  267. .num_endpoints = 1,
  268. .endpoints = &single_endpoint,
  269. .name_prefix = "rt1316-1"
  270. }
  271. };
  272. static const struct snd_soc_acpi_adr_device rt1318_1_single_adr[] = {
  273. {
  274. .adr = 0x000130025D131801ull,
  275. .num_endpoints = 1,
  276. .endpoints = &single_endpoint,
  277. .name_prefix = "rt1318-1"
  278. }
  279. };
  280. static const struct snd_soc_acpi_adr_device rt1318_1_group1_adr[] = {
  281. {
  282. .adr = 0x000130025D131801ull,
  283. .num_endpoints = 1,
  284. .endpoints = &spk_l_endpoint,
  285. .name_prefix = "rt1318-1"
  286. }
  287. };
  288. static const struct snd_soc_acpi_adr_device rt1318_2_group1_adr[] = {
  289. {
  290. .adr = 0x000232025D131801ull,
  291. .num_endpoints = 1,
  292. .endpoints = &spk_r_endpoint,
  293. .name_prefix = "rt1318-2"
  294. }
  295. };
  296. static const struct snd_soc_acpi_adr_device rt714_0_adr[] = {
  297. {
  298. .adr = 0x000030025D071401ull,
  299. .num_endpoints = 1,
  300. .endpoints = &single_endpoint,
  301. .name_prefix = "rt714"
  302. }
  303. };
  304. static const struct snd_soc_acpi_adr_device rt714_1_adr[] = {
  305. {
  306. .adr = 0x000130025D071401ull,
  307. .num_endpoints = 1,
  308. .endpoints = &single_endpoint,
  309. .name_prefix = "rt714"
  310. }
  311. };
  312. static const struct snd_soc_acpi_link_adr mtl_712_l0_1712_l3[] = {
  313. {
  314. .mask = BIT(0),
  315. .num_adr = ARRAY_SIZE(rt712_0_single_adr),
  316. .adr_d = rt712_0_single_adr,
  317. },
  318. {
  319. .mask = BIT(3),
  320. .num_adr = ARRAY_SIZE(rt1712_3_single_adr),
  321. .adr_d = rt1712_3_single_adr,
  322. },
  323. {}
  324. };
  325. static const struct snd_soc_acpi_link_adr mtl_712_l0[] = {
  326. {
  327. .mask = BIT(0),
  328. .num_adr = ARRAY_SIZE(rt712_0_single_adr),
  329. .adr_d = rt712_0_single_adr,
  330. },
  331. {}
  332. };
  333. static const struct snd_soc_acpi_endpoint cs42l43_endpoints[] = {
  334. { /* Jack Playback Endpoint */
  335. .num = 0,
  336. .aggregated = 0,
  337. .group_position = 0,
  338. .group_id = 0,
  339. },
  340. { /* DMIC Capture Endpoint */
  341. .num = 1,
  342. .aggregated = 0,
  343. .group_position = 0,
  344. .group_id = 0,
  345. },
  346. { /* Jack Capture Endpoint */
  347. .num = 2,
  348. .aggregated = 0,
  349. .group_position = 0,
  350. .group_id = 0,
  351. },
  352. { /* Speaker Playback Endpoint */
  353. .num = 3,
  354. .aggregated = 0,
  355. .group_position = 0,
  356. .group_id = 0,
  357. },
  358. };
  359. static const struct snd_soc_acpi_adr_device cs42l43_0_adr[] = {
  360. {
  361. .adr = 0x00003001FA424301ull,
  362. .num_endpoints = ARRAY_SIZE(cs42l43_endpoints),
  363. .endpoints = cs42l43_endpoints,
  364. .name_prefix = "cs42l43"
  365. }
  366. };
  367. static const struct snd_soc_acpi_adr_device cs35l56_1_adr[] = {
  368. {
  369. .adr = 0x00013701FA355601ull,
  370. .num_endpoints = 1,
  371. .endpoints = &spk_r_endpoint,
  372. .name_prefix = "AMP3"
  373. },
  374. {
  375. .adr = 0x00013601FA355601ull,
  376. .num_endpoints = 1,
  377. .endpoints = &spk_3_endpoint,
  378. .name_prefix = "AMP4"
  379. }
  380. };
  381. static const struct snd_soc_acpi_adr_device cs35l56_2_adr[] = {
  382. {
  383. .adr = 0x00023301FA355601ull,
  384. .num_endpoints = 1,
  385. .endpoints = &spk_l_endpoint,
  386. .name_prefix = "AMP1"
  387. },
  388. {
  389. .adr = 0x00023201FA355601ull,
  390. .num_endpoints = 1,
  391. .endpoints = &spk_2_endpoint,
  392. .name_prefix = "AMP2"
  393. }
  394. };
  395. static const struct snd_soc_acpi_adr_device cs35l56_2_r_adr[] = {
  396. {
  397. .adr = 0x00023201FA355601ull,
  398. .num_endpoints = 1,
  399. .endpoints = &spk_r_endpoint,
  400. .name_prefix = "AMP3"
  401. },
  402. {
  403. .adr = 0x00023301FA355601ull,
  404. .num_endpoints = 1,
  405. .endpoints = &spk_3_endpoint,
  406. .name_prefix = "AMP4"
  407. }
  408. };
  409. static const struct snd_soc_acpi_adr_device cs35l56_3_l_adr[] = {
  410. {
  411. .adr = 0x00033001fa355601ull,
  412. .num_endpoints = 1,
  413. .endpoints = &spk_l_endpoint,
  414. .name_prefix = "AMP1"
  415. },
  416. {
  417. .adr = 0x00033101fa355601ull,
  418. .num_endpoints = 1,
  419. .endpoints = &spk_2_endpoint,
  420. .name_prefix = "AMP2"
  421. }
  422. };
  423. static const struct snd_soc_acpi_link_adr rt5682_link2_max98373_link0[] = {
  424. /* Expected order: jack -> amp */
  425. {
  426. .mask = BIT(2),
  427. .num_adr = ARRAY_SIZE(rt5682_2_adr),
  428. .adr_d = rt5682_2_adr,
  429. },
  430. {
  431. .mask = BIT(0),
  432. .num_adr = ARRAY_SIZE(mx8373_0_adr),
  433. .adr_d = mx8373_0_adr,
  434. },
  435. {}
  436. };
  437. static const struct snd_soc_acpi_link_adr mtl_rvp[] = {
  438. {
  439. .mask = BIT(0),
  440. .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
  441. .adr_d = rt711_sdca_0_adr,
  442. },
  443. {}
  444. };
  445. static const struct snd_soc_acpi_link_adr mtl_rt722_only[] = {
  446. {
  447. .mask = BIT(0),
  448. .num_adr = ARRAY_SIZE(rt722_0_single_adr),
  449. .adr_d = rt722_0_single_adr,
  450. },
  451. {}
  452. };
  453. static const struct snd_soc_acpi_link_adr mtl_3_in_1_sdca[] = {
  454. {
  455. .mask = BIT(0),
  456. .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
  457. .adr_d = rt711_sdca_0_adr,
  458. },
  459. {
  460. .mask = BIT(2),
  461. .num_adr = ARRAY_SIZE(rt1316_2_group1_adr),
  462. .adr_d = rt1316_2_group1_adr,
  463. },
  464. {
  465. .mask = BIT(3),
  466. .num_adr = ARRAY_SIZE(rt1316_3_group1_adr),
  467. .adr_d = rt1316_3_group1_adr,
  468. },
  469. {
  470. .mask = BIT(1),
  471. .num_adr = ARRAY_SIZE(rt714_1_adr),
  472. .adr_d = rt714_1_adr,
  473. },
  474. {}
  475. };
  476. static const struct snd_soc_acpi_link_adr mtl_sdw_rt1318_l12_rt714_l0[] = {
  477. {
  478. .mask = BIT(1),
  479. .num_adr = ARRAY_SIZE(rt1318_1_group1_adr),
  480. .adr_d = rt1318_1_group1_adr,
  481. },
  482. {
  483. .mask = BIT(2),
  484. .num_adr = ARRAY_SIZE(rt1318_2_group1_adr),
  485. .adr_d = rt1318_2_group1_adr,
  486. },
  487. {
  488. .mask = BIT(0),
  489. .num_adr = ARRAY_SIZE(rt714_0_adr),
  490. .adr_d = rt714_0_adr,
  491. },
  492. {}
  493. };
  494. static const struct snd_soc_acpi_link_adr mtl_rt713_l0_rt1316_l12_rt1713_l3[] = {
  495. {
  496. .mask = BIT(0),
  497. .num_adr = ARRAY_SIZE(rt713_0_single_adr),
  498. .adr_d = rt713_0_single_adr,
  499. },
  500. {
  501. .mask = BIT(1),
  502. .num_adr = ARRAY_SIZE(rt1316_1_group2_adr),
  503. .adr_d = rt1316_1_group2_adr,
  504. },
  505. {
  506. .mask = BIT(2),
  507. .num_adr = ARRAY_SIZE(rt1316_2_group2_adr),
  508. .adr_d = rt1316_2_group2_adr,
  509. },
  510. {
  511. .mask = BIT(3),
  512. .num_adr = ARRAY_SIZE(rt1713_3_single_adr),
  513. .adr_d = rt1713_3_single_adr,
  514. },
  515. {}
  516. };
  517. static const struct snd_soc_acpi_link_adr mtl_rt713_l0_rt1318_l1_rt1713_l3[] = {
  518. {
  519. .mask = BIT(0),
  520. .num_adr = ARRAY_SIZE(rt713_0_single_adr),
  521. .adr_d = rt713_0_single_adr,
  522. },
  523. {
  524. .mask = BIT(1),
  525. .num_adr = ARRAY_SIZE(rt1318_1_single_adr),
  526. .adr_d = rt1318_1_single_adr,
  527. },
  528. {
  529. .mask = BIT(3),
  530. .num_adr = ARRAY_SIZE(rt1713_3_single_adr),
  531. .adr_d = rt1713_3_single_adr,
  532. },
  533. {}
  534. };
  535. static const struct snd_soc_acpi_link_adr mtl_rt713_l0_rt1318_l12_rt1713_l3[] = {
  536. {
  537. .mask = BIT(0),
  538. .num_adr = ARRAY_SIZE(rt713_0_single_adr),
  539. .adr_d = rt713_0_single_adr,
  540. },
  541. {
  542. .mask = BIT(1),
  543. .num_adr = ARRAY_SIZE(rt1318_1_group1_adr),
  544. .adr_d = rt1318_1_group1_adr,
  545. },
  546. {
  547. .mask = BIT(2),
  548. .num_adr = ARRAY_SIZE(rt1318_2_group1_adr),
  549. .adr_d = rt1318_2_group1_adr,
  550. },
  551. {
  552. .mask = BIT(3),
  553. .num_adr = ARRAY_SIZE(rt1713_3_single_adr),
  554. .adr_d = rt1713_3_single_adr,
  555. },
  556. {}
  557. };
  558. static const struct snd_soc_acpi_link_adr mtl_rt713_l0_rt1316_l12[] = {
  559. {
  560. .mask = BIT(0),
  561. .num_adr = ARRAY_SIZE(rt713_0_single_adr),
  562. .adr_d = rt713_0_single_adr,
  563. },
  564. {
  565. .mask = BIT(1),
  566. .num_adr = ARRAY_SIZE(rt1316_1_group2_adr),
  567. .adr_d = rt1316_1_group2_adr,
  568. },
  569. {
  570. .mask = BIT(2),
  571. .num_adr = ARRAY_SIZE(rt1316_2_group2_adr),
  572. .adr_d = rt1316_2_group2_adr,
  573. },
  574. {}
  575. };
  576. static const struct snd_soc_acpi_link_adr mtl_rt711_l0_rt1316_l3[] = {
  577. {
  578. .mask = BIT(0),
  579. .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
  580. .adr_d = rt711_sdca_0_adr,
  581. },
  582. {
  583. .mask = BIT(3),
  584. .num_adr = ARRAY_SIZE(rt1316_3_single_adr),
  585. .adr_d = rt1316_3_single_adr,
  586. },
  587. {}
  588. };
  589. static const struct snd_soc_acpi_adr_device mx8363_2_adr[] = {
  590. {
  591. .adr = 0x000230019F836300ull,
  592. .num_endpoints = 1,
  593. .endpoints = &spk_l_endpoint,
  594. .name_prefix = "Left"
  595. },
  596. {
  597. .adr = 0x000231019F836300ull,
  598. .num_endpoints = 1,
  599. .endpoints = &spk_r_endpoint,
  600. .name_prefix = "Right"
  601. }
  602. };
  603. static const struct snd_soc_acpi_adr_device cs42l42_0_adr[] = {
  604. {
  605. .adr = 0x00001001FA424200ull,
  606. .num_endpoints = 1,
  607. .endpoints = &single_endpoint,
  608. .name_prefix = "cs42l42"
  609. }
  610. };
  611. static const struct snd_soc_acpi_link_adr cs42l42_link0_max98363_link2[] = {
  612. /* Expected order: jack -> amp */
  613. {
  614. .mask = BIT(0),
  615. .num_adr = ARRAY_SIZE(cs42l42_0_adr),
  616. .adr_d = cs42l42_0_adr,
  617. },
  618. {
  619. .mask = BIT(2),
  620. .num_adr = ARRAY_SIZE(mx8363_2_adr),
  621. .adr_d = mx8363_2_adr,
  622. },
  623. {}
  624. };
  625. static const struct snd_soc_acpi_link_adr mtl_cs42l43_l0[] = {
  626. {
  627. .mask = BIT(0),
  628. .num_adr = ARRAY_SIZE(cs42l43_0_adr),
  629. .adr_d = cs42l43_0_adr,
  630. },
  631. {}
  632. };
  633. static const struct snd_soc_acpi_link_adr mtl_cs42l43_cs35l56[] = {
  634. {
  635. .mask = BIT(0),
  636. .num_adr = ARRAY_SIZE(cs42l43_0_adr),
  637. .adr_d = cs42l43_0_adr,
  638. },
  639. {
  640. .mask = BIT(1),
  641. .num_adr = ARRAY_SIZE(cs35l56_1_adr),
  642. .adr_d = cs35l56_1_adr,
  643. },
  644. {
  645. .mask = BIT(2),
  646. .num_adr = ARRAY_SIZE(cs35l56_2_adr),
  647. .adr_d = cs35l56_2_adr,
  648. },
  649. {}
  650. };
  651. static const struct snd_soc_acpi_link_adr cs42l43_link0_cs35l56_link2_link3[] = {
  652. /* Expected order: jack -> amp */
  653. {
  654. .mask = BIT(0),
  655. .num_adr = ARRAY_SIZE(cs42l43_0_adr),
  656. .adr_d = cs42l43_0_adr,
  657. },
  658. {
  659. .mask = BIT(2),
  660. .num_adr = ARRAY_SIZE(cs35l56_2_r_adr),
  661. .adr_d = cs35l56_2_r_adr,
  662. },
  663. {
  664. .mask = BIT(3),
  665. .num_adr = ARRAY_SIZE(cs35l56_3_l_adr),
  666. .adr_d = cs35l56_3_l_adr,
  667. },
  668. {}
  669. };
  670. /* this table is used when there is no I2S codec present */
  671. struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_sdw_machines[] = {
  672. /* mockup tests need to be first */
  673. {
  674. .link_mask = GENMASK(3, 0),
  675. .links = sdw_mockup_headset_2amps_mic,
  676. .drv_name = "sof_sdw",
  677. .sof_tplg_filename = "sof-mtl-rt711-rt1308-rt715.tplg",
  678. },
  679. {
  680. .link_mask = BIT(0) | BIT(1) | BIT(3),
  681. .links = sdw_mockup_headset_1amp_mic,
  682. .drv_name = "sof_sdw",
  683. .sof_tplg_filename = "sof-mtl-rt711-rt1308-mono-rt715.tplg",
  684. },
  685. {
  686. .link_mask = GENMASK(2, 0),
  687. .links = sdw_mockup_mic_headset_1amp,
  688. .drv_name = "sof_sdw",
  689. .sof_tplg_filename = "sof-mtl-rt715-rt711-rt1308-mono.tplg",
  690. },
  691. {
  692. .link_mask = GENMASK(3, 0),
  693. .links = mtl_rt713_l0_rt1316_l12_rt1713_l3,
  694. .drv_name = "sof_sdw",
  695. .sof_tplg_filename = "sof-mtl-rt713-l0-rt1316-l12-rt1713-l3.tplg",
  696. },
  697. {
  698. .link_mask = GENMASK(3, 0),
  699. .links = mtl_rt713_l0_rt1318_l12_rt1713_l3,
  700. .drv_name = "sof_sdw",
  701. .sof_tplg_filename = "sof-mtl-rt713-l0-rt1318-l12-rt1713-l3.tplg",
  702. },
  703. {
  704. .link_mask = BIT(0) | BIT(1) | BIT(3),
  705. .links = mtl_rt713_l0_rt1318_l1_rt1713_l3,
  706. .drv_name = "sof_sdw",
  707. .sof_tplg_filename = "sof-mtl-rt713-l0-rt1318-l1-rt1713-l3.tplg",
  708. },
  709. {
  710. .link_mask = GENMASK(2, 0),
  711. .links = mtl_rt713_l0_rt1316_l12,
  712. .drv_name = "sof_sdw",
  713. .sof_tplg_filename = "sof-mtl-rt713-l0-rt1316-l12.tplg",
  714. },
  715. {
  716. .link_mask = BIT(3) | BIT(0),
  717. .links = mtl_712_l0_1712_l3,
  718. .drv_name = "sof_sdw",
  719. .sof_tplg_filename = "sof-mtl-rt712-l0-rt1712-l3.tplg",
  720. },
  721. {
  722. .link_mask = BIT(0),
  723. .links = mtl_712_l0,
  724. .drv_name = "sof_sdw",
  725. .sof_tplg_filename = "sof-mtl-rt712-l0.tplg",
  726. },
  727. {
  728. .link_mask = GENMASK(2, 0),
  729. .links = mtl_sdw_rt1318_l12_rt714_l0,
  730. .drv_name = "sof_sdw",
  731. .sof_tplg_filename = "sof-mtl-rt1318-l12-rt714-l0.tplg"
  732. },
  733. {
  734. .link_mask = BIT(0) | BIT(2) | BIT(3),
  735. .links = cs42l43_link0_cs35l56_link2_link3,
  736. .drv_name = "sof_sdw",
  737. .sof_tplg_filename = "sof-mtl-cs42l43-l0-cs35l56-l23.tplg",
  738. },
  739. {
  740. .link_mask = GENMASK(2, 0),
  741. .links = mtl_cs42l43_cs35l56,
  742. .drv_name = "sof_sdw",
  743. .sof_tplg_filename = "sof-mtl-cs42l43-l0-cs35l56-l12.tplg",
  744. },
  745. {
  746. .link_mask = BIT(0),
  747. .links = mtl_cs42l43_l0,
  748. .drv_name = "sof_sdw",
  749. .sof_tplg_filename = "sof-mtl-cs42l43-l0.tplg",
  750. },
  751. {
  752. .link_mask = GENMASK(3, 0),
  753. .links = mtl_3_in_1_sdca,
  754. .drv_name = "sof_sdw",
  755. .sof_tplg_filename = "sof-mtl-rt711-l0-rt1316-l23-rt714-l1.tplg",
  756. },
  757. {
  758. .link_mask = 0x9, /* 2 active links required */
  759. .links = mtl_rt711_l0_rt1316_l3,
  760. .drv_name = "sof_sdw",
  761. .sof_tplg_filename = "sof-mtl-rt711-l0-rt1316-l3.tplg",
  762. },
  763. {
  764. .link_mask = BIT(0),
  765. .links = mtl_rt722_only,
  766. .drv_name = "sof_sdw",
  767. .sof_tplg_filename = "sof-mtl-rt722-l0.tplg",
  768. },
  769. {
  770. .link_mask = BIT(0),
  771. .links = mtl_rvp,
  772. .drv_name = "sof_sdw",
  773. .sof_tplg_filename = "sof-mtl-rt711.tplg",
  774. },
  775. {
  776. .link_mask = BIT(0) | BIT(2),
  777. .links = rt5682_link2_max98373_link0,
  778. .drv_name = "sof_sdw",
  779. .sof_tplg_filename = "sof-mtl-sdw-rt5682-l2-max98373-l0.tplg",
  780. },
  781. {
  782. .link_mask = BIT(0) | BIT(2),
  783. .links = cs42l42_link0_max98363_link2,
  784. .drv_name = "sof_sdw",
  785. .sof_tplg_filename = "sof-mtl-sdw-cs42l42-l0-max98363-l2.tplg",
  786. },
  787. {},
  788. };
  789. EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_mtl_sdw_machines);