aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDharageswari R <dharageswari.r@intel.com>2016-09-22 04:30:40 -0400
committerMark Brown <broonie@kernel.org>2016-09-24 14:26:25 -0400
commit5e8f0ee46de46e709e19675726a46cf5838b9bca (patch)
tree93cf4917c44fbfe0476270376278393d7b3cb37c /sound
parentef2a352cfb2a536ae8718065b43702a97f9fba9f (diff)
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')
-rw-r--r--sound/soc/intel/skylake/skl-messages.c2
-rw-r--r--sound/soc/intel/skylake/skl-topology.c22
-rw-r--r--sound/soc/intel/skylake/skl-topology.h10
-rw-r--r--sound/soc/intel/skylake/skl-tplg-interface.h3
4 files changed, 36 insertions, 1 deletions
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,
680 return param_size; 680 return param_size;
681 681
682 case SKL_MODULE_TYPE_BASE_OUTFMT: 682 case SKL_MODULE_TYPE_BASE_OUTFMT:
683 case SKL_MODULE_TYPE_KPB:
683 return sizeof(struct skl_base_outfmt_cfg); 684 return sizeof(struct skl_base_outfmt_cfg);
684 685
685 default: 686 default:
@@ -733,6 +734,7 @@ static int skl_set_module_format(struct skl_sst *ctx,
733 break; 734 break;
734 735
735 case SKL_MODULE_TYPE_BASE_OUTFMT: 736 case SKL_MODULE_TYPE_BASE_OUTFMT:
737 case SKL_MODULE_TYPE_KPB:
736 skl_set_base_outfmt_format(ctx, module_config, *param_data); 738 skl_set_base_outfmt_format(ctx, module_config, *param_data);
737 break; 739 break;
738 740
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,
607 return 0; 607 return 0;
608} 608}
609 609
610static int skl_fill_sink_instance_id(struct skl_sst *ctx,
611 struct skl_algo_data *alg_data)
612{
613 struct skl_kpb_params *params = (struct skl_kpb_params *)alg_data->params;
614 struct skl_mod_inst_map *inst;
615 int i, pvt_id;
616
617 inst = params->map;
618
619 for (i = 0; i < params->num_modules; i++) {
620 pvt_id = skl_get_pvt_instance_id_map(ctx,
621 inst->mod_id, inst->inst_id);
622 if (pvt_id < 0)
623 return -EINVAL;
624 inst->inst_id = pvt_id;
625 inst++;
626 }
627 return 0;
628}
629
610/* 630/*
611 * Some modules require params to be set after the module is bound to 631 * Some modules require params to be set after the module is bound to
612 * all pins connected. 632 * all pins connected.
@@ -655,6 +675,8 @@ static int skl_tplg_set_module_bind_params(struct snd_soc_dapm_widget *w,
655 bc = (struct skl_algo_data *)sb->dobj.private; 675 bc = (struct skl_algo_data *)sb->dobj.private;
656 676
657 if (bc->set_params == SKL_PARAM_BIND) { 677 if (bc->set_params == SKL_PARAM_BIND) {
678 if (mconfig->m_type == SKL_MODULE_TYPE_KPB)
679 skl_fill_sink_instance_id(ctx, bc);
658 ret = skl_set_module_params(ctx, 680 ret = skl_set_module_params(ctx,
659 (u32 *)bc->params, bc->max, 681 (u32 *)bc->params, bc->max,
660 bc->param_id, mconfig); 682 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 {
215 215
216struct skl_module_cfg; 216struct skl_module_cfg;
217 217
218struct skl_mod_inst_map {
219 u16 mod_id;
220 u16 inst_id;
221};
222
223struct skl_kpb_params {
224 u32 num_modules;
225 struct skl_mod_inst_map map[0];
226};
227
218struct skl_module_inst_id { 228struct skl_module_inst_id {
219 int module_id; 229 int module_id;
220 u32 instance_id; 230 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 {
80 SKL_MODULE_TYPE_UPDWMIX, 80 SKL_MODULE_TYPE_UPDWMIX,
81 SKL_MODULE_TYPE_SRCINT, 81 SKL_MODULE_TYPE_SRCINT,
82 SKL_MODULE_TYPE_ALGO, 82 SKL_MODULE_TYPE_ALGO,
83 SKL_MODULE_TYPE_BASE_OUTFMT 83 SKL_MODULE_TYPE_BASE_OUTFMT,
84 SKL_MODULE_TYPE_KPB,
84}; 85};
85 86
86enum skl_core_affinity { 87enum skl_core_affinity {