soc-acpi-intel-lnl-match.c 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * soc-acpi-intel-lnl-match.c - tables and support for LNL ACPI enumeration.
  4. *
  5. * Copyright (c) 2023, Intel Corporation
  6. *
  7. */
  8. #include <sound/soc-acpi.h>
  9. #include <sound/soc-acpi-intel-match.h>
  10. #include "soc-acpi-intel-sdw-mockup-match.h"
  11. struct snd_soc_acpi_mach snd_soc_acpi_intel_lnl_machines[] = {
  12. {},
  13. };
  14. EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_lnl_machines);
  15. static const struct snd_soc_acpi_endpoint single_endpoint = {
  16. .num = 0,
  17. .aggregated = 0,
  18. .group_position = 0,
  19. .group_id = 0,
  20. };
  21. static const struct snd_soc_acpi_endpoint spk_l_endpoint = {
  22. .num = 0,
  23. .aggregated = 1,
  24. .group_position = 0,
  25. .group_id = 1,
  26. };
  27. static const struct snd_soc_acpi_endpoint spk_r_endpoint = {
  28. .num = 0,
  29. .aggregated = 1,
  30. .group_position = 1,
  31. .group_id = 1,
  32. };
  33. static const struct snd_soc_acpi_endpoint spk_2_endpoint = {
  34. .num = 0,
  35. .aggregated = 1,
  36. .group_position = 2,
  37. .group_id = 1,
  38. };
  39. static const struct snd_soc_acpi_endpoint spk_3_endpoint = {
  40. .num = 0,
  41. .aggregated = 1,
  42. .group_position = 3,
  43. .group_id = 1,
  44. };
  45. static const struct snd_soc_acpi_endpoint rt712_endpoints[] = {
  46. {
  47. .num = 0,
  48. .aggregated = 0,
  49. .group_position = 0,
  50. .group_id = 0,
  51. },
  52. {
  53. .num = 1,
  54. .aggregated = 0,
  55. .group_position = 0,
  56. .group_id = 0,
  57. },
  58. };
  59. /*
  60. * RT722 is a multi-function codec, three endpoints are created for
  61. * its headset, amp and dmic functions.
  62. */
  63. static const struct snd_soc_acpi_endpoint rt722_endpoints[] = {
  64. {
  65. .num = 0,
  66. .aggregated = 0,
  67. .group_position = 0,
  68. .group_id = 0,
  69. },
  70. {
  71. .num = 1,
  72. .aggregated = 0,
  73. .group_position = 0,
  74. .group_id = 0,
  75. },
  76. {
  77. .num = 2,
  78. .aggregated = 0,
  79. .group_position = 0,
  80. .group_id = 0,
  81. },
  82. };
  83. static const struct snd_soc_acpi_endpoint cs42l43_endpoints[] = {
  84. { /* Jack Playback Endpoint */
  85. .num = 0,
  86. .aggregated = 0,
  87. .group_position = 0,
  88. .group_id = 0,
  89. },
  90. { /* DMIC Capture Endpoint */
  91. .num = 1,
  92. .aggregated = 0,
  93. .group_position = 0,
  94. .group_id = 0,
  95. },
  96. { /* Jack Capture Endpoint */
  97. .num = 2,
  98. .aggregated = 0,
  99. .group_position = 0,
  100. .group_id = 0,
  101. },
  102. { /* Speaker Playback Endpoint */
  103. .num = 3,
  104. .aggregated = 0,
  105. .group_position = 0,
  106. .group_id = 0,
  107. },
  108. };
  109. static const struct snd_soc_acpi_adr_device cs35l56_2_l_adr[] = {
  110. {
  111. .adr = 0x00023001FA355601ull,
  112. .num_endpoints = 1,
  113. .endpoints = &spk_l_endpoint,
  114. .name_prefix = "AMP1"
  115. },
  116. {
  117. .adr = 0x00023101FA355601ull,
  118. .num_endpoints = 1,
  119. .endpoints = &spk_2_endpoint,
  120. .name_prefix = "AMP2"
  121. }
  122. };
  123. static const struct snd_soc_acpi_adr_device cs35l56_3_r_adr[] = {
  124. {
  125. .adr = 0x00033201fa355601ull,
  126. .num_endpoints = 1,
  127. .endpoints = &spk_r_endpoint,
  128. .name_prefix = "AMP3"
  129. },
  130. {
  131. .adr = 0x00033301fa355601ull,
  132. .num_endpoints = 1,
  133. .endpoints = &spk_3_endpoint,
  134. .name_prefix = "AMP4"
  135. }
  136. };
  137. static const struct snd_soc_acpi_adr_device cs35l56_3_lr_adr[] = {
  138. {
  139. .adr = 0x00033001fa355601ull,
  140. .num_endpoints = 1,
  141. .endpoints = &spk_l_endpoint,
  142. .name_prefix = "AMP1"
  143. },
  144. {
  145. .adr = 0x00033101fa355601ull,
  146. .num_endpoints = 1,
  147. .endpoints = &spk_r_endpoint,
  148. .name_prefix = "AMP2"
  149. }
  150. };
  151. static const struct snd_soc_acpi_adr_device cs42l43_0_adr[] = {
  152. {
  153. .adr = 0x00003001FA424301ull,
  154. .num_endpoints = ARRAY_SIZE(cs42l43_endpoints),
  155. .endpoints = cs42l43_endpoints,
  156. .name_prefix = "cs42l43"
  157. }
  158. };
  159. static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {
  160. {
  161. .adr = 0x000030025D071101ull,
  162. .num_endpoints = 1,
  163. .endpoints = &single_endpoint,
  164. .name_prefix = "rt711"
  165. }
  166. };
  167. static const struct snd_soc_acpi_adr_device rt712_2_single_adr[] = {
  168. {
  169. .adr = 0x000230025D071201ull,
  170. .num_endpoints = ARRAY_SIZE(rt712_endpoints),
  171. .endpoints = rt712_endpoints,
  172. .name_prefix = "rt712"
  173. }
  174. };
  175. static const struct snd_soc_acpi_adr_device rt1712_3_single_adr[] = {
  176. {
  177. .adr = 0x000330025D171201ull,
  178. .num_endpoints = 1,
  179. .endpoints = &single_endpoint,
  180. .name_prefix = "rt712-dmic"
  181. }
  182. };
  183. static const struct snd_soc_acpi_adr_device rt722_0_single_adr[] = {
  184. {
  185. .adr = 0x000030025d072201ull,
  186. .num_endpoints = ARRAY_SIZE(rt722_endpoints),
  187. .endpoints = rt722_endpoints,
  188. .name_prefix = "rt722"
  189. }
  190. };
  191. static const struct snd_soc_acpi_adr_device rt1316_2_group1_adr[] = {
  192. {
  193. .adr = 0x000230025D131601ull,
  194. .num_endpoints = 1,
  195. .endpoints = &spk_l_endpoint,
  196. .name_prefix = "rt1316-1"
  197. }
  198. };
  199. static const struct snd_soc_acpi_adr_device rt1316_3_group1_adr[] = {
  200. {
  201. .adr = 0x000331025D131601ull,
  202. .num_endpoints = 1,
  203. .endpoints = &spk_r_endpoint,
  204. .name_prefix = "rt1316-2"
  205. }
  206. };
  207. static const struct snd_soc_acpi_adr_device rt1318_1_adr[] = {
  208. {
  209. .adr = 0x000133025D131801ull,
  210. .num_endpoints = 1,
  211. .endpoints = &single_endpoint,
  212. .name_prefix = "rt1318-1"
  213. }
  214. };
  215. static const struct snd_soc_acpi_adr_device rt1318_1_group1_adr[] = {
  216. {
  217. .adr = 0x000130025D131801ull,
  218. .num_endpoints = 1,
  219. .endpoints = &spk_l_endpoint,
  220. .name_prefix = "rt1318-1"
  221. }
  222. };
  223. static const struct snd_soc_acpi_adr_device rt1318_2_group1_adr[] = {
  224. {
  225. .adr = 0x000232025D131801ull,
  226. .num_endpoints = 1,
  227. .endpoints = &spk_r_endpoint,
  228. .name_prefix = "rt1318-2"
  229. }
  230. };
  231. static const struct snd_soc_acpi_adr_device rt713_0_adr[] = {
  232. {
  233. .adr = 0x000031025D071301ull,
  234. .num_endpoints = 1,
  235. .endpoints = &single_endpoint,
  236. .name_prefix = "rt713"
  237. }
  238. };
  239. static const struct snd_soc_acpi_adr_device rt714_0_adr[] = {
  240. {
  241. .adr = 0x000030025D071401ull,
  242. .num_endpoints = 1,
  243. .endpoints = &single_endpoint,
  244. .name_prefix = "rt714"
  245. }
  246. };
  247. static const struct snd_soc_acpi_adr_device rt714_1_adr[] = {
  248. {
  249. .adr = 0x000130025D071401ull,
  250. .num_endpoints = 1,
  251. .endpoints = &single_endpoint,
  252. .name_prefix = "rt714"
  253. }
  254. };
  255. static const struct snd_soc_acpi_link_adr lnl_cs42l43_l0[] = {
  256. {
  257. .mask = BIT(0),
  258. .num_adr = ARRAY_SIZE(cs42l43_0_adr),
  259. .adr_d = cs42l43_0_adr,
  260. },
  261. {}
  262. };
  263. static const struct snd_soc_acpi_link_adr lnl_cs42l43_l0_cs35l56_l3[] = {
  264. {
  265. .mask = BIT(0),
  266. .num_adr = ARRAY_SIZE(cs42l43_0_adr),
  267. .adr_d = cs42l43_0_adr,
  268. },
  269. {
  270. .mask = BIT(3),
  271. .num_adr = ARRAY_SIZE(cs35l56_3_lr_adr),
  272. .adr_d = cs35l56_3_lr_adr,
  273. },
  274. {}
  275. };
  276. static const struct snd_soc_acpi_link_adr lnl_cs42l43_l0_cs35l56_l23[] = {
  277. {
  278. .mask = BIT(0),
  279. .num_adr = ARRAY_SIZE(cs42l43_0_adr),
  280. .adr_d = cs42l43_0_adr,
  281. },
  282. {
  283. .mask = BIT(2),
  284. .num_adr = ARRAY_SIZE(cs35l56_2_l_adr),
  285. .adr_d = cs35l56_2_l_adr,
  286. },
  287. {
  288. .mask = BIT(3),
  289. .num_adr = ARRAY_SIZE(cs35l56_3_r_adr),
  290. .adr_d = cs35l56_3_r_adr,
  291. },
  292. {}
  293. };
  294. static const struct snd_soc_acpi_link_adr lnl_rvp[] = {
  295. {
  296. .mask = BIT(0),
  297. .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
  298. .adr_d = rt711_sdca_0_adr,
  299. },
  300. {}
  301. };
  302. static const struct snd_soc_acpi_link_adr lnl_712_only[] = {
  303. {
  304. .mask = BIT(2),
  305. .num_adr = ARRAY_SIZE(rt712_2_single_adr),
  306. .adr_d = rt712_2_single_adr,
  307. },
  308. {
  309. .mask = BIT(3),
  310. .num_adr = ARRAY_SIZE(rt1712_3_single_adr),
  311. .adr_d = rt1712_3_single_adr,
  312. },
  313. {}
  314. };
  315. static const struct snd_soc_acpi_link_adr lnl_rt722_only[] = {
  316. {
  317. .mask = BIT(0),
  318. .num_adr = ARRAY_SIZE(rt722_0_single_adr),
  319. .adr_d = rt722_0_single_adr,
  320. },
  321. {}
  322. };
  323. static const struct snd_soc_acpi_link_adr lnl_3_in_1_sdca[] = {
  324. {
  325. .mask = BIT(0),
  326. .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
  327. .adr_d = rt711_sdca_0_adr,
  328. },
  329. {
  330. .mask = BIT(2),
  331. .num_adr = ARRAY_SIZE(rt1316_2_group1_adr),
  332. .adr_d = rt1316_2_group1_adr,
  333. },
  334. {
  335. .mask = BIT(3),
  336. .num_adr = ARRAY_SIZE(rt1316_3_group1_adr),
  337. .adr_d = rt1316_3_group1_adr,
  338. },
  339. {
  340. .mask = BIT(1),
  341. .num_adr = ARRAY_SIZE(rt714_1_adr),
  342. .adr_d = rt714_1_adr,
  343. },
  344. {}
  345. };
  346. static const struct snd_soc_acpi_link_adr lnl_sdw_rt1318_l12_rt714_l0[] = {
  347. {
  348. .mask = BIT(1),
  349. .num_adr = ARRAY_SIZE(rt1318_1_group1_adr),
  350. .adr_d = rt1318_1_group1_adr,
  351. },
  352. {
  353. .mask = BIT(2),
  354. .num_adr = ARRAY_SIZE(rt1318_2_group1_adr),
  355. .adr_d = rt1318_2_group1_adr,
  356. },
  357. {
  358. .mask = BIT(0),
  359. .num_adr = ARRAY_SIZE(rt714_0_adr),
  360. .adr_d = rt714_0_adr,
  361. },
  362. {}
  363. };
  364. static const struct snd_soc_acpi_link_adr lnl_sdw_rt713_l0_rt1318_l1[] = {
  365. {
  366. .mask = BIT(0),
  367. .num_adr = ARRAY_SIZE(rt713_0_adr),
  368. .adr_d = rt713_0_adr,
  369. },
  370. {
  371. .mask = BIT(1),
  372. .num_adr = ARRAY_SIZE(rt1318_1_adr),
  373. .adr_d = rt1318_1_adr,
  374. },
  375. {}
  376. };
  377. /* this table is used when there is no I2S codec present */
  378. struct snd_soc_acpi_mach snd_soc_acpi_intel_lnl_sdw_machines[] = {
  379. /* mockup tests need to be first */
  380. {
  381. .link_mask = GENMASK(3, 0),
  382. .links = sdw_mockup_headset_2amps_mic,
  383. .drv_name = "sof_sdw",
  384. .sof_tplg_filename = "sof-lnl-rt711-rt1308-rt715.tplg",
  385. },
  386. {
  387. .link_mask = BIT(0) | BIT(1) | BIT(3),
  388. .links = sdw_mockup_headset_1amp_mic,
  389. .drv_name = "sof_sdw",
  390. .sof_tplg_filename = "sof-lnl-rt711-rt1308-mono-rt715.tplg",
  391. },
  392. {
  393. .link_mask = GENMASK(2, 0),
  394. .links = sdw_mockup_mic_headset_1amp,
  395. .drv_name = "sof_sdw",
  396. .sof_tplg_filename = "sof-lnl-rt715-rt711-rt1308-mono.tplg",
  397. },
  398. {
  399. .link_mask = GENMASK(3, 0),
  400. .links = lnl_3_in_1_sdca,
  401. .drv_name = "sof_sdw",
  402. .sof_tplg_filename = "sof-lnl-rt711-l0-rt1316-l23-rt714-l1.tplg",
  403. },
  404. {
  405. .link_mask = BIT(0) | BIT(2) | BIT(3),
  406. .links = lnl_cs42l43_l0_cs35l56_l23,
  407. .drv_name = "sof_sdw",
  408. .sof_tplg_filename = "sof-lnl-cs42l43-l0-cs35l56-l23.tplg",
  409. },
  410. {
  411. .link_mask = BIT(0) | BIT(3),
  412. .links = lnl_cs42l43_l0_cs35l56_l3,
  413. .drv_name = "sof_sdw",
  414. .sof_tplg_filename = "sof-lnl-cs42l43-l0-cs35l56-l3.tplg",
  415. },
  416. {
  417. .link_mask = BIT(0),
  418. .links = lnl_cs42l43_l0,
  419. .drv_name = "sof_sdw",
  420. .sof_tplg_filename = "sof-lnl-cs42l43-l0.tplg",
  421. },
  422. {
  423. .link_mask = BIT(0),
  424. .links = lnl_rvp,
  425. .drv_name = "sof_sdw",
  426. .sof_tplg_filename = "sof-lnl-rt711.tplg",
  427. },
  428. {
  429. .link_mask = BIT(2) | BIT(3),
  430. .links = lnl_712_only,
  431. .drv_name = "sof_sdw",
  432. .sof_tplg_filename = "sof-lnl-rt712-l2-rt1712-l3.tplg",
  433. },
  434. {
  435. .link_mask = BIT(0),
  436. .links = lnl_rt722_only,
  437. .drv_name = "sof_sdw",
  438. .sof_tplg_filename = "sof-lnl-rt722-l0.tplg",
  439. },
  440. {
  441. .link_mask = GENMASK(2, 0),
  442. .links = lnl_sdw_rt1318_l12_rt714_l0,
  443. .drv_name = "sof_sdw",
  444. .sof_tplg_filename = "sof-lnl-rt1318-l12-rt714-l0.tplg"
  445. },
  446. {
  447. .link_mask = BIT(0) | BIT(1),
  448. .links = lnl_sdw_rt713_l0_rt1318_l1,
  449. .drv_name = "sof_sdw",
  450. .sof_tplg_filename = "sof-lnl-rt713-l0-rt1318-l1.tplg"
  451. },
  452. {},
  453. };
  454. EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_lnl_sdw_machines);