Skip to content

Commit 58651fd

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 d54b746 commit 58651fd

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
@@ -3254,6 +3254,8 @@ static int sof_ipc4_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget
32543254
msg = &asrc->msg;
32553255
break;
32563256
}
3257+
case snd_soc_dapm_decoder:
3258+
case snd_soc_dapm_encoder:
32573259
case snd_soc_dapm_effect:
32583260
{
32593261
struct sof_ipc4_process *process = swidget->private;
@@ -4013,6 +4015,15 @@ static const struct sof_ipc_tplg_widget_ops tplg_ipc4_widget_ops[SND_SOC_DAPM_TY
40134015
process_token_list, ARRAY_SIZE(process_token_list),
40144016
NULL, sof_ipc4_prepare_process_module,
40154017
NULL},
4018+
/* for all practical purposes a decoder is like an effect type widget */
4019+
[snd_soc_dapm_decoder] = {sof_ipc4_widget_setup_comp_process,
4020+
sof_ipc4_widget_free_comp_process,
4021+
process_token_list, ARRAY_SIZE(process_token_list),
4022+
NULL, sof_ipc4_prepare_process_module, NULL},
4023+
[snd_soc_dapm_encoder] = {sof_ipc4_widget_setup_comp_process,
4024+
sof_ipc4_widget_free_comp_process,
4025+
process_token_list, ARRAY_SIZE(process_token_list),
4026+
NULL, sof_ipc4_prepare_process_module, NULL},
40164027
};
40174028

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