sof_maxim_common.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. //
  3. // Copyright(c) 2020 Intel Corporation
  4. #include <linux/module.h>
  5. #include <linux/string.h>
  6. #include <sound/pcm.h>
  7. #include <sound/pcm_params.h>
  8. #include <sound/soc.h>
  9. #include <sound/soc-acpi.h>
  10. #include <sound/soc-dai.h>
  11. #include <sound/soc-dapm.h>
  12. #include <sound/sof.h>
  13. #include <uapi/sound/asound.h>
  14. #include "../common/soc-intel-quirks.h"
  15. #include "sof_maxim_common.h"
  16. /*
  17. * Common structures and functions
  18. */
  19. static const struct snd_kcontrol_new maxim_2spk_kcontrols[] = {
  20. SOC_DAPM_PIN_SWITCH("Left Spk"),
  21. SOC_DAPM_PIN_SWITCH("Right Spk"),
  22. };
  23. static const struct snd_soc_dapm_widget maxim_2spk_widgets[] = {
  24. SND_SOC_DAPM_SPK("Left Spk", NULL),
  25. SND_SOC_DAPM_SPK("Right Spk", NULL),
  26. };
  27. /* helper function to get the number of specific codec */
  28. static unsigned int get_num_codecs(const char *hid)
  29. {
  30. struct acpi_device *adev;
  31. unsigned int dev_num = 0;
  32. for_each_acpi_dev_match(adev, hid, NULL, -1)
  33. dev_num++;
  34. return dev_num;
  35. }
  36. /*
  37. * Maxim MAX98373
  38. */
  39. #define MAX_98373_PIN_NAME 16
  40. static const struct snd_soc_dapm_route max_98373_dapm_routes[] = {
  41. /* speaker */
  42. { "Left Spk", NULL, "Left BE_OUT" },
  43. { "Right Spk", NULL, "Right BE_OUT" },
  44. };
  45. static struct snd_soc_codec_conf max_98373_codec_conf[] = {
  46. {
  47. .dlc = COMP_CODEC_CONF(MAX_98373_DEV0_NAME),
  48. .name_prefix = "Right",
  49. },
  50. {
  51. .dlc = COMP_CODEC_CONF(MAX_98373_DEV1_NAME),
  52. .name_prefix = "Left",
  53. },
  54. };
  55. static struct snd_soc_dai_link_component max_98373_components[] = {
  56. { /* For Right */
  57. .name = MAX_98373_DEV0_NAME,
  58. .dai_name = MAX_98373_CODEC_DAI,
  59. },
  60. { /* For Left */
  61. .name = MAX_98373_DEV1_NAME,
  62. .dai_name = MAX_98373_CODEC_DAI,
  63. },
  64. };
  65. /*
  66. * According to the definition of 'DAI Sel Mux' mixer in max98373.c, rx mask
  67. * should choose two channels from TDM slots, the LSB of rx mask is left channel
  68. * and the other one is right channel.
  69. */
  70. static const struct {
  71. unsigned int rx;
  72. } max_98373_tdm_mask[] = {
  73. {.rx = 0x3},
  74. {.rx = 0x3},
  75. };
  76. /*
  77. * The tx mask indicates which channel(s) contains output IV-sense data and
  78. * others should set to Hi-Z. Here we get the channel number from codec's ACPI
  79. * device property "maxim,vmon-slot-no" and "maxim,imon-slot-no" to generate the
  80. * mask. Refer to the max98373_slot_config() function in max98373.c codec driver.
  81. */
  82. static unsigned int max_98373_get_tx_mask(struct device *dev)
  83. {
  84. int vmon_slot;
  85. int imon_slot;
  86. if (device_property_read_u32(dev, "maxim,vmon-slot-no", &vmon_slot))
  87. vmon_slot = 0;
  88. if (device_property_read_u32(dev, "maxim,imon-slot-no", &imon_slot))
  89. imon_slot = 1;
  90. dev_dbg(dev, "vmon_slot %d imon_slot %d\n", vmon_slot, imon_slot);
  91. return (0x1 << vmon_slot) | (0x1 << imon_slot);
  92. }
  93. static int max_98373_hw_params(struct snd_pcm_substream *substream,
  94. struct snd_pcm_hw_params *params)
  95. {
  96. struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
  97. struct snd_soc_dai_link *dai_link = rtd->dai_link;
  98. struct snd_soc_dai *codec_dai;
  99. int i;
  100. int tdm_slots;
  101. unsigned int tx_mask;
  102. unsigned int tx_mask_used = 0x0;
  103. int ret = 0;
  104. for_each_rtd_codec_dais(rtd, i, codec_dai) {
  105. if (i >= ARRAY_SIZE(max_98373_tdm_mask)) {
  106. dev_err(codec_dai->dev, "only 2 amps are supported\n");
  107. return -EINVAL;
  108. }
  109. switch (dai_link->dai_fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
  110. case SND_SOC_DAIFMT_DSP_A:
  111. case SND_SOC_DAIFMT_DSP_B:
  112. /* get the tplg configured tdm slot number */
  113. tdm_slots = sof_dai_get_tdm_slots(rtd);
  114. if (tdm_slots <= 0) {
  115. dev_err(rtd->dev, "invalid tdm slots %d\n",
  116. tdm_slots);
  117. return -EINVAL;
  118. }
  119. /* get the tx mask from ACPI device properties */
  120. tx_mask = max_98373_get_tx_mask(codec_dai->dev);
  121. if (!tx_mask)
  122. return -EINVAL;
  123. if (tx_mask & tx_mask_used) {
  124. dev_err(codec_dai->dev, "invalid tx mask 0x%x, used 0x%x\n",
  125. tx_mask, tx_mask_used);
  126. return -EINVAL;
  127. }
  128. tx_mask_used |= tx_mask;
  129. /*
  130. * check if tdm slot number is too small for channel
  131. * allocation
  132. */
  133. if (fls(tx_mask) > tdm_slots) {
  134. dev_err(codec_dai->dev, "slot mismatch, tx %d slots %d\n",
  135. fls(tx_mask), tdm_slots);
  136. return -EINVAL;
  137. }
  138. if (fls(max_98373_tdm_mask[i].rx) > tdm_slots) {
  139. dev_err(codec_dai->dev, "slot mismatch, rx %d slots %d\n",
  140. fls(max_98373_tdm_mask[i].rx), tdm_slots);
  141. return -EINVAL;
  142. }
  143. dev_dbg(codec_dai->dev, "set tdm slot: tx 0x%x rx 0x%x slots %d width %d\n",
  144. tx_mask, max_98373_tdm_mask[i].rx,
  145. tdm_slots, params_width(params));
  146. ret = snd_soc_dai_set_tdm_slot(codec_dai, tx_mask,
  147. max_98373_tdm_mask[i].rx,
  148. tdm_slots,
  149. params_width(params));
  150. if (ret < 0) {
  151. dev_err(codec_dai->dev, "fail to set tdm slot, ret %d\n",
  152. ret);
  153. return ret;
  154. }
  155. break;
  156. default:
  157. dev_dbg(codec_dai->dev, "codec is in I2S mode\n");
  158. break;
  159. }
  160. }
  161. return 0;
  162. }
  163. static int max_98373_trigger(struct snd_pcm_substream *substream, int cmd)
  164. {
  165. struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
  166. struct snd_soc_dai *codec_dai;
  167. struct snd_soc_dai *cpu_dai;
  168. int j;
  169. int ret = 0;
  170. /* set spk pin by playback only */
  171. if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
  172. return 0;
  173. cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
  174. for_each_rtd_codec_dais(rtd, j, codec_dai) {
  175. struct snd_soc_dapm_context *dapm =
  176. snd_soc_component_get_dapm(cpu_dai->component);
  177. char pin_name[MAX_98373_PIN_NAME];
  178. snprintf(pin_name, ARRAY_SIZE(pin_name), "%s Spk",
  179. codec_dai->component->name_prefix);
  180. switch (cmd) {
  181. case SNDRV_PCM_TRIGGER_START:
  182. case SNDRV_PCM_TRIGGER_RESUME:
  183. case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
  184. ret = snd_soc_dapm_enable_pin(dapm, pin_name);
  185. if (!ret)
  186. snd_soc_dapm_sync(dapm);
  187. break;
  188. case SNDRV_PCM_TRIGGER_STOP:
  189. case SNDRV_PCM_TRIGGER_SUSPEND:
  190. case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
  191. ret = snd_soc_dapm_disable_pin(dapm, pin_name);
  192. if (!ret)
  193. snd_soc_dapm_sync(dapm);
  194. break;
  195. default:
  196. break;
  197. }
  198. }
  199. return ret;
  200. }
  201. static const struct snd_soc_ops max_98373_ops = {
  202. .hw_params = max_98373_hw_params,
  203. .trigger = max_98373_trigger,
  204. };
  205. static int max_98373_spk_codec_init(struct snd_soc_pcm_runtime *rtd)
  206. {
  207. struct snd_soc_card *card = rtd->card;
  208. unsigned int num_codecs = get_num_codecs(MAX_98373_ACPI_HID);
  209. int ret;
  210. switch (num_codecs) {
  211. case 2:
  212. ret = snd_soc_dapm_new_controls(&card->dapm, maxim_2spk_widgets,
  213. ARRAY_SIZE(maxim_2spk_widgets));
  214. if (ret) {
  215. dev_err(rtd->dev, "fail to add max98373 widgets, ret %d\n",
  216. ret);
  217. return ret;
  218. }
  219. ret = snd_soc_add_card_controls(card, maxim_2spk_kcontrols,
  220. ARRAY_SIZE(maxim_2spk_kcontrols));
  221. if (ret) {
  222. dev_err(rtd->dev, "fail to add max98373 kcontrols, ret %d\n",
  223. ret);
  224. return ret;
  225. }
  226. ret = snd_soc_dapm_add_routes(&card->dapm, max_98373_dapm_routes,
  227. ARRAY_SIZE(max_98373_dapm_routes));
  228. if (ret) {
  229. dev_err(rtd->dev, "fail to add max98373 routes, ret %d\n",
  230. ret);
  231. return ret;
  232. }
  233. break;
  234. default:
  235. dev_err(rtd->dev, "max98373: invalid num_codecs %d\n", num_codecs);
  236. return -EINVAL;
  237. }
  238. return ret;
  239. }
  240. void max_98373_dai_link(struct device *dev, struct snd_soc_dai_link *link)
  241. {
  242. link->codecs = max_98373_components;
  243. link->num_codecs = ARRAY_SIZE(max_98373_components);
  244. link->init = max_98373_spk_codec_init;
  245. link->ops = &max_98373_ops;
  246. }
  247. EXPORT_SYMBOL_NS(max_98373_dai_link, SND_SOC_INTEL_SOF_MAXIM_COMMON);
  248. void max_98373_set_codec_conf(struct snd_soc_card *card)
  249. {
  250. card->codec_conf = max_98373_codec_conf;
  251. card->num_configs = ARRAY_SIZE(max_98373_codec_conf);
  252. }
  253. EXPORT_SYMBOL_NS(max_98373_set_codec_conf, SND_SOC_INTEL_SOF_MAXIM_COMMON);
  254. /*
  255. * Maxim MAX98390
  256. */
  257. static const struct snd_soc_dapm_route max_98390_dapm_routes[] = {
  258. /* speaker */
  259. { "Left Spk", NULL, "Left BE_OUT" },
  260. { "Right Spk", NULL, "Right BE_OUT" },
  261. };
  262. static const struct snd_kcontrol_new max_98390_tt_kcontrols[] = {
  263. SOC_DAPM_PIN_SWITCH("TL Spk"),
  264. SOC_DAPM_PIN_SWITCH("TR Spk"),
  265. };
  266. static const struct snd_soc_dapm_widget max_98390_tt_dapm_widgets[] = {
  267. SND_SOC_DAPM_SPK("TL Spk", NULL),
  268. SND_SOC_DAPM_SPK("TR Spk", NULL),
  269. };
  270. static const struct snd_soc_dapm_route max_98390_tt_dapm_routes[] = {
  271. /* Tweeter speaker */
  272. { "TL Spk", NULL, "Tweeter Left BE_OUT" },
  273. { "TR Spk", NULL, "Tweeter Right BE_OUT" },
  274. };
  275. static struct snd_soc_codec_conf max_98390_cml_codec_conf[] = {
  276. {
  277. .dlc = COMP_CODEC_CONF(MAX_98390_DEV0_NAME),
  278. .name_prefix = "Left",
  279. },
  280. {
  281. .dlc = COMP_CODEC_CONF(MAX_98390_DEV1_NAME),
  282. .name_prefix = "Right",
  283. },
  284. };
  285. static struct snd_soc_codec_conf max_98390_codec_conf[] = {
  286. {
  287. .dlc = COMP_CODEC_CONF(MAX_98390_DEV0_NAME),
  288. .name_prefix = "Right",
  289. },
  290. {
  291. .dlc = COMP_CODEC_CONF(MAX_98390_DEV1_NAME),
  292. .name_prefix = "Left",
  293. },
  294. {
  295. .dlc = COMP_CODEC_CONF(MAX_98390_DEV2_NAME),
  296. .name_prefix = "Tweeter Right",
  297. },
  298. {
  299. .dlc = COMP_CODEC_CONF(MAX_98390_DEV3_NAME),
  300. .name_prefix = "Tweeter Left",
  301. },
  302. };
  303. static struct snd_soc_dai_link_component max_98390_components[] = {
  304. {
  305. .name = MAX_98390_DEV0_NAME,
  306. .dai_name = MAX_98390_CODEC_DAI,
  307. },
  308. {
  309. .name = MAX_98390_DEV1_NAME,
  310. .dai_name = MAX_98390_CODEC_DAI,
  311. },
  312. {
  313. .name = MAX_98390_DEV2_NAME,
  314. .dai_name = MAX_98390_CODEC_DAI,
  315. },
  316. {
  317. .name = MAX_98390_DEV3_NAME,
  318. .dai_name = MAX_98390_CODEC_DAI,
  319. },
  320. };
  321. static const struct {
  322. unsigned int tx;
  323. unsigned int rx;
  324. } max_98390_tdm_mask[] = {
  325. {.tx = 0x01, .rx = 0x3},
  326. {.tx = 0x02, .rx = 0x3},
  327. {.tx = 0x04, .rx = 0x3},
  328. {.tx = 0x08, .rx = 0x3},
  329. };
  330. static int max_98390_hw_params(struct snd_pcm_substream *substream,
  331. struct snd_pcm_hw_params *params)
  332. {
  333. struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
  334. struct snd_soc_dai_link *dai_link = rtd->dai_link;
  335. struct snd_soc_dai *codec_dai;
  336. int i, ret;
  337. for_each_rtd_codec_dais(rtd, i, codec_dai) {
  338. if (i >= ARRAY_SIZE(max_98390_tdm_mask)) {
  339. dev_err(codec_dai->dev, "invalid codec index %d\n", i);
  340. return -ENODEV;
  341. }
  342. switch (dai_link->dai_fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
  343. case SND_SOC_DAIFMT_DSP_A:
  344. case SND_SOC_DAIFMT_DSP_B:
  345. /* 4-slot TDM */
  346. ret = snd_soc_dai_set_tdm_slot(codec_dai,
  347. max_98390_tdm_mask[i].tx,
  348. max_98390_tdm_mask[i].rx,
  349. 4,
  350. params_width(params));
  351. if (ret < 0) {
  352. dev_err(codec_dai->dev, "fail to set tdm slot, ret %d\n",
  353. ret);
  354. return ret;
  355. }
  356. break;
  357. default:
  358. dev_dbg(codec_dai->dev, "codec is in I2S mode\n");
  359. break;
  360. }
  361. }
  362. return 0;
  363. }
  364. static int max_98390_init(struct snd_soc_pcm_runtime *rtd)
  365. {
  366. struct snd_soc_card *card = rtd->card;
  367. unsigned int num_codecs = get_num_codecs(MAX_98390_ACPI_HID);
  368. int ret;
  369. switch (num_codecs) {
  370. case 4:
  371. /* add widgets/controls/dapm for tweeter speakers */
  372. ret = snd_soc_dapm_new_controls(&card->dapm, max_98390_tt_dapm_widgets,
  373. ARRAY_SIZE(max_98390_tt_dapm_widgets));
  374. if (ret) {
  375. dev_err(rtd->dev, "unable to add tweeter dapm widgets, ret %d\n",
  376. ret);
  377. /* Don't need to add routes if widget addition failed */
  378. return ret;
  379. }
  380. ret = snd_soc_add_card_controls(card, max_98390_tt_kcontrols,
  381. ARRAY_SIZE(max_98390_tt_kcontrols));
  382. if (ret) {
  383. dev_err(rtd->dev, "unable to add tweeter controls, ret %d\n",
  384. ret);
  385. return ret;
  386. }
  387. ret = snd_soc_dapm_add_routes(&card->dapm, max_98390_tt_dapm_routes,
  388. ARRAY_SIZE(max_98390_tt_dapm_routes));
  389. if (ret) {
  390. dev_err(rtd->dev, "unable to add tweeter dapm routes, ret %d\n",
  391. ret);
  392. return ret;
  393. }
  394. fallthrough;
  395. case 2:
  396. /* add regular speakers dapm route */
  397. ret = snd_soc_dapm_new_controls(&card->dapm, maxim_2spk_widgets,
  398. ARRAY_SIZE(maxim_2spk_widgets));
  399. if (ret) {
  400. dev_err(rtd->dev, "fail to add max98390 woofer widgets, ret %d\n",
  401. ret);
  402. return ret;
  403. }
  404. ret = snd_soc_add_card_controls(card, maxim_2spk_kcontrols,
  405. ARRAY_SIZE(maxim_2spk_kcontrols));
  406. if (ret) {
  407. dev_err(rtd->dev, "fail to add max98390 woofer kcontrols, ret %d\n",
  408. ret);
  409. return ret;
  410. }
  411. ret = snd_soc_dapm_add_routes(&card->dapm, max_98390_dapm_routes,
  412. ARRAY_SIZE(max_98390_dapm_routes));
  413. if (ret) {
  414. dev_err(rtd->dev, "unable to add dapm routes, ret %d\n",
  415. ret);
  416. return ret;
  417. }
  418. break;
  419. default:
  420. dev_err(rtd->dev, "invalid codec number %d\n", num_codecs);
  421. return -EINVAL;
  422. }
  423. return ret;
  424. }
  425. static const struct snd_soc_ops max_98390_ops = {
  426. .hw_params = max_98390_hw_params,
  427. };
  428. void max_98390_dai_link(struct device *dev, struct snd_soc_dai_link *link)
  429. {
  430. unsigned int num_codecs = get_num_codecs(MAX_98390_ACPI_HID);
  431. link->codecs = max_98390_components;
  432. switch (num_codecs) {
  433. case 2:
  434. case 4:
  435. link->num_codecs = num_codecs;
  436. break;
  437. default:
  438. dev_err(dev, "invalid codec number %d for %s\n", num_codecs,
  439. MAX_98390_ACPI_HID);
  440. break;
  441. }
  442. link->init = max_98390_init;
  443. link->ops = &max_98390_ops;
  444. }
  445. EXPORT_SYMBOL_NS(max_98390_dai_link, SND_SOC_INTEL_SOF_MAXIM_COMMON);
  446. void max_98390_set_codec_conf(struct device *dev, struct snd_soc_card *card)
  447. {
  448. unsigned int num_codecs = get_num_codecs(MAX_98390_ACPI_HID);
  449. card->codec_conf = max_98390_codec_conf;
  450. switch (num_codecs) {
  451. case 2:
  452. if (soc_intel_is_cml())
  453. card->codec_conf = max_98390_cml_codec_conf;
  454. fallthrough;
  455. case 4:
  456. card->num_configs = num_codecs;
  457. break;
  458. default:
  459. dev_err(dev, "invalid codec number %d for %s\n", num_codecs,
  460. MAX_98390_ACPI_HID);
  461. break;
  462. }
  463. }
  464. EXPORT_SYMBOL_NS(max_98390_set_codec_conf, SND_SOC_INTEL_SOF_MAXIM_COMMON);
  465. /*
  466. * Maxim MAX98357A/MAX98360A
  467. */
  468. static const struct snd_kcontrol_new max_98357a_kcontrols[] = {
  469. SOC_DAPM_PIN_SWITCH("Spk"),
  470. };
  471. static const struct snd_soc_dapm_widget max_98357a_dapm_widgets[] = {
  472. SND_SOC_DAPM_SPK("Spk", NULL),
  473. };
  474. static const struct snd_soc_dapm_route max_98357a_dapm_routes[] = {
  475. /* speaker */
  476. {"Spk", NULL, "Speaker"},
  477. };
  478. static struct snd_soc_dai_link_component max_98357a_components[] = {
  479. {
  480. .name = MAX_98357A_DEV0_NAME,
  481. .dai_name = MAX_98357A_CODEC_DAI,
  482. }
  483. };
  484. static struct snd_soc_dai_link_component max_98360a_components[] = {
  485. {
  486. .name = MAX_98360A_DEV0_NAME,
  487. .dai_name = MAX_98357A_CODEC_DAI,
  488. }
  489. };
  490. static int max_98357a_init(struct snd_soc_pcm_runtime *rtd)
  491. {
  492. struct snd_soc_card *card = rtd->card;
  493. int ret;
  494. ret = snd_soc_dapm_new_controls(&card->dapm, max_98357a_dapm_widgets,
  495. ARRAY_SIZE(max_98357a_dapm_widgets));
  496. if (ret) {
  497. dev_err(rtd->dev, "unable to add dapm controls, ret %d\n", ret);
  498. /* Don't need to add routes if widget addition failed */
  499. return ret;
  500. }
  501. ret = snd_soc_add_card_controls(card, max_98357a_kcontrols,
  502. ARRAY_SIZE(max_98357a_kcontrols));
  503. if (ret) {
  504. dev_err(rtd->dev, "unable to add card controls, ret %d\n", ret);
  505. return ret;
  506. }
  507. ret = snd_soc_dapm_add_routes(&card->dapm, max_98357a_dapm_routes,
  508. ARRAY_SIZE(max_98357a_dapm_routes));
  509. if (ret)
  510. dev_err(rtd->dev, "unable to add dapm routes, ret %d\n", ret);
  511. return ret;
  512. }
  513. void max_98357a_dai_link(struct snd_soc_dai_link *link)
  514. {
  515. link->codecs = max_98357a_components;
  516. link->num_codecs = ARRAY_SIZE(max_98357a_components);
  517. link->init = max_98357a_init;
  518. }
  519. EXPORT_SYMBOL_NS(max_98357a_dai_link, SND_SOC_INTEL_SOF_MAXIM_COMMON);
  520. void max_98360a_dai_link(struct snd_soc_dai_link *link)
  521. {
  522. link->codecs = max_98360a_components;
  523. link->num_codecs = ARRAY_SIZE(max_98360a_components);
  524. link->init = max_98357a_init;
  525. }
  526. EXPORT_SYMBOL_NS(max_98360a_dai_link, SND_SOC_INTEL_SOF_MAXIM_COMMON);
  527. MODULE_DESCRIPTION("ASoC Intel SOF Maxim helpers");
  528. MODULE_LICENSE("GPL");