All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Subhransu S. Prusty" <subhransu.s.prusty@intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, lgirdwood@gmail.com,
	G Kranthi <gudishax.kranthikumar@intel.com>,
	patches.audio@intel.com, broonie@kernel.org,
	"Subhransu S. Prusty" <subhransu.s.prusty@intel.com>
Subject: [PATCH v2 3/6] ASoC: Intel: Skylake: Modify arguments to reuse module transfer function
Date: Tue, 25 Apr 2017 12:18:21 +0530	[thread overview]
Message-ID: <1493102904-12624-4-git-send-email-subhransu.s.prusty@intel.com> (raw)
In-Reply-To: <1493102904-12624-1-git-send-email-subhransu.s.prusty@intel.com>

From: G Kranthi <gudishax.kranthikumar@intel.com>

Kabylake also uses code loader dma for module load and library load.
skl_transfer_module can be reused. Modify the arguments to include
library index to be passed to lib load ipc and module/lib check to use
correct ipc for lib/module load.

Signed-off-by: G Kranthi <gudishax.kranthikumar@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
---
 sound/soc/intel/skylake/skl-sst.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c
index 4fdd503a837c..b4c3b5c63115 100644
--- a/sound/soc/intel/skylake/skl-sst.c
+++ b/sound/soc/intel/skylake/skl-sst.c
@@ -325,7 +325,7 @@ static struct skl_module_table *skl_module_get_from_id(
 }
 
 static int skl_transfer_module(struct sst_dsp *ctx, const void *data,
-				u32 size, u16 mod_id)
+			u32 size, u16 mod_id, u8 table_id, bool is_module)
 {
 	int ret, bytes_left, curr_pos;
 	struct skl_sst *skl = ctx->thread_context;
@@ -335,10 +335,12 @@ static int skl_transfer_module(struct sst_dsp *ctx, const void *data,
 	if (bytes_left < 0)
 		return bytes_left;
 
-	ret = skl_ipc_load_modules(&skl->ipc, SKL_NUM_MODULES, &mod_id);
-	if (ret < 0) {
-		dev_err(ctx->dev, "Failed to Load module: %d\n", ret);
-		goto out;
+	if (is_module) { /* load module */
+		ret = skl_ipc_load_modules(&skl->ipc, SKL_NUM_MODULES, &mod_id);
+		if (ret < 0) {
+			dev_err(ctx->dev, "Failed to Load module: %d\n", ret);
+			goto out;
+		}
 	}
 
 	/*
@@ -393,7 +395,8 @@ static int skl_load_module(struct sst_dsp *ctx, u16 mod_id, u8 *guid)
 
 	if (!module_entry->usage_cnt) {
 		ret = skl_transfer_module(ctx, module_entry->mod_info->fw->data,
-				module_entry->mod_info->fw->size, mod_id);
+				module_entry->mod_info->fw->size,
+				mod_id, 0, true);
 		if (ret < 0) {
 			dev_err(ctx->dev, "Failed to Load module\n");
 			return ret;
-- 
1.9.1

  parent reply	other threads:[~2017-04-25  7:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25  6:48 [PATCH v2 0/6] ASoC: Intel: Skylake: Add loadable module support for Kabylake Subhransu S. Prusty
2017-04-25  6:48 ` [PATCH v2 1/6] ASoC: Intel: Skylake: Move sst common initialization to a helper function Subhransu S. Prusty
2017-04-25  6:48 ` [PATCH v2 2/6] ASoC: Intel: Skylake: Commonize library load Subhransu S. Prusty
2017-04-25  6:48 ` Subhransu S. Prusty [this message]
2017-04-26 14:49   ` Applied "ASoC: Intel: Skylake: Modify arguments to reuse module transfer function" to the asoc tree Mark Brown
2017-04-25  6:48 ` [PATCH v2 4/6] ASoC: Intel: Skylake: Register dsp_fw_ops for kabylake Subhransu S. Prusty
2017-04-25  6:48 ` [PATCH v2 5/6] ASoC: Intel: Skylake: Modify load_lib_ipc arguments for a nowait version Subhransu S. Prusty
2017-04-25  6:48 ` [PATCH v2 6/6] ASoC: Intel: Skylake: Add loadable module support on KBL platform Subhransu S. Prusty
2017-04-26 14:48   ` Applied "ASoC: Intel: Skylake: Add loadable module support on KBL platform" to the asoc tree Mark Brown
2017-04-26  5:40 ` [PATCH v2 0/6] ASoC: Intel: Skylake: Add loadable module support for Kabylake Vinod Koul

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=1493102904-12624-4-git-send-email-subhransu.s.prusty@intel.com \
    --to=subhransu.s.prusty@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=gudishax.kranthikumar@intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=patches.audio@intel.com \
    --cc=tiwai@suse.de \
    /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.