All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kai Vehmanen <kai.vehmanen@linux.intel.com>
To: alsa-devel@alsa-project.org, broonie@kernel.org
Cc: kai.vehmanen@linux.intel.com,
	Keyon Jie <yang.jie@linux.intel.com>,
	lgirdwood@gmail.com, pierre-louis.bossart@linux.intel.com,
	ranjani.sridharan@linux.intel.com, daniel.baluta@nxp.com
Subject: [PATCH 12/16] ASoC: SOF: append extended data to sof_ipc_comp_asrc
Date: Fri,  4 Sep 2020 16:27:40 +0300	[thread overview]
Message-ID: <20200904132744.1699575-13-kai.vehmanen@linux.intel.com> (raw)
In-Reply-To: <20200904132744.1699575-1-kai.vehmanen@linux.intel.com>

From: Keyon Jie <yang.jie@linux.intel.com>

Append the extended data to the end of the struct sof_ipc_comp_asrc,
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>
---
 sound/soc/sof/topology.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index 84f332de8b0d..476f78839fa8 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -2007,19 +2007,16 @@ static int sof_widget_load_asrc(struct snd_soc_component *scomp, int index,
 	struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
 	struct snd_soc_tplg_private *private = &tw->priv;
 	struct sof_ipc_comp_asrc *asrc;
+	size_t ipc_size = sizeof(*asrc);
 	int ret;
 
-	asrc = kzalloc(sizeof(*asrc), GFP_KERNEL);
+	asrc = (struct sof_ipc_comp_asrc *)
+	       sof_comp_alloc(swidget, &ipc_size, index, core);
 	if (!asrc)
 		return -ENOMEM;
 
 	/* configure ASRC IPC message */
-	asrc->comp.hdr.size = sizeof(*asrc);
-	asrc->comp.hdr.cmd = SOF_IPC_GLB_TPLG_MSG | SOF_IPC_TPLG_COMP_NEW;
-	asrc->comp.id = swidget->comp_id;
 	asrc->comp.type = SOF_COMP_ASRC;
-	asrc->comp.pipeline_id = index;
-	asrc->comp.core = core;
 	asrc->config.hdr.size = sizeof(asrc->config);
 
 	ret = sof_parse_tokens(scomp, asrc, asrc_tokens,
@@ -2049,7 +2046,7 @@ static int sof_widget_load_asrc(struct snd_soc_component *scomp, int index,
 	swidget->private = asrc;
 
 	ret = sof_ipc_tx_message(sdev->ipc, asrc->comp.hdr.cmd, asrc,
-				 sizeof(*asrc), r, sizeof(*r));
+				 ipc_size, r, sizeof(*r));
 	if (ret >= 0)
 		return ret;
 err:
-- 
2.27.0


  parent reply	other threads:[~2020-09-04 13:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04 13:27 [PATCH 00/16] ASoC: SOF: component UUID support for 5.10 Kai Vehmanen
2020-09-04 13:27 ` [PATCH 01/16] ASoC: SOF: tokens: add token for component UUID Kai Vehmanen
2020-09-04 13:27 ` [PATCH 02/16] ASoC: SOF: add comp_ext to struct snd_sof_widget Kai Vehmanen
2020-09-04 13:27 ` [PATCH 03/16] ASoC: SOF: topology: create component extended tokens Kai Vehmanen
2020-09-04 13:27 ` [PATCH 04/16] ASoC: SOF: topology: parse comp_ext_tokens for all widgets Kai Vehmanen
2020-09-04 13:27 ` [PATCH 05/16] ASoC: SOF: use the sof_ipc_comp reserved bytes for extended data Kai Vehmanen
2020-09-04 13:27 ` [PATCH 06/16] ASoC: SOF: topology: add helper for setting up IPC component Kai Vehmanen
2020-09-04 13:27 ` [PATCH 07/16] ASoC: SOF: append extended data to sof_ipc_comp_dai Kai Vehmanen
2020-09-04 13:27 ` [PATCH 08/16] ASoC: SOF: append extended data to sof_ipc_comp_mixer Kai Vehmanen
2020-09-04 13:27 ` [PATCH 09/16] ASoC: SOF: append extended data to sof_ipc_comp_volume Kai Vehmanen
2020-09-04 13:27 ` [PATCH 10/16] ASoC: SOF: append extended data to sof_ipc_comp_host Kai Vehmanen
2020-09-04 13:27 ` [PATCH 11/16] ASoC: SOF: append extended data to sof_ipc_comp_src Kai Vehmanen
2020-09-04 13:27 ` Kai Vehmanen [this message]
2020-09-04 13:27 ` [PATCH 13/16] ASoC: SOF: append extended data to sof_ipc_comp_tone Kai Vehmanen
2020-09-04 13:27 ` [PATCH 14/16] ASoC: SOF: append extended data to sof_ipc_comp_process Kai Vehmanen
2020-09-04 13:27 ` [PATCH 15/16] ASoC: SOF: append extended data to sof_ipc_comp_mux Kai Vehmanen
2020-09-04 13:27 ` [PATCH 16/16] ASoC: SOF: topology: make process type optional Kai Vehmanen
2020-09-07 18:05 ` [PATCH 00/16] ASoC: SOF: component UUID support for 5.10 Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200904132744.1699575-13-kai.vehmanen@linux.intel.com \
    --to=kai.vehmanen@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=lgirdwood@gmail.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=yang.jie@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.