1 // SPDX-License-Identifier: GPL-2.0-only
2 // Copyright (c) 2020 Intel Corporation
5 * sof_sdw - ASOC Machine driver for Intel SoundWire platforms
8 #include <linux/device.h>
10 #include <linux/module.h>
11 #include <linux/soundwire/sdw.h>
12 #include <linux/soundwire/sdw_type.h>
13 #include <sound/soc.h>
14 #include <sound/soc-acpi.h>
15 #include "sof_sdw_common.h"
16 #include "../../codecs/rt711.h"
18 unsigned long sof_sdw_quirk = RT711_JD1;
19 static int quirk_override = -1;
20 module_param_named(quirk, quirk_override, int, 0444);
21 MODULE_PARM_DESC(quirk, "Board-specific quirk override");
23 #define INC_ID(BE, CPU, LINK) do { (BE)++; (CPU)++; (LINK)++; } while (0)
25 static void log_quirks(struct device *dev)
27 if (SOF_RT711_JDSRC(sof_sdw_quirk))
28 dev_dbg(dev, "quirk realtek,jack-detect-source %ld\n",
29 SOF_RT711_JDSRC(sof_sdw_quirk));
30 if (sof_sdw_quirk & SOF_SDW_FOUR_SPK)
31 dev_dbg(dev, "quirk SOF_SDW_FOUR_SPK enabled\n");
32 if (sof_sdw_quirk & SOF_SDW_TGL_HDMI)
33 dev_dbg(dev, "quirk SOF_SDW_TGL_HDMI enabled\n");
34 if (sof_sdw_quirk & SOF_SDW_PCH_DMIC)
35 dev_dbg(dev, "quirk SOF_SDW_PCH_DMIC enabled\n");
36 if (SOF_SSP_GET_PORT(sof_sdw_quirk))
37 dev_dbg(dev, "SSP port %ld\n",
38 SOF_SSP_GET_PORT(sof_sdw_quirk));
39 if (sof_sdw_quirk & SOF_SDW_NO_AGGREGATION)
40 dev_dbg(dev, "quirk SOF_SDW_NO_AGGREGATION enabled\n");
43 static int sof_sdw_quirk_cb(const struct dmi_system_id *id)
45 sof_sdw_quirk = (unsigned long)id->driver_data;
49 static const struct dmi_system_id sof_sdw_quirk_table[] = {
50 /* CometLake devices */
52 .callback = sof_sdw_quirk_cb,
54 DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
55 DMI_MATCH(DMI_PRODUCT_NAME, "CometLake Client"),
57 .driver_data = (void *)SOF_SDW_PCH_DMIC,
60 .callback = sof_sdw_quirk_cb,
62 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
63 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "09C6")
65 .driver_data = (void *)RT711_JD2,
68 /* early version of SKU 09C6 */
69 .callback = sof_sdw_quirk_cb,
71 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
72 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0983")
74 .driver_data = (void *)RT711_JD2,
77 .callback = sof_sdw_quirk_cb,
79 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
80 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "098F"),
82 .driver_data = (void *)(RT711_JD2 |
86 .callback = sof_sdw_quirk_cb,
88 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
89 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0990"),
91 .driver_data = (void *)(RT711_JD2 |
96 .callback = sof_sdw_quirk_cb,
98 DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
99 DMI_MATCH(DMI_PRODUCT_NAME, "Ice Lake Client"),
101 .driver_data = (void *)SOF_SDW_PCH_DMIC,
103 /* TigerLake devices */
105 .callback = sof_sdw_quirk_cb,
107 DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
108 DMI_MATCH(DMI_PRODUCT_NAME,
109 "Tiger Lake Client Platform"),
111 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
114 SOF_SSP_PORT(SOF_I2S_SSP2)),
117 .callback = sof_sdw_quirk_cb,
119 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
120 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A3E")
122 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
126 /* another SKU of Dell Latitude 9520 */
127 .callback = sof_sdw_quirk_cb,
129 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
130 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A3F")
132 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
137 .callback = sof_sdw_quirk_cb,
139 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
140 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A5D")
142 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
147 .callback = sof_sdw_quirk_cb,
149 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
150 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A5E")
152 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
157 .callback = sof_sdw_quirk_cb,
159 DMI_MATCH(DMI_SYS_VENDOR, "Google"),
160 DMI_MATCH(DMI_PRODUCT_NAME, "Volteer"),
162 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
165 SOF_BT_OFFLOAD_SSP(2) |
166 SOF_SSP_BT_OFFLOAD_PRESENT),
169 .callback = sof_sdw_quirk_cb,
171 DMI_MATCH(DMI_SYS_VENDOR, "Google"),
172 DMI_MATCH(DMI_PRODUCT_NAME, "Ripto"),
174 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
180 * this entry covers multiple HP SKUs. The family name
181 * does not seem robust enough, so we use a partial
182 * match that ignores the product name suffix
183 * (e.g. 15-eb1xxx, 14t-ea000 or 13-aw2xxx)
185 .callback = sof_sdw_quirk_cb,
187 DMI_MATCH(DMI_SYS_VENDOR, "HP"),
188 DMI_MATCH(DMI_PRODUCT_NAME, "HP Spectre x360 Conv"),
190 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
195 /* NUC15 'Bishop County' LAPBC510 and LAPBC710 skews */
196 .callback = sof_sdw_quirk_cb,
198 DMI_MATCH(DMI_SYS_VENDOR, "Intel(R) Client Systems"),
199 DMI_MATCH(DMI_PRODUCT_NAME, "LAPBC"),
201 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
206 /* NUC15 LAPBC710 skews */
207 .callback = sof_sdw_quirk_cb,
209 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
210 DMI_MATCH(DMI_BOARD_NAME, "LAPBC710"),
212 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
217 /* NUC15 'Rooks County' LAPRC510 and LAPRC710 skews */
218 .callback = sof_sdw_quirk_cb,
220 DMI_MATCH(DMI_SYS_VENDOR, "Intel(R) Client Systems"),
221 DMI_MATCH(DMI_PRODUCT_NAME, "LAPRC"),
223 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
227 /* TigerLake-SDCA devices */
229 .callback = sof_sdw_quirk_cb,
231 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
232 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A32")
234 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
239 .callback = sof_sdw_quirk_cb,
241 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
242 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A45")
244 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
247 /* AlderLake devices */
249 .callback = sof_sdw_quirk_cb,
251 DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
252 DMI_MATCH(DMI_PRODUCT_NAME, "Alder Lake Client Platform"),
254 .driver_data = (void *)(RT711_JD2_100K |
256 SOF_BT_OFFLOAD_SSP(2) |
257 SOF_SSP_BT_OFFLOAD_PRESENT),
260 .callback = sof_sdw_quirk_cb,
262 DMI_MATCH(DMI_SYS_VENDOR, "Google"),
263 DMI_MATCH(DMI_PRODUCT_NAME, "Brya"),
265 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
268 SOF_BT_OFFLOAD_SSP(2) |
269 SOF_SSP_BT_OFFLOAD_PRESENT),
272 .callback = sof_sdw_quirk_cb,
274 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
275 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0AF0")
277 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
282 .callback = sof_sdw_quirk_cb,
284 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
285 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0AF3"),
288 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
292 .callback = sof_sdw_quirk_cb,
294 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
295 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0AFF")
297 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
302 .callback = sof_sdw_quirk_cb,
304 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
305 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B00")
307 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
312 .callback = sof_sdw_quirk_cb,
314 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
315 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B01")
317 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
322 .callback = sof_sdw_quirk_cb,
324 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
325 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B11")
327 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
332 .callback = sof_sdw_quirk_cb,
334 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
335 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B12")
337 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
342 .callback = sof_sdw_quirk_cb,
344 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
345 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B13"),
348 .driver_data = (void *)SOF_SDW_TGL_HDMI,
351 .callback = sof_sdw_quirk_cb,
353 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
354 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B29"),
356 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
361 .callback = sof_sdw_quirk_cb,
363 DMI_MATCH(DMI_SYS_VENDOR, "HP"),
364 DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16-k0xxx"),
366 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
369 /* RaptorLake devices */
371 .callback = sof_sdw_quirk_cb,
373 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
374 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C10"),
377 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
381 .callback = sof_sdw_quirk_cb,
383 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
384 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C11")
386 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
391 .callback = sof_sdw_quirk_cb,
393 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
394 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C40")
396 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
401 .callback = sof_sdw_quirk_cb,
403 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
404 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C4F")
406 .driver_data = (void *)(SOF_SDW_TGL_HDMI |
410 /* MeteorLake devices */
412 .callback = sof_sdw_quirk_cb,
414 DMI_MATCH(DMI_PRODUCT_FAMILY, "Intel_mtlrvp"),
416 .driver_data = (void *)(RT711_JD1 | SOF_SDW_TGL_HDMI),
421 static struct snd_soc_dai_link_component dmic_component[] = {
423 .name = "dmic-codec",
424 .dai_name = "dmic-hifi",
428 static struct snd_soc_dai_link_component platform_component[] = {
430 /* name might be overridden during probe */
431 .name = "0000:00:1f.3"
435 /* these wrappers are only needed to avoid typecast compilation errors */
436 int sdw_startup(struct snd_pcm_substream *substream)
438 return sdw_startup_stream(substream);
441 int sdw_prepare(struct snd_pcm_substream *substream)
443 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
444 struct sdw_stream_runtime *sdw_stream;
445 struct snd_soc_dai *dai;
447 /* Find stream from first CPU DAI */
448 dai = asoc_rtd_to_cpu(rtd, 0);
450 sdw_stream = snd_soc_dai_get_stream(dai, substream->stream);
452 if (IS_ERR(sdw_stream)) {
453 dev_err(rtd->dev, "no stream found for DAI %s", dai->name);
454 return PTR_ERR(sdw_stream);
457 return sdw_prepare_stream(sdw_stream);
460 int sdw_trigger(struct snd_pcm_substream *substream, int cmd)
462 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
463 struct sdw_stream_runtime *sdw_stream;
464 struct snd_soc_dai *dai;
467 /* Find stream from first CPU DAI */
468 dai = asoc_rtd_to_cpu(rtd, 0);
470 sdw_stream = snd_soc_dai_get_stream(dai, substream->stream);
472 if (IS_ERR(sdw_stream)) {
473 dev_err(rtd->dev, "no stream found for DAI %s", dai->name);
474 return PTR_ERR(sdw_stream);
478 case SNDRV_PCM_TRIGGER_START:
479 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
480 case SNDRV_PCM_TRIGGER_RESUME:
481 ret = sdw_enable_stream(sdw_stream);
484 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
485 case SNDRV_PCM_TRIGGER_SUSPEND:
486 case SNDRV_PCM_TRIGGER_STOP:
487 ret = sdw_disable_stream(sdw_stream);
495 dev_err(rtd->dev, "%s trigger %d failed: %d", __func__, cmd, ret);
500 int sdw_hw_free(struct snd_pcm_substream *substream)
502 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
503 struct sdw_stream_runtime *sdw_stream;
504 struct snd_soc_dai *dai;
506 /* Find stream from first CPU DAI */
507 dai = asoc_rtd_to_cpu(rtd, 0);
509 sdw_stream = snd_soc_dai_get_stream(dai, substream->stream);
511 if (IS_ERR(sdw_stream)) {
512 dev_err(rtd->dev, "no stream found for DAI %s", dai->name);
513 return PTR_ERR(sdw_stream);
516 return sdw_deprepare_stream(sdw_stream);
519 void sdw_shutdown(struct snd_pcm_substream *substream)
521 sdw_shutdown_stream(substream);
524 static const struct snd_soc_ops sdw_ops = {
525 .startup = sdw_startup,
526 .prepare = sdw_prepare,
527 .trigger = sdw_trigger,
528 .hw_free = sdw_hw_free,
529 .shutdown = sdw_shutdown,
532 static struct sof_sdw_codec_info codec_info_list[] = {
535 .direction = {true, true},
536 .dai_name = "rt700-aif1",
537 .init = sof_sdw_rt700_init,
538 .codec_type = SOF_SDW_CODEC_TYPE_JACK,
543 .direction = {true, true},
544 .dai_name = "rt711-sdca-aif1",
545 .init = sof_sdw_rt711_sdca_init,
546 .exit = sof_sdw_rt711_sdca_exit,
547 .codec_type = SOF_SDW_CODEC_TYPE_JACK,
552 .direction = {true, true},
553 .dai_name = "rt711-aif1",
554 .init = sof_sdw_rt711_init,
555 .exit = sof_sdw_rt711_exit,
556 .codec_type = SOF_SDW_CODEC_TYPE_JACK,
560 .acpi_id = "10EC1308",
561 .direction = {true, false},
562 .dai_name = "rt1308-aif",
563 .ops = &sof_sdw_rt1308_i2s_ops,
564 .init = sof_sdw_rt_amp_init,
565 .exit = sof_sdw_rt_amp_exit,
566 .codec_type = SOF_SDW_CODEC_TYPE_AMP,
570 .direction = {true, true},
571 .dai_name = "rt1316-aif",
572 .init = sof_sdw_rt_amp_init,
573 .exit = sof_sdw_rt_amp_exit,
574 .codec_type = SOF_SDW_CODEC_TYPE_AMP,
578 .direction = {true, true},
579 .dai_name = "rt1318-aif",
580 .init = sof_sdw_rt_amp_init,
581 .codec_type = SOF_SDW_CODEC_TYPE_AMP,
586 .direction = {false, true},
587 .ignore_pch_dmic = true,
588 .dai_name = "rt715-aif2",
589 .init = sof_sdw_rt715_sdca_init,
590 .codec_type = SOF_SDW_CODEC_TYPE_MIC,
595 .direction = {false, true},
596 .ignore_pch_dmic = true,
597 .dai_name = "rt715-aif2",
598 .init = sof_sdw_rt715_sdca_init,
599 .codec_type = SOF_SDW_CODEC_TYPE_MIC,
604 .direction = {false, true},
605 .ignore_pch_dmic = true,
606 .dai_name = "rt715-aif2",
607 .init = sof_sdw_rt715_init,
608 .codec_type = SOF_SDW_CODEC_TYPE_MIC,
613 .direction = {false, true},
614 .ignore_pch_dmic = true,
615 .dai_name = "rt715-aif2",
616 .init = sof_sdw_rt715_init,
617 .codec_type = SOF_SDW_CODEC_TYPE_MIC,
621 .direction = {true, true},
622 .dai_name = "max98373-aif1",
623 .init = sof_sdw_mx8373_init,
624 .codec_card_late_probe = sof_sdw_mx8373_late_probe,
625 .codec_type = SOF_SDW_CODEC_TYPE_AMP,
629 .direction = {true, true},
630 .dai_name = "rt5682-sdw",
631 .init = sof_sdw_rt5682_init,
632 .codec_type = SOF_SDW_CODEC_TYPE_JACK,
635 .part_id = 0xaaaa, /* generic codec mockup */
637 .direction = {true, true},
638 .dai_name = "sdw-mockup-aif1",
640 .codec_type = SOF_SDW_CODEC_TYPE_JACK,
643 .part_id = 0xaa55, /* headset codec mockup */
645 .direction = {true, true},
646 .dai_name = "sdw-mockup-aif1",
648 .codec_type = SOF_SDW_CODEC_TYPE_JACK,
651 .part_id = 0x55aa, /* amplifier mockup */
653 .direction = {true, false},
654 .dai_name = "sdw-mockup-aif1",
656 .codec_type = SOF_SDW_CODEC_TYPE_AMP,
661 .direction = {false, true},
662 .dai_name = "sdw-mockup-aif1",
663 .codec_type = SOF_SDW_CODEC_TYPE_MIC,
667 static inline int find_codec_info_part(u64 adr)
669 unsigned int part_id, sdw_version;
672 part_id = SDW_PART_ID(adr);
673 sdw_version = SDW_VERSION(adr);
674 for (i = 0; i < ARRAY_SIZE(codec_info_list); i++)
676 * A codec info is for all sdw version with the part id if
677 * version_id is not specified in the codec info.
679 if (part_id == codec_info_list[i].part_id &&
680 (!codec_info_list[i].version_id ||
681 sdw_version == codec_info_list[i].version_id))
688 static inline int find_codec_info_acpi(const u8 *acpi_id)
695 for (i = 0; i < ARRAY_SIZE(codec_info_list); i++)
696 if (!memcmp(codec_info_list[i].acpi_id, acpi_id,
700 if (i == ARRAY_SIZE(codec_info_list))
707 * get BE dailink number and CPU DAI number based on sdw link adr.
708 * Since some sdw slaves may be aggregated, the CPU DAI number
709 * may be larger than the number of BE dailinks.
711 static int get_sdw_dailink_info(struct device *dev, const struct snd_soc_acpi_link_adr *links,
712 int *sdw_be_num, int *sdw_cpu_dai_num)
714 const struct snd_soc_acpi_link_adr *link;
715 int _codec_type = SOF_SDW_CODEC_TYPE_JACK;
716 bool group_visited[SDW_MAX_GROUPS];
720 no_aggregation = sof_sdw_quirk & SOF_SDW_NO_AGGREGATION;
721 *sdw_cpu_dai_num = 0;
727 for (i = 0; i < SDW_MAX_GROUPS; i++)
728 group_visited[i] = false;
730 for (link = links; link->num_adr; link++) {
731 const struct snd_soc_acpi_endpoint *endpoint;
736 adr = link->adr_d->adr;
737 codec_index = find_codec_info_part(adr);
741 if (codec_info_list[codec_index].codec_type < _codec_type)
743 "Unexpected address table ordering. Expected order: jack -> amp -> mic\n");
745 _codec_type = codec_info_list[codec_index].codec_type;
747 endpoint = link->adr_d->endpoints;
749 /* count DAI number for playback and capture */
750 for_each_pcm_streams(stream) {
751 if (!codec_info_list[codec_index].direction[stream])
754 (*sdw_cpu_dai_num)++;
756 /* count BE for each non-aggregated slave or group */
757 if (!endpoint->aggregated || no_aggregation ||
758 !group_visited[endpoint->group_id])
762 if (endpoint->aggregated)
763 group_visited[endpoint->group_id] = true;
769 static void init_dai_link(struct device *dev, struct snd_soc_dai_link *dai_links,
770 int be_id, char *name, int playback, int capture,
771 struct snd_soc_dai_link_component *cpus, int cpus_num,
772 struct snd_soc_dai_link_component *codecs, int codecs_num,
773 int (*init)(struct snd_soc_pcm_runtime *rtd),
774 const struct snd_soc_ops *ops)
776 dev_dbg(dev, "create dai link %s, id %d\n", name, be_id);
777 dai_links->id = be_id;
778 dai_links->name = name;
779 dai_links->platforms = platform_component;
780 dai_links->num_platforms = ARRAY_SIZE(platform_component);
781 dai_links->no_pcm = 1;
782 dai_links->cpus = cpus;
783 dai_links->num_cpus = cpus_num;
784 dai_links->codecs = codecs;
785 dai_links->num_codecs = codecs_num;
786 dai_links->dpcm_playback = playback;
787 dai_links->dpcm_capture = capture;
788 dai_links->init = init;
789 dai_links->ops = ops;
792 static bool is_unique_device(const struct snd_soc_acpi_link_adr *link,
793 unsigned int sdw_version,
795 unsigned int part_id,
796 unsigned int class_id,
802 for (i = 0; i < link->num_adr; i++) {
803 unsigned int sdw1_version, mfg1_id, part1_id, class1_id;
807 if (i == index_in_link)
810 adr = link->adr_d[i].adr;
812 sdw1_version = SDW_VERSION(adr);
813 mfg1_id = SDW_MFG_ID(adr);
814 part1_id = SDW_PART_ID(adr);
815 class1_id = SDW_CLASS_ID(adr);
817 if (sdw_version == sdw1_version &&
819 part_id == part1_id &&
820 class_id == class1_id)
827 static int create_codec_dai_name(struct device *dev,
828 const struct snd_soc_acpi_link_adr *link,
829 struct snd_soc_dai_link_component *codec,
831 struct snd_soc_codec_conf *codec_conf,
833 int *codec_conf_index)
838 if (*codec_conf_index + link->num_adr > codec_count) {
839 dev_err(dev, "codec_conf: out-of-bounds access requested\n");
843 for (i = 0; i < link->num_adr; i++) {
844 unsigned int sdw_version, unique_id, mfg_id;
845 unsigned int link_id, part_id, class_id;
846 int codec_index, comp_index;
850 adr = link->adr_d[i].adr;
852 sdw_version = SDW_VERSION(adr);
853 link_id = SDW_DISCO_LINK_ID(adr);
854 unique_id = SDW_UNIQUE_ID(adr);
855 mfg_id = SDW_MFG_ID(adr);
856 part_id = SDW_PART_ID(adr);
857 class_id = SDW_CLASS_ID(adr);
859 comp_index = i + offset;
860 if (is_unique_device(link, sdw_version, mfg_id, part_id,
862 codec_str = "sdw:%01x:%04x:%04x:%02x";
863 codec[comp_index].name =
864 devm_kasprintf(dev, GFP_KERNEL, codec_str,
865 link_id, mfg_id, part_id,
868 codec_str = "sdw:%01x:%04x:%04x:%02x:%01x";
869 codec[comp_index].name =
870 devm_kasprintf(dev, GFP_KERNEL, codec_str,
871 link_id, mfg_id, part_id,
872 class_id, unique_id);
875 if (!codec[comp_index].name)
878 codec_index = find_codec_info_part(adr);
882 codec[comp_index].dai_name =
883 codec_info_list[codec_index].dai_name;
885 codec_conf[*codec_conf_index].dlc = codec[comp_index];
886 codec_conf[*codec_conf_index].name_prefix = link->adr_d[i].name_prefix;
894 static int set_codec_init_func(struct snd_soc_card *card,
895 const struct snd_soc_acpi_link_adr *link,
896 struct snd_soc_dai_link *dai_links,
897 bool playback, int group_id)
903 * Initialize the codec. If codec is part of an aggregated
904 * group (group_id>0), initialize all codecs belonging to
907 for (i = 0; i < link->num_adr; i++) {
910 codec_index = find_codec_info_part(link->adr_d[i].adr);
914 /* The group_id is > 0 iff the codec is aggregated */
915 if (link->adr_d[i].endpoints->group_id != group_id)
917 if (codec_info_list[codec_index].init)
918 codec_info_list[codec_index].init(card,
921 &codec_info_list[codec_index],
925 } while (link->mask && group_id);
931 * check endpoint status in slaves and gather link ID for all slaves in
932 * the same group to generate different CPU DAI. Now only support
933 * one sdw link with all slaves set with only single group id.
935 * one slave on one sdw link with aggregated = 0
936 * one sdw BE DAI <---> one-cpu DAI <---> one-codec DAI
938 * two or more slaves on one sdw link with aggregated = 0
939 * one sdw BE DAI <---> one-cpu DAI <---> multi-codec DAIs
941 * multiple links with multiple slaves with aggregated = 1
942 * one sdw BE DAI <---> 1 .. N CPU DAIs <----> 1 .. N codec DAIs
944 static int get_slave_info(const struct snd_soc_acpi_link_adr *adr_link,
945 struct device *dev, int *cpu_dai_id, int *cpu_dai_num,
946 int *codec_num, unsigned int *group_id,
947 bool *group_generated)
949 const struct snd_soc_acpi_adr_device *adr_d;
950 const struct snd_soc_acpi_link_adr *adr_next;
954 no_aggregation = sof_sdw_quirk & SOF_SDW_NO_AGGREGATION;
955 *codec_num = adr_link->num_adr;
956 adr_d = adr_link->adr_d;
958 /* make sure the link mask has a single bit set */
959 if (!is_power_of_2(adr_link->mask))
962 cpu_dai_id[index++] = ffs(adr_link->mask) - 1;
963 if (!adr_d->endpoints->aggregated || no_aggregation) {
969 *group_id = adr_d->endpoints->group_id;
971 /* gather other link ID of slaves in the same group */
972 for (adr_next = adr_link + 1; adr_next && adr_next->num_adr;
974 const struct snd_soc_acpi_endpoint *endpoint;
976 endpoint = adr_next->adr_d->endpoints;
977 if (!endpoint->aggregated ||
978 endpoint->group_id != *group_id)
981 /* make sure the link mask has a single bit set */
982 if (!is_power_of_2(adr_next->mask))
985 if (index >= SDW_MAX_CPU_DAIS) {
986 dev_err(dev, " cpu_dai_id array overflows");
990 cpu_dai_id[index++] = ffs(adr_next->mask) - 1;
991 *codec_num += adr_next->num_adr;
995 * indicate CPU DAIs for this group have been generated
996 * to avoid generating CPU DAIs for this group again.
998 group_generated[*group_id] = true;
999 *cpu_dai_num = index;
1004 static int create_sdw_dailink(struct snd_soc_card *card,
1005 struct device *dev, int *link_index,
1006 struct snd_soc_dai_link *dai_links,
1007 int sdw_be_num, int sdw_cpu_dai_num,
1008 struct snd_soc_dai_link_component *cpus,
1009 const struct snd_soc_acpi_link_adr *link,
1010 int *cpu_id, bool *group_generated,
1011 struct snd_soc_codec_conf *codec_conf,
1012 int codec_count, int *link_id,
1013 int *codec_conf_index,
1014 bool *ignore_pch_dmic)
1016 const struct snd_soc_acpi_link_adr *link_next;
1017 struct snd_soc_dai_link_component *codecs;
1018 int cpu_dai_id[SDW_MAX_CPU_DAIS];
1019 int cpu_dai_num, cpu_dai_index;
1020 unsigned int group_id;
1029 ret = get_slave_info(link, dev, cpu_dai_id, &cpu_dai_num, &codec_num,
1030 &group_id, group_generated);
1034 codecs = devm_kcalloc(dev, codec_num, sizeof(*codecs), GFP_KERNEL);
1038 /* generate codec name on different links in the same group */
1039 for (link_next = link; link_next && link_next->num_adr &&
1040 i < cpu_dai_num; link_next++) {
1041 const struct snd_soc_acpi_endpoint *endpoints;
1043 endpoints = link_next->adr_d->endpoints;
1044 if (group_id && (!endpoints->aggregated ||
1045 endpoints->group_id != group_id))
1048 /* skip the link excluded by this processed group */
1049 if (cpu_dai_id[i] != ffs(link_next->mask) - 1)
1052 ret = create_codec_dai_name(dev, link_next, codecs, codec_idx,
1053 codec_conf, codec_count, codec_conf_index);
1057 /* check next link to create codec dai in the processed group */
1059 codec_idx += link_next->num_adr;
1062 /* find codec info to create BE DAI */
1063 codec_index = find_codec_info_part(link->adr_d[0].adr);
1064 if (codec_index < 0)
1067 if (codec_info_list[codec_index].ignore_pch_dmic)
1068 *ignore_pch_dmic = true;
1070 /* Shift the first amplifier's *link_id to SDW_AMP_DAI_ID */
1071 if (codec_info_list[codec_index].codec_type == SOF_SDW_CODEC_TYPE_AMP &&
1072 *link_id < SDW_AMP_DAI_ID)
1073 *link_id = SDW_AMP_DAI_ID;
1076 * DAI ID is fixed at SDW_DMIC_DAI_ID for MICs to
1077 * keep sdw DMIC and HDMI setting static in UCM
1079 if (codec_info_list[codec_index].codec_type == SOF_SDW_CODEC_TYPE_MIC &&
1080 *link_id < SDW_DMIC_DAI_ID)
1081 *link_id = SDW_DMIC_DAI_ID;
1083 cpu_dai_index = *cpu_id;
1084 for_each_pcm_streams(stream) {
1085 char *name, *cpu_name;
1086 int playback, capture;
1087 static const char * const sdw_stream_name[] = {
1092 if (!codec_info_list[codec_index].direction[stream])
1095 /* create stream name according to first link id */
1096 name = devm_kasprintf(dev, GFP_KERNEL,
1097 sdw_stream_name[stream], cpu_dai_id[0]);
1102 * generate CPU DAI name base on the sdw link ID and
1103 * PIN ID with offset of 2 according to sdw dai driver.
1105 for (k = 0; k < cpu_dai_num; k++) {
1106 cpu_name = devm_kasprintf(dev, GFP_KERNEL,
1107 "SDW%d Pin%d", cpu_dai_id[k],
1108 j + SDW_INTEL_BIDIR_PDI_BASE);
1112 if (cpu_dai_index >= sdw_cpu_dai_num) {
1113 dev_err(dev, "invalid cpu dai index %d",
1118 cpus[cpu_dai_index++].dai_name = cpu_name;
1122 * We create sdw dai links at first stage, so link index should
1123 * not be larger than sdw_be_num
1125 if (*link_index >= sdw_be_num) {
1126 dev_err(dev, "invalid dai link index %d", *link_index);
1130 if (*cpu_id >= sdw_cpu_dai_num) {
1131 dev_err(dev, " invalid cpu dai index %d", *cpu_id);
1135 playback = (stream == SNDRV_PCM_STREAM_PLAYBACK);
1136 capture = (stream == SNDRV_PCM_STREAM_CAPTURE);
1137 init_dai_link(dev, dai_links + *link_index, (*link_id)++, name,
1139 cpus + *cpu_id, cpu_dai_num,
1144 * SoundWire DAILINKs use 'stream' functions and Bank Switch operations
1145 * based on wait_for_completion(), tag them as 'nonatomic'.
1147 dai_links[*link_index].nonatomic = true;
1149 ret = set_codec_init_func(card, link, dai_links + (*link_index)++,
1150 playback, group_id);
1152 dev_err(dev, "failed to init codec %d", codec_index);
1156 *cpu_id += cpu_dai_num;
1163 #define IDISP_CODEC_MASK 0x4
1165 static int sof_card_codec_conf_alloc(struct device *dev,
1166 struct snd_soc_acpi_mach_params *mach_params,
1167 struct snd_soc_codec_conf **codec_conf,
1168 int *codec_conf_count)
1170 const struct snd_soc_acpi_link_adr *adr_link;
1171 struct snd_soc_codec_conf *c_conf;
1175 adr_link = mach_params->links;
1179 /* generate DAI links by each sdw link */
1180 for (; adr_link->num_adr; adr_link++) {
1181 for (i = 0; i < adr_link->num_adr; i++) {
1182 if (!adr_link->adr_d[i].name_prefix) {
1183 dev_err(dev, "codec 0x%llx does not have a name prefix\n",
1184 adr_link->adr_d[i].adr);
1188 num_codecs += adr_link->num_adr;
1191 c_conf = devm_kzalloc(dev, num_codecs * sizeof(*c_conf), GFP_KERNEL);
1195 *codec_conf = c_conf;
1196 *codec_conf_count = num_codecs;
1201 static int sof_card_dai_links_create(struct device *dev,
1202 struct snd_soc_acpi_mach *mach,
1203 struct snd_soc_card *card)
1205 int ssp_num, sdw_be_num = 0, hdmi_num = 0, dmic_num;
1206 struct mc_private *ctx = snd_soc_card_get_drvdata(card);
1207 struct snd_soc_dai_link_component *idisp_components;
1208 struct snd_soc_dai_link_component *ssp_components;
1209 struct snd_soc_acpi_mach_params *mach_params;
1210 const struct snd_soc_acpi_link_adr *adr_link;
1211 struct snd_soc_dai_link_component *cpus;
1212 struct snd_soc_codec_conf *codec_conf;
1213 bool ignore_pch_dmic = false;
1214 int codec_conf_count;
1215 int codec_conf_index = 0;
1216 bool group_generated[SDW_MAX_GROUPS];
1217 int ssp_codec_index, ssp_mask;
1218 struct snd_soc_dai_link *links;
1219 int num_links, link_index = 0;
1220 char *name, *cpu_name;
1221 int total_cpu_dai_num;
1222 int sdw_cpu_dai_num;
1223 int i, j, be_id = 0;
1228 mach_params = &mach->mach_params;
1230 /* allocate codec conf, will be populated when dailinks are created */
1231 ret = sof_card_codec_conf_alloc(dev, mach_params, &codec_conf, &codec_conf_count);
1235 /* reset amp_num to ensure amp_num++ starts from 0 in each probe */
1236 for (i = 0; i < ARRAY_SIZE(codec_info_list); i++)
1237 codec_info_list[i].amp_num = 0;
1239 if (mach_params->codec_mask & IDISP_CODEC_MASK) {
1240 ctx->idisp_codec = true;
1242 if (sof_sdw_quirk & SOF_SDW_TGL_HDMI)
1243 hdmi_num = SOF_TGL_HDMI_COUNT;
1245 hdmi_num = SOF_PRE_TGL_HDMI_COUNT;
1248 ssp_mask = SOF_SSP_GET_PORT(sof_sdw_quirk);
1250 * on generic tgl platform, I2S or sdw mode is supported
1251 * based on board rework. A ACPI device is registered in
1252 * system only when I2S mode is supported, not sdw mode.
1253 * Here check ACPI ID to confirm I2S is supported.
1255 ssp_codec_index = find_codec_info_acpi(mach->id);
1256 ssp_num = ssp_codec_index >= 0 ? hweight_long(ssp_mask) : 0;
1257 comp_num = hdmi_num + ssp_num;
1259 ret = get_sdw_dailink_info(dev, mach_params->links,
1260 &sdw_be_num, &sdw_cpu_dai_num);
1262 dev_err(dev, "failed to get sdw link info %d", ret);
1266 /* enable dmic01 & dmic16k */
1267 dmic_num = (sof_sdw_quirk & SOF_SDW_PCH_DMIC || mach_params->dmic_num) ? 2 : 0;
1268 comp_num += dmic_num;
1270 if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT)
1273 dev_dbg(dev, "sdw %d, ssp %d, dmic %d, hdmi %d", sdw_be_num, ssp_num,
1274 dmic_num, ctx->idisp_codec ? hdmi_num : 0);
1276 /* allocate BE dailinks */
1277 num_links = comp_num + sdw_be_num;
1278 links = devm_kcalloc(dev, num_links, sizeof(*links), GFP_KERNEL);
1280 /* allocated CPU DAIs */
1281 total_cpu_dai_num = comp_num + sdw_cpu_dai_num;
1282 cpus = devm_kcalloc(dev, total_cpu_dai_num, sizeof(*cpus),
1285 if (!links || !cpus)
1292 adr_link = mach_params->links;
1297 * SoundWire Slaves aggregated in the same group may be
1298 * located on different hardware links. Clear array to indicate
1299 * CPU DAIs for this group have not been generated.
1301 for (i = 0; i < SDW_MAX_GROUPS; i++)
1302 group_generated[i] = false;
1304 /* generate DAI links by each sdw link */
1305 for (; adr_link->num_adr; adr_link++) {
1306 const struct snd_soc_acpi_endpoint *endpoint;
1308 endpoint = adr_link->adr_d->endpoints;
1309 if (endpoint->aggregated && !endpoint->group_id) {
1310 dev_err(dev, "invalid group id on link %x",
1315 /* this group has been generated */
1316 if (endpoint->aggregated &&
1317 group_generated[endpoint->group_id])
1320 ret = create_sdw_dailink(card, dev, &link_index, links, sdw_be_num,
1321 sdw_cpu_dai_num, cpus, adr_link,
1322 &cpu_id, group_generated,
1323 codec_conf, codec_conf_count,
1324 &be_id, &codec_conf_index,
1327 dev_err(dev, "failed to create dai link %d", link_index);
1337 for (i = 0, j = 0; ssp_mask; i++, ssp_mask >>= 1) {
1338 struct sof_sdw_codec_info *info;
1339 int playback, capture;
1342 if (!(ssp_mask & 0x1))
1345 name = devm_kasprintf(dev, GFP_KERNEL,
1350 cpu_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", i);
1354 ssp_components = devm_kzalloc(dev, sizeof(*ssp_components),
1356 if (!ssp_components)
1359 info = &codec_info_list[ssp_codec_index];
1360 codec_name = devm_kasprintf(dev, GFP_KERNEL, "i2c-%s:0%d",
1361 info->acpi_id, j++);
1365 ssp_components->name = codec_name;
1366 ssp_components->dai_name = info->dai_name;
1367 cpus[cpu_id].dai_name = cpu_name;
1369 playback = info->direction[SNDRV_PCM_STREAM_PLAYBACK];
1370 capture = info->direction[SNDRV_PCM_STREAM_CAPTURE];
1371 init_dai_link(dev, links + link_index, be_id, name,
1377 ret = info->init(card, NULL, links + link_index, info, 0);
1381 INC_ID(be_id, cpu_id, link_index);
1387 if (ignore_pch_dmic) {
1388 dev_warn(dev, "Ignoring PCH DMIC\n");
1391 cpus[cpu_id].dai_name = "DMIC01 Pin";
1392 init_dai_link(dev, links + link_index, be_id, "dmic01",
1393 0, 1, // DMIC only supports capture
1396 sof_sdw_dmic_init, NULL);
1397 INC_ID(be_id, cpu_id, link_index);
1399 cpus[cpu_id].dai_name = "DMIC16k Pin";
1400 init_dai_link(dev, links + link_index, be_id, "dmic16k",
1401 0, 1, // DMIC only supports capture
1404 /* don't call sof_sdw_dmic_init() twice */
1406 INC_ID(be_id, cpu_id, link_index);
1412 idisp_components = devm_kcalloc(dev, hdmi_num,
1413 sizeof(*idisp_components),
1415 if (!idisp_components)
1419 for (i = 0; i < hdmi_num; i++) {
1420 name = devm_kasprintf(dev, GFP_KERNEL,
1425 if (ctx->idisp_codec) {
1426 idisp_components[i].name = "ehdaudio0D2";
1427 idisp_components[i].dai_name = devm_kasprintf(dev,
1429 "intel-hdmi-hifi%d",
1431 if (!idisp_components[i].dai_name)
1434 idisp_components[i].name = "snd-soc-dummy";
1435 idisp_components[i].dai_name = "snd-soc-dummy-dai";
1438 cpu_name = devm_kasprintf(dev, GFP_KERNEL,
1439 "iDisp%d Pin", i + 1);
1443 cpus[cpu_id].dai_name = cpu_name;
1444 init_dai_link(dev, links + link_index, be_id, name,
1445 1, 0, // HDMI only supports playback
1447 idisp_components + i, 1,
1448 sof_sdw_hdmi_init, NULL);
1449 INC_ID(be_id, cpu_id, link_index);
1452 if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT) {
1453 int port = (sof_sdw_quirk & SOF_BT_OFFLOAD_SSP_MASK) >>
1454 SOF_BT_OFFLOAD_SSP_SHIFT;
1456 name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-BT", port);
1460 ssp_components = devm_kzalloc(dev, sizeof(*ssp_components),
1462 if (!ssp_components)
1465 ssp_components->name = "snd-soc-dummy";
1466 ssp_components->dai_name = "snd-soc-dummy-dai";
1468 cpu_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", port);
1472 cpus[cpu_id].dai_name = cpu_name;
1473 init_dai_link(dev, links + link_index, be_id, name, 1, 1,
1474 cpus + cpu_id, 1, ssp_components, 1, NULL, NULL);
1477 card->dai_link = links;
1478 card->num_links = num_links;
1480 card->codec_conf = codec_conf;
1481 card->num_configs = codec_conf_count;
1486 static int sof_sdw_card_late_probe(struct snd_soc_card *card)
1488 struct mc_private *ctx = snd_soc_card_get_drvdata(card);
1492 for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) {
1493 if (!codec_info_list[i].late_probe)
1496 ret = codec_info_list[i].codec_card_late_probe(card);
1501 if (ctx->idisp_codec)
1502 ret = sof_sdw_hdmi_card_late_probe(card);
1508 static const char sdw_card_long_name[] = "Intel Soundwire SOF";
1510 static struct snd_soc_card card_sof_sdw = {
1511 .name = "soundwire",
1512 .owner = THIS_MODULE,
1513 .late_probe = sof_sdw_card_late_probe,
1516 static void mc_dailink_exit_loop(struct snd_soc_card *card)
1518 struct snd_soc_dai_link *link;
1522 for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) {
1523 if (!codec_info_list[i].exit)
1526 * We don't need to call .exit function if there is no matched
1529 for_each_card_prelinks(card, j, link) {
1530 if (!strcmp(link->codecs[0].dai_name,
1531 codec_info_list[i].dai_name)) {
1532 ret = codec_info_list[i].exit(card, link);
1535 "codec exit failed %d\n",
1543 static int mc_probe(struct platform_device *pdev)
1545 struct snd_soc_card *card = &card_sof_sdw;
1546 struct snd_soc_acpi_mach *mach;
1547 struct mc_private *ctx;
1551 dev_dbg(&pdev->dev, "Entry\n");
1553 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
1557 dmi_check_system(sof_sdw_quirk_table);
1559 if (quirk_override != -1) {
1560 dev_info(&pdev->dev, "Overriding quirk 0x%lx => 0x%x\n",
1561 sof_sdw_quirk, quirk_override);
1562 sof_sdw_quirk = quirk_override;
1564 log_quirks(&pdev->dev);
1566 INIT_LIST_HEAD(&ctx->hdmi_pcm_list);
1568 card->dev = &pdev->dev;
1569 snd_soc_card_set_drvdata(card, ctx);
1571 mach = pdev->dev.platform_data;
1572 ret = sof_card_dai_links_create(&pdev->dev, mach,
1578 * the default amp_num is zero for each codec and
1579 * amp_num will only be increased for active amp
1580 * codecs on used platform
1582 for (i = 0; i < ARRAY_SIZE(codec_info_list); i++)
1583 amp_num += codec_info_list[i].amp_num;
1585 card->components = devm_kasprintf(card->dev, GFP_KERNEL,
1586 "cfg-spk:%d cfg-amp:%d",
1587 (sof_sdw_quirk & SOF_SDW_FOUR_SPK)
1589 if (!card->components)
1592 if (mach->mach_params.dmic_num) {
1593 card->components = devm_kasprintf(card->dev, GFP_KERNEL,
1594 "%s mic:dmic cfg-mics:%d",
1596 mach->mach_params.dmic_num);
1597 if (!card->components)
1601 card->long_name = sdw_card_long_name;
1603 /* Register the card */
1604 ret = devm_snd_soc_register_card(&pdev->dev, card);
1606 dev_err(card->dev, "snd_soc_register_card failed %d\n", ret);
1607 mc_dailink_exit_loop(card);
1611 platform_set_drvdata(pdev, card);
1616 static void mc_remove(struct platform_device *pdev)
1618 struct snd_soc_card *card = platform_get_drvdata(pdev);
1620 mc_dailink_exit_loop(card);
1623 static struct platform_driver sof_sdw_driver = {
1626 .pm = &snd_soc_pm_ops,
1629 .remove_new = mc_remove,
1632 module_platform_driver(sof_sdw_driver);
1634 MODULE_DESCRIPTION("ASoC SoundWire Generic Machine driver");
1635 MODULE_AUTHOR("Bard Liao <yung-chuan.liao@linux.intel.com>");
1636 MODULE_AUTHOR("Rander Wang <rander.wang@linux.intel.com>");
1637 MODULE_AUTHOR("Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>");
1638 MODULE_LICENSE("GPL v2");
1639 MODULE_ALIAS("platform:sof_sdw");
1640 MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON);
1641 MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_MAXIM_COMMON);