ASoC: SOF: append extended data to sof_ipc_comp_host
Append the extended data to the end of the struct sof_ipc_comp_host, construct the ipc for COMP_NEW during the topology load stage. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200904132744.1699575-11-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
9fed9d91c0
commit
bbc1364cdd
|
@ -1644,19 +1644,16 @@ static int sof_widget_load_pcm(struct snd_soc_component *scomp, int index,
|
||||||
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
|
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
|
||||||
struct snd_soc_tplg_private *private = &tw->priv;
|
struct snd_soc_tplg_private *private = &tw->priv;
|
||||||
struct sof_ipc_comp_host *host;
|
struct sof_ipc_comp_host *host;
|
||||||
|
size_t ipc_size = sizeof(*host);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
host = kzalloc(sizeof(*host), GFP_KERNEL);
|
host = (struct sof_ipc_comp_host *)
|
||||||
|
sof_comp_alloc(swidget, &ipc_size, index, core);
|
||||||
if (!host)
|
if (!host)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* configure host comp IPC message */
|
/* configure host comp IPC message */
|
||||||
host->comp.hdr.size = sizeof(*host);
|
|
||||||
host->comp.hdr.cmd = SOF_IPC_GLB_TPLG_MSG | SOF_IPC_TPLG_COMP_NEW;
|
|
||||||
host->comp.id = swidget->comp_id;
|
|
||||||
host->comp.type = SOF_COMP_HOST;
|
host->comp.type = SOF_COMP_HOST;
|
||||||
host->comp.pipeline_id = index;
|
|
||||||
host->comp.core = core;
|
|
||||||
host->direction = dir;
|
host->direction = dir;
|
||||||
host->config.hdr.size = sizeof(host->config);
|
host->config.hdr.size = sizeof(host->config);
|
||||||
|
|
||||||
|
@ -1684,7 +1681,7 @@ static int sof_widget_load_pcm(struct snd_soc_component *scomp, int index,
|
||||||
swidget->private = host;
|
swidget->private = host;
|
||||||
|
|
||||||
ret = sof_ipc_tx_message(sdev->ipc, host->comp.hdr.cmd, host,
|
ret = sof_ipc_tx_message(sdev->ipc, host->comp.hdr.cmd, host,
|
||||||
sizeof(*host), r, sizeof(*r));
|
ipc_size, r, sizeof(*r));
|
||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
return ret;
|
return ret;
|
||||||
err:
|
err:
|
||||||
|
|
Loading…
Reference in New Issue