alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: alsa-devel@alsa-project.org
Cc: liam.r.girdwood@linux.intel.com, patches.audio@intel.com,
	Dharageswari R <dharageswari.r@intel.com>,
	broonie@kernel.org, Vinod Koul <vinod.koul@intel.com>
Subject: [PATCH 8/9] ASoC: Intel: Skylake: Override the actual instance id's to pvt_id's
Date: Wed, 24 Aug 2016 18:03:20 +0530	[thread overview]
Message-ID: <1472042001-9582-9-git-send-email-vinod.koul@intel.com> (raw)
In-Reply-To: <1472042001-9582-1-git-send-email-vinod.koul@intel.com>

From: Dharageswari R <dharageswari.r@intel.com>

Post bind parameters of KPB contains the actual instance id's of
modules in the sink path. Override these instance id's with the
pvt_id's generated by driver.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/skylake/skl-messages.c       |  2 ++
 sound/soc/intel/skylake/skl-topology.c       | 22 ++++++++++++++++++++++
 sound/soc/intel/skylake/skl-topology.h       | 10 ++++++++++
 sound/soc/intel/skylake/skl-tplg-interface.h |  3 ++-
 4 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c
index ac0c58e170c3..805b7f2173f3 100644
--- a/sound/soc/intel/skylake/skl-messages.c
+++ b/sound/soc/intel/skylake/skl-messages.c
@@ -680,6 +680,7 @@ static u16 skl_get_module_param_size(struct skl_sst *ctx,
 		return param_size;
 
 	case SKL_MODULE_TYPE_BASE_OUTFMT:
+	case SKL_MODULE_TYPE_KPB:
 		return sizeof(struct skl_base_outfmt_cfg);
 
 	default:
@@ -733,6 +734,7 @@ static int skl_set_module_format(struct skl_sst *ctx,
 		break;
 
 	case SKL_MODULE_TYPE_BASE_OUTFMT:
+	case SKL_MODULE_TYPE_KPB:
 		skl_set_base_outfmt_format(ctx, module_config, *param_data);
 		break;
 
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index b6fc374f38b5..e48f872505b1 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -607,6 +607,26 @@ static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,
 	return 0;
 }
 
+static int skl_fill_sink_instance_id(struct skl_sst *ctx,
+				struct skl_algo_data *alg_data)
+{
+	struct skl_kpb_params *params = (struct skl_kpb_params *)alg_data->params;
+	struct skl_mod_inst_map *inst;
+	int i, pvt_id;
+
+	inst = params->map;
+
+	for (i = 0; i < params->num_modules; i++) {
+		pvt_id = skl_get_pvt_instance_id_map(ctx,
+					inst->mod_id, inst->inst_id);
+		if (pvt_id < 0)
+			return -EINVAL;
+		inst->inst_id = pvt_id;
+		inst++;
+	}
+	return 0;
+}
+
 /*
  * Some modules require params to be set after the module is bound to
  * all pins connected.
@@ -655,6 +675,8 @@ static int skl_tplg_set_module_bind_params(struct snd_soc_dapm_widget *w,
 			bc = (struct skl_algo_data *)sb->dobj.private;
 
 			if (bc->set_params == SKL_PARAM_BIND) {
+				if (mconfig->m_type == SKL_MODULE_TYPE_KPB)
+					skl_fill_sink_instance_id(ctx, bc);
 				ret = skl_set_module_params(ctx,
 						(u32 *)bc->params, bc->max,
 						bc->param_id, mconfig);
diff --git a/sound/soc/intel/skylake/skl-topology.h b/sound/soc/intel/skylake/skl-topology.h
index def03912b1bd..a519360f42a6 100644
--- a/sound/soc/intel/skylake/skl-topology.h
+++ b/sound/soc/intel/skylake/skl-topology.h
@@ -215,6 +215,16 @@ struct skl_module_fmt {
 
 struct skl_module_cfg;
 
+struct skl_mod_inst_map {
+	u16 mod_id;
+	u16 inst_id;
+};
+
+struct skl_kpb_params {
+	u32 num_modules;
+	struct skl_mod_inst_map map[0];
+};
+
 struct skl_module_inst_id {
 	int module_id;
 	u32 instance_id;
diff --git a/sound/soc/intel/skylake/skl-tplg-interface.h b/sound/soc/intel/skylake/skl-tplg-interface.h
index e208724f9db3..2f6281e056d6 100644
--- a/sound/soc/intel/skylake/skl-tplg-interface.h
+++ b/sound/soc/intel/skylake/skl-tplg-interface.h
@@ -80,7 +80,8 @@ enum skl_module_type {
 	SKL_MODULE_TYPE_UPDWMIX,
 	SKL_MODULE_TYPE_SRCINT,
 	SKL_MODULE_TYPE_ALGO,
-	SKL_MODULE_TYPE_BASE_OUTFMT
+	SKL_MODULE_TYPE_BASE_OUTFMT,
+	SKL_MODULE_TYPE_KPB,
 };
 
 enum skl_core_affinity {
-- 
1.9.1

  parent reply	other threads:[~2016-08-24 12:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-24 12:33 [PATCH 0/9] ASoC: Intel: Skylake: Driver updates Vinod Koul
2016-08-24 12:33 ` [PATCH 1/9] ASoC: Intel: Skylake: check manifest size Vinod Koul
2016-08-24 12:33 ` [PATCH 2/9] ASoC: Intel: Skylake: Fix the inverted logic check Vinod Koul
2016-08-24 12:33 ` [PATCH 3/9] ASoC: Intel: Skylake: Fix DMA control config size Vinod Koul
2016-08-24 12:33 ` [PATCH 4/9] ASoC: Intel: Skylake: Unload all the loadable modules Vinod Koul
2016-08-24 12:33 ` [PATCH 5/9] ASoC: Intel: Skylake: Create dynamic instance ids for DSP modules Vinod Koul
2016-09-14 16:43   ` Mark Brown
2016-09-15  4:31     ` Vinod Koul
2016-08-24 12:33 ` [PATCH 6/9] ASoC: Intel: Skylake: Use private instance id of modules in IPC Vinod Koul
2016-09-25  5:58   ` Applied "ASoC: Intel: Skylake: Use private instance id of modules in IPC" to the asoc tree Mark Brown
2016-08-24 12:33 ` [PATCH 7/9] ASoC: Intel: Skylake: Table for module instance id and private id Vinod Koul
2016-09-25  5:58   ` Applied "ASoC: Intel: Skylake: Add table for module id for quick ref" to the asoc tree Mark Brown
2016-08-24 12:33 ` Vinod Koul [this message]
2016-09-25  5:58   ` Applied "ASoC: Intel: Skylake: Update to use instance ids generated" " Mark Brown
2016-08-24 12:33 ` [PATCH 9/9] ASoC: Intel: Skylake: Add 32bit support Vinod Koul
2016-09-14 17:15   ` Applied "ASoC: Intel: Skylake: Add 32bit support" to the asoc tree Mark Brown
2016-09-14 16:50 ` [PATCH 0/9] ASoC: Intel: Skylake: Driver updates Mark Brown
2016-09-15  4:37   ` 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=1472042001-9582-9-git-send-email-vinod.koul@intel.com \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=dharageswari.r@intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=patches.audio@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).