Skip to content

Commit 54347f9

Browse files
ranj063plbossart
authored andcommitted
ASoC: SOF: topology: read back control data from DSP
Read back the control data from the DSP to initialize the control data size to match that of the data in the DSP. This is particularly useful for volatile read-only kcontrols in static pipelines. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1 parent 574b8ca commit 54347f9

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

sound/soc/sof/sof-audio.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,26 @@ static int sof_widget_kcontrol_setup(struct snd_sof_dev *sdev, struct snd_sof_wi
5959
/* set up all controls for the widget */
6060
list_for_each_entry(scontrol, &sdev->kcontrol_list, list)
6161
if (scontrol->comp_id == swidget->comp_id) {
62+
/* set kcontrol data in DSP */
6263
ret = sof_kcontrol_setup(sdev, scontrol);
6364
if (ret < 0) {
6465
dev_err(sdev->dev, "error: fail to set up kcontrols for widget %s\n",
6566
swidget->widget->name);
6667
return ret;
6768
}
69+
70+
/*
71+
* Read back the data from the DSP for static widgets. This is particularly
72+
* useful for binary kcontrols associated with static pipeline widgets to
73+
* initialize the data size to match that in the DSP.
74+
*/
75+
if (swidget->dynamic_pipeline_widget)
76+
continue;
77+
78+
ret = snd_sof_ipc_set_get_comp_data(scontrol, false);
79+
if (ret < 0)
80+
dev_warn(sdev->dev, "Failed kcontrol get for control in widget %s\n",
81+
swidget->widget->name);
6882
}
6983

7084
return 0;

0 commit comments

Comments
 (0)