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 <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard 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: Mark Brown <broonie@kernel.org>
This commit is contained in:
Pierre-Louis Bossart 2021-07-14 11:22:03 +08:00 коммит произвёл Mark Brown
Родитель 3025d398c4
Коммит 0ccac3bcf3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 24D68B725D5487D0
2 изменённых файлов: 42 добавлений и 0 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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)