Skip to content

Commit 2f69ce2

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 3c53949 commit 2f69ce2

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

sound/soc/sof/ipc4-topology.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3423,6 +3423,8 @@ static int sof_ipc4_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget
34233423
msg = &asrc->msg;
34243424
break;
34253425
}
3426+
case snd_soc_dapm_decoder:
3427+
case snd_soc_dapm_encoder:
34263428
case snd_soc_dapm_effect:
34273429
{
34283430
struct sof_ipc4_process *process = swidget->private;
@@ -4203,6 +4205,15 @@ static const struct sof_ipc_tplg_widget_ops tplg_ipc4_widget_ops[SND_SOC_DAPM_TY
42034205
process_token_list, ARRAY_SIZE(process_token_list),
42044206
NULL, sof_ipc4_prepare_process_module,
42054207
NULL},
4208+
/* for all practical purposes a decoder is like an effect type widget */
4209+
[snd_soc_dapm_decoder] = {sof_ipc4_widget_setup_comp_process,
4210+
sof_ipc4_widget_free_comp_process,
4211+
process_token_list, ARRAY_SIZE(process_token_list),
4212+
NULL, sof_ipc4_prepare_process_module, NULL},
4213+
[snd_soc_dapm_encoder] = {sof_ipc4_widget_setup_comp_process,
4214+
sof_ipc4_widget_free_comp_process,
4215+
process_token_list, ARRAY_SIZE(process_token_list),
4216+
NULL, sof_ipc4_prepare_process_module, NULL},
42064217
};
42074218

42084219
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
@@ -1524,6 +1524,8 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index,
15241524
list_add(&dai->list, &sdev->dai_list);
15251525
swidget->private = dai;
15261526
break;
1527+
case snd_soc_dapm_decoder:
1528+
case snd_soc_dapm_encoder:
15271529
case snd_soc_dapm_effect:
15281530
/* check we have some tokens - we need at least process type */
15291531
if (le32_to_cpu(tw->priv.size) == 0) {

0 commit comments

Comments
 (0)