Unverified Commit 0ccac3bc authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown
Browse files

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: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarRander Wang <rander.wang@intel.com>
Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210714032209.11284-5-yung-chuan.liao@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3025d398
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -602,6 +602,7 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH
	select SND_SOC_DMIC
	select SND_SOC_INTEL_HDA_DSP_COMMON
	select SND_SOC_INTEL_SOF_MAXIM_COMMON
	select SND_SOC_SDW_MOCKUP
	help
	  Add support for Intel SoundWire-based platforms connected to
	  MAX98373, RT700, RT711, RT1308 and RT715
+41 −0
Original line number Diff line number Diff line
@@ -328,6 +328,19 @@ static const struct snd_soc_ops sdw_ops = {
	.shutdown = sdw_shutdown,
};

static int sof_sdw_mic_codec_mockup_init(const struct snd_soc_acpi_link_adr *link,
					 struct snd_soc_dai_link *dai_links,
					 struct sof_sdw_codec_info *info,
					 bool playback)
{
	/*
	 * force DAI link to use same ID as RT715 and DMIC
	 * to reuse topologies
	 */
	dai_links->id = SDW_DMIC_DAI_ID;
	return 0;
}

static struct sof_sdw_codec_info codec_info_list[] = {
	{
		.part_id = 0x700,
@@ -410,6 +423,34 @@ static struct sof_sdw_codec_info codec_info_list[] = {
		.dai_name = "rt5682-sdw",
		.init = sof_sdw_rt5682_init,
	},
	{
		.part_id = 0xaaaa, /* generic codec mockup */
		.version_id = 0,
		.direction = {true, true},
		.dai_name = "sdw-mockup-aif1",
		.init = NULL,
	},
	{
		.part_id = 0xaa55, /* headset codec mockup */
		.version_id = 0,
		.direction = {true, true},
		.dai_name = "sdw-mockup-aif1",
		.init = NULL,
	},
	{
		.part_id = 0x55aa, /* amplifier mockup */
		.version_id = 0,
		.direction = {true, false},
		.dai_name = "sdw-mockup-aif1",
		.init = NULL,
	},
	{
		.part_id = 0x5555,
		.version_id = 0,
		.direction = {false, true},
		.dai_name = "sdw-mockup-aif1",
		.init = sof_sdw_mic_codec_mockup_init,
	},
};

static inline int find_codec_info_part(u64 adr)