Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASoC: SOF: restore byte control data after resume #121

Merged
merged 1 commit into from
Sep 13, 2018
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