Skip to content

Commit fadeee4

Browse files
ranj063ujfalusi
authored andcommitted
ASoC: SOF: topology: Add support for decoder and encoder widgets
Decoder and encoder modules fall under process modules in SOF. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Co-developed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 0eb6bc3 commit fadeee4

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

sound/soc/sof/ipc4-topology.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3240,6 +3240,8 @@ static int sof_ipc4_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget
32403240
msg = &asrc->msg;
32413241
break;
32423242
}
3243+
case snd_soc_dapm_decoder:
3244+
case snd_soc_dapm_encoder:
32433245
case snd_soc_dapm_effect:
32443246
{
32453247
struct sof_ipc4_process *process = swidget->private;
@@ -3999,6 +4001,15 @@ static const struct sof_ipc_tplg_widget_ops tplg_ipc4_widget_ops[SND_SOC_DAPM_TY
39994001
process_token_list, ARRAY_SIZE(process_token_list),
40004002
NULL, sof_ipc4_prepare_process_module,
40014003
NULL},
4004+
/* for all practical purposes a decoder is like an effect type widget */
4005+
[snd_soc_dapm_decoder] = {sof_ipc4_widget_setup_comp_process,
4006+
sof_ipc4_widget_free_comp_process,
4007+
process_token_list, ARRAY_SIZE(process_token_list),
4008+
NULL, sof_ipc4_prepare_process_module, NULL},
4009+
[snd_soc_dapm_encoder] = {sof_ipc4_widget_setup_comp_process,
4010+
sof_ipc4_widget_free_comp_process,
4011+
process_token_list, ARRAY_SIZE(process_token_list),
4012+
NULL, sof_ipc4_prepare_process_module, NULL},
40024013
};
40034014

40044015
const struct sof_ipc_tplg_ops ipc4_tplg_ops = {

sound/soc/sof/sof-audio.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
#define WIDGET_IS_AIF(id) ((id) == snd_soc_dapm_aif_in || (id) == snd_soc_dapm_aif_out)
4444
#define WIDGET_IS_AIF_OR_DAI(id) (WIDGET_IS_DAI(id) || WIDGET_IS_AIF(id))
4545
#define WIDGET_IS_COPIER(id) (WIDGET_IS_AIF_OR_DAI(id) || (id) == snd_soc_dapm_buffer)
46-
#define WIDGET_IS_PROCESS(id) ((id) == snd_soc_dapm_effect)
46+
#define WIDGET_IS_PROCESS(id) ((id) == snd_soc_dapm_effect || \
47+
(id) == snd_soc_dapm_decoder || \
48+
(id) == snd_soc_dapm_encoder)
4749

4850
#define SOF_DAI_PARAM_INTEL_SSP_MCLK 0
4951
#define SOF_DAI_PARAM_INTEL_SSP_BCLK 1

sound/soc/sof/topology.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,8 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index,
15121512
list_add(&dai->list, &sdev->dai_list);
15131513
swidget->private = dai;
15141514
break;
1515+
case snd_soc_dapm_decoder:
1516+
case snd_soc_dapm_encoder:
15151517
case snd_soc_dapm_effect:
15161518
/* check we have some tokens - we need at least process type */
15171519
if (le32_to_cpu(tw->priv.size) == 0) {

0 commit comments

Comments
 (0)