From 3e916f8d2961db18e056209627384e2006afedf8 Mon Sep 17 00:00:00 2001 From: YC Hung Date: Mon, 18 Oct 2021 13:52:01 +0800 Subject: [PATCH] ASoC: SOF: pcm: add sof_keep_normal_fes to keep normal fes Original SOF design use ignore_machine to use topolgy and ignore normal machine driver's FEs, all FEs of SOF should be from topology and audio path goto DSP. In this patch, a new flag sof_keep_normal_fes is introduced in sof_dev_desc to keep normal FEs then can reuse them. The advantage of sof_keep_normal_fes is one machine driver can use both sof plaform driver and normal platform driver and it provides the flexibilties to choose which audio paths on AP and which paths on DSP. User can choose them depends on audio processing requirements and DSP maximum speed capability. We can offload the process of certain audio data(e.g. speaker/headphone) to dsp and we can reuse normal alsa driver for those audio data which don't need dsp offloading. (e.g. Display port). Set sof_keep_normal_fes as '1' to skip ignore_machine then keep normal FEs, default value is '0' for backward compatible. Signed-off-by: YC Hung --- include/sound/sof.h | 3 +++ sound/soc/sof/pcm.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/sound/sof.h b/include/sound/sof.h index 23b374311d1616..0bf2e2a2e13a3d 100644 --- a/include/sound/sof.h +++ b/include/sound/sof.h @@ -68,6 +68,9 @@ struct sof_dev_desc { bool use_acpi_target_states; + /*set to 1 to not use ignore_machine and still keep the normal platform driver*/ + bool sof_keep_normal_fes; + /* Platform resource indexes in BAR / ACPI resources. */ /* Must set to -1 if not used - add new items to end */ int resindex_lpe_base; diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c index 1bf7e60be77216..fba147445e1e0b 100644 --- a/sound/soc/sof/pcm.c +++ b/sound/soc/sof/pcm.c @@ -948,7 +948,8 @@ void snd_sof_new_platform_drv(struct snd_sof_dev *sdev) pd->compress_ops = &sof_probe_compressed_ops; #endif pd->pcm_construct = sof_pcm_new; - pd->ignore_machine = drv_name; + if (!plat_data->desc->sof_keep_normal_fes) + pd->ignore_machine = drv_name; pd->be_hw_params_fixup = sof_pcm_dai_link_fixup; pd->be_pcm_base = SOF_BE_PCM_BASE; pd->use_dai_pcm_id = true;