Commit fc5adc2b authored by Ranjani Sridharan's avatar Ranjani Sridharan Committed by Mark Brown

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: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211215180404.53254-9-ranjani.sridharan@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 47d7328f
...@@ -59,12 +59,26 @@ static int sof_widget_kcontrol_setup(struct snd_sof_dev *sdev, struct snd_sof_wi ...@@ -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 */ /* set up all controls for the widget */
list_for_each_entry(scontrol, &sdev->kcontrol_list, list) list_for_each_entry(scontrol, &sdev->kcontrol_list, list)
if (scontrol->comp_id == swidget->comp_id) { if (scontrol->comp_id == swidget->comp_id) {
/* set kcontrol data in DSP */
ret = sof_kcontrol_setup(sdev, scontrol); ret = sof_kcontrol_setup(sdev, scontrol);
if (ret < 0) { if (ret < 0) {
dev_err(sdev->dev, "error: fail to set up kcontrols for widget %s\n", dev_err(sdev->dev, "error: fail to set up kcontrols for widget %s\n",
swidget->widget->name); swidget->widget->name);
return ret; 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; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment