diff options
author | Dharageswari R | 2016-09-22 10:30:40 +0200 |
---|---|---|
committer | Mark Brown | 2016-09-24 20:26:25 +0200 |
commit | 5e8f0ee46de46e709e19675726a46cf5838b9bca (patch) | |
tree | 93cf4917c44fbfe0476270376278393d7b3cb37c /sound/soc/intel/skylake/skl-topology.c | |
parent | ASoC: Intel: Skylake: Use private instance id of modules in IPC (diff) | |
download | kernel-qcow2-linux-5e8f0ee46de46e709e19675726a46cf5838b9bca.tar.gz kernel-qcow2-linux-5e8f0ee46de46e709e19675726a46cf5838b9bca.tar.xz kernel-qcow2-linux-5e8f0ee46de46e709e19675726a46cf5838b9bca.zip |
ASoC: Intel: Skylake: Update to use instance ids generated
Post bind parameters of KPB module contains the instance id's of
neighbouring modules in the sink path
Now that module instance ids are generated dynamically we need to update
these parameters as well, so use the table created and update the ids
Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/skylake/skl-topology.c')
-rw-r--r-- | sound/soc/intel/skylake/skl-topology.c | 22 |
1 files changed, 22 insertions, 0 deletions
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); |