Skip to content

Commit

Permalink
ASoC: SOF: topology: read back control data from DSP
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Péter Ujfalusi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
ranj063 authored and broonie committed Dec 15, 2021
1 parent 47d7328 commit fc5adc2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sound/soc/sof/sof-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,26 @@ static int sof_widget_kcontrol_setup(struct snd_sof_dev *sdev, struct snd_sof_wi
/* set up all controls for the widget */
list_for_each_entry(scontrol, &sdev->kcontrol_list, list)
if (scontrol->comp_id == swidget->comp_id) {
/* set kcontrol data in DSP */
ret = sof_kcontrol_setup(sdev, scontrol);
if (ret < 0) {
dev_err(sdev->dev, "error: fail to set up kcontrols for widget %s\n",
swidget->widget->name);
return ret;
}

/*
* Read back the data from the DSP for static widgets. This is particularly
* useful for binary kcontrols associated with static pipeline widgets to
* initialize the data size to match that in the DSP.
*/
if (swidget->dynamic_pipeline_widget)
continue;

ret = snd_sof_ipc_set_get_comp_data(scontrol, false);
if (ret < 0)
dev_warn(sdev->dev, "Failed kcontrol get for control in widget %s\n",
swidget->widget->name);
}

return 0;
Expand Down

0 comments on commit fc5adc2

Please sign in to comment.