Skip to content

Commit

Permalink
ASoC: SOF: append extended data to sof_ipc_comp_volume
Browse files Browse the repository at this point in the history
Append the extended data to the end of the struct sof_ipc_comp_volume,
construct the ipc for COMP_NEW during the topology load stage.

Signed-off-by: Keyon Jie <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Signed-off-by: Kai Vehmanen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
keyonjie authored and broonie committed Sep 7, 2020
1 parent f375bb3 commit 9fed9d9
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions sound/soc/sof/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -1878,11 +1878,13 @@ static int sof_widget_load_pga(struct snd_soc_component *scomp, int index,
struct snd_soc_tplg_private *private = &tw->priv;
struct sof_ipc_comp_volume *volume;
struct snd_sof_control *scontrol;
size_t ipc_size = sizeof(*volume);
int min_step;
int max_step;
int ret;

volume = kzalloc(sizeof(*volume), GFP_KERNEL);
volume = (struct sof_ipc_comp_volume *)
sof_comp_alloc(swidget, &ipc_size, index, core);
if (!volume)
return -ENOMEM;

Expand All @@ -1894,12 +1896,7 @@ static int sof_widget_load_pga(struct snd_soc_component *scomp, int index,
}

/* configure volume IPC message */
volume->comp.hdr.size = sizeof(*volume);
volume->comp.hdr.cmd = SOF_IPC_GLB_TPLG_MSG | SOF_IPC_TPLG_COMP_NEW;
volume->comp.id = swidget->comp_id;
volume->comp.type = SOF_COMP_VOLUME;
volume->comp.pipeline_id = index;
volume->comp.core = core;
volume->config.hdr.size = sizeof(volume->config);

ret = sof_parse_tokens(scomp, volume, volume_tokens,
Expand Down Expand Up @@ -1936,7 +1933,7 @@ static int sof_widget_load_pga(struct snd_soc_component *scomp, int index,
}

ret = sof_ipc_tx_message(sdev->ipc, volume->comp.hdr.cmd, volume,
sizeof(*volume), r, sizeof(*r));
ipc_size, r, sizeof(*r));
if (ret >= 0)
return ret;
err:
Expand Down

0 comments on commit 9fed9d9

Please sign in to comment.