Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions sound/soc/sof/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ static int sof_restore_pipelines(struct snd_sof_dev *sdev)
struct sof_ipc_comp_dai *comp_dai;
struct sof_ipc_hdr *hdr;
struct snd_sof_control *scontrol = NULL;
int ipc_cmd, ctrl_type, sof_abi;
int ret = 0;

/* restore pipeline components */
Expand Down Expand Up @@ -129,10 +130,33 @@ static int sof_restore_pipelines(struct snd_sof_dev *sdev)
list_for_each_entry(scontrol, &sdev->kcontrol_list, list) {

/* notify DSP of kcontrol values */
ret = snd_sof_ipc_set_comp_data(sdev->ipc, scontrol,
SOF_IPC_COMP_SET_VALUE,
SOF_CTRL_TYPE_VALUE_CHAN_SET,
scontrol->cmd);
switch (scontrol->cmd) {
case SOF_CTRL_CMD_VOLUME:
ipc_cmd = SOF_IPC_COMP_SET_VALUE;
ctrl_type = SOF_CTRL_TYPE_VALUE_CHAN_SET;
ret = snd_sof_ipc_set_comp_data(sdev->ipc, scontrol,
ipc_cmd, ctrl_type,
scontrol->cmd);
break;
case SOF_CTRL_CMD_BINARY:

/* Check if control data contains valid data.
* SOF_ABI_MAGIC will not match if there is no data.
*/
ipc_cmd = SOF_IPC_COMP_SET_DATA;
ctrl_type = SOF_CTRL_TYPE_DATA_SET;
sof_abi = scontrol->control_data->data->magic;
if (sof_abi == SOF_ABI_MAGIC)
ret = snd_sof_ipc_set_comp_data(sdev->ipc,
scontrol,
ipc_cmd,
ctrl_type,
scontrol->cmd);
break;

default:
break;
}
if (ret < 0) {
dev_err(sdev->dev,
"error: failed kcontrol value set for widget: %d\n",
Expand Down