Skip to content

Commit 0ccac3b

Browse files
plbossartbroonie
authored andcommitted
ASoC: Intel: boards: sof_sdw: add SoundWire mockup codecs for tests
Add support for SoundWire mockup devices. The configurations assume the same topology as the CML SoundWire devices and can be used to test the SOF firmware on a development board (RVP, UpExtreme) without any hardware connected. Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Rander Wang <[email protected]> Signed-off-by: Bard Liao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 3025d39 commit 0ccac3b

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

sound/soc/intel/boards/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH
602602
select SND_SOC_DMIC
603603
select SND_SOC_INTEL_HDA_DSP_COMMON
604604
select SND_SOC_INTEL_SOF_MAXIM_COMMON
605+
select SND_SOC_SDW_MOCKUP
605606
help
606607
Add support for Intel SoundWire-based platforms connected to
607608
MAX98373, RT700, RT711, RT1308 and RT715

sound/soc/intel/boards/sof_sdw.c

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,19 @@ static const struct snd_soc_ops sdw_ops = {
328328
.shutdown = sdw_shutdown,
329329
};
330330

331+
static int sof_sdw_mic_codec_mockup_init(const struct snd_soc_acpi_link_adr *link,
332+
struct snd_soc_dai_link *dai_links,
333+
struct sof_sdw_codec_info *info,
334+
bool playback)
335+
{
336+
/*
337+
* force DAI link to use same ID as RT715 and DMIC
338+
* to reuse topologies
339+
*/
340+
dai_links->id = SDW_DMIC_DAI_ID;
341+
return 0;
342+
}
343+
331344
static struct sof_sdw_codec_info codec_info_list[] = {
332345
{
333346
.part_id = 0x700,
@@ -410,6 +423,34 @@ static struct sof_sdw_codec_info codec_info_list[] = {
410423
.dai_name = "rt5682-sdw",
411424
.init = sof_sdw_rt5682_init,
412425
},
426+
{
427+
.part_id = 0xaaaa, /* generic codec mockup */
428+
.version_id = 0,
429+
.direction = {true, true},
430+
.dai_name = "sdw-mockup-aif1",
431+
.init = NULL,
432+
},
433+
{
434+
.part_id = 0xaa55, /* headset codec mockup */
435+
.version_id = 0,
436+
.direction = {true, true},
437+
.dai_name = "sdw-mockup-aif1",
438+
.init = NULL,
439+
},
440+
{
441+
.part_id = 0x55aa, /* amplifier mockup */
442+
.version_id = 0,
443+
.direction = {true, false},
444+
.dai_name = "sdw-mockup-aif1",
445+
.init = NULL,
446+
},
447+
{
448+
.part_id = 0x5555,
449+
.version_id = 0,
450+
.direction = {false, true},
451+
.dai_name = "sdw-mockup-aif1",
452+
.init = sof_sdw_mic_codec_mockup_init,
453+
},
413454
};
414455

415456
static inline int find_codec_info_part(u64 adr)

0 commit comments

Comments
 (0)