aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDharageswari R <dharageswari.r@intel.com>2016-09-22 04:30:38 -0400
committerMark Brown <broonie@kernel.org>2016-09-24 14:26:25 -0400
commitef2a352cfb2a536ae8718065b43702a97f9fba9f (patch)
tree02112251938dfd312807148f0696b108099dc406 /sound
parent700a9a63f9c1bc13abaa956eacc0bfcaf3a201c2 (diff)
ASoC: Intel: Skylake: Use private instance id of modules in IPC
Use private id's of module instances that are generated during init_module for the IPC messages to DSP. These id's are freed up during delete pipeline. 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.c22
-rw-r--r--sound/soc/intel/skylake/skl-sst-utils.c2
-rw-r--r--sound/soc/intel/skylake/skl-topology.c10
3 files changed, 20 insertions, 14 deletions
diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c
index 8eb5ba2dae3a..ac0c58e170c3 100644
--- a/sound/soc/intel/skylake/skl-messages.c
+++ b/sound/soc/intel/skylake/skl-messages.c
@@ -787,6 +787,7 @@ static int skl_alloc_queue(struct skl_module_pin *mpin,
787 mpin[i].in_use = true; 787 mpin[i].in_use = true;
788 mpin[i].id.module_id = id.module_id; 788 mpin[i].id.module_id = id.module_id;
789 mpin[i].id.instance_id = id.instance_id; 789 mpin[i].id.instance_id = id.instance_id;
790 mpin[i].id.pvt_id = id.pvt_id;
790 mpin[i].tgt_mcfg = tgt_cfg; 791 mpin[i].tgt_mcfg = tgt_cfg;
791 return i; 792 return i;
792 } 793 }
@@ -810,6 +811,7 @@ static void skl_free_queue(struct skl_module_pin *mpin, int q_index)
810 mpin[q_index].in_use = false; 811 mpin[q_index].in_use = false;
811 mpin[q_index].id.module_id = 0; 812 mpin[q_index].id.module_id = 0;
812 mpin[q_index].id.instance_id = 0; 813 mpin[q_index].id.instance_id = 0;
814 mpin[q_index].id.pvt_id = 0;
813 } 815 }
814 mpin[q_index].pin_state = SKL_PIN_UNBIND; 816 mpin[q_index].pin_state = SKL_PIN_UNBIND;
815 mpin[q_index].tgt_mcfg = NULL; 817 mpin[q_index].tgt_mcfg = NULL;
@@ -850,7 +852,7 @@ int skl_init_module(struct skl_sst *ctx,
850 struct skl_ipc_init_instance_msg msg; 852 struct skl_ipc_init_instance_msg msg;
851 853
852 dev_dbg(ctx->dev, "%s: module_id = %d instance=%d\n", __func__, 854 dev_dbg(ctx->dev, "%s: module_id = %d instance=%d\n", __func__,
853 mconfig->id.module_id, mconfig->id.instance_id); 855 mconfig->id.module_id, mconfig->id.pvt_id);
854 856
855 if (mconfig->pipe->state != SKL_PIPE_CREATED) { 857 if (mconfig->pipe->state != SKL_PIPE_CREATED) {
856 dev_err(ctx->dev, "Pipe not created state= %d pipe_id= %d\n", 858 dev_err(ctx->dev, "Pipe not created state= %d pipe_id= %d\n",
@@ -866,7 +868,7 @@ int skl_init_module(struct skl_sst *ctx,
866 } 868 }
867 869
868 msg.module_id = mconfig->id.module_id; 870 msg.module_id = mconfig->id.module_id;
869 msg.instance_id = mconfig->id.instance_id; 871 msg.instance_id = mconfig->id.pvt_id;
870 msg.ppl_instance_id = mconfig->pipe->ppl_id; 872 msg.ppl_instance_id = mconfig->pipe->ppl_id;
871 msg.param_data_size = module_config_size; 873 msg.param_data_size = module_config_size;
872 msg.core_id = mconfig->core_id; 874 msg.core_id = mconfig->core_id;
@@ -887,9 +889,9 @@ static void skl_dump_bind_info(struct skl_sst *ctx, struct skl_module_cfg
887 *src_module, struct skl_module_cfg *dst_module) 889 *src_module, struct skl_module_cfg *dst_module)
888{ 890{
889 dev_dbg(ctx->dev, "%s: src module_id = %d src_instance=%d\n", 891 dev_dbg(ctx->dev, "%s: src module_id = %d src_instance=%d\n",
890 __func__, src_module->id.module_id, src_module->id.instance_id); 892 __func__, src_module->id.module_id, src_module->id.pvt_id);
891 dev_dbg(ctx->dev, "%s: dst_module=%d dst_instacne=%d\n", __func__, 893 dev_dbg(ctx->dev, "%s: dst_module=%d dst_instacne=%d\n", __func__,
892 dst_module->id.module_id, dst_module->id.instance_id); 894 dst_module->id.module_id, dst_module->id.pvt_id);
893 895
894 dev_dbg(ctx->dev, "src_module state = %d dst module state = %d\n", 896 dev_dbg(ctx->dev, "src_module state = %d dst module state = %d\n",
895 src_module->m_state, dst_module->m_state); 897 src_module->m_state, dst_module->m_state);
@@ -936,9 +938,9 @@ int skl_unbind_modules(struct skl_sst *ctx,
936 return 0; 938 return 0;
937 939
938 msg.module_id = src_mcfg->id.module_id; 940 msg.module_id = src_mcfg->id.module_id;
939 msg.instance_id = src_mcfg->id.instance_id; 941 msg.instance_id = src_mcfg->id.pvt_id;
940 msg.dst_module_id = dst_mcfg->id.module_id; 942 msg.dst_module_id = dst_mcfg->id.module_id;
941 msg.dst_instance_id = dst_mcfg->id.instance_id; 943 msg.dst_instance_id = dst_mcfg->id.pvt_id;
942 msg.bind = false; 944 msg.bind = false;
943 945
944 ret = skl_ipc_bind_unbind(&ctx->ipc, &msg); 946 ret = skl_ipc_bind_unbind(&ctx->ipc, &msg);
@@ -997,9 +999,9 @@ int skl_bind_modules(struct skl_sst *ctx,
997 msg.src_queue, msg.dst_queue); 999 msg.src_queue, msg.dst_queue);
998 1000
999 msg.module_id = src_mcfg->id.module_id; 1001 msg.module_id = src_mcfg->id.module_id;
1000 msg.instance_id = src_mcfg->id.instance_id; 1002 msg.instance_id = src_mcfg->id.pvt_id;
1001 msg.dst_module_id = dst_mcfg->id.module_id; 1003 msg.dst_module_id = dst_mcfg->id.module_id;
1002 msg.dst_instance_id = dst_mcfg->id.instance_id; 1004 msg.dst_instance_id = dst_mcfg->id.pvt_id;
1003 msg.bind = true; 1005 msg.bind = true;
1004 1006
1005 ret = skl_ipc_bind_unbind(&ctx->ipc, &msg); 1007 ret = skl_ipc_bind_unbind(&ctx->ipc, &msg);
@@ -1177,7 +1179,7 @@ int skl_set_module_params(struct skl_sst *ctx, u32 *params, int size,
1177 struct skl_ipc_large_config_msg msg; 1179 struct skl_ipc_large_config_msg msg;
1178 1180
1179 msg.module_id = mcfg->id.module_id; 1181 msg.module_id = mcfg->id.module_id;
1180 msg.instance_id = mcfg->id.instance_id; 1182 msg.instance_id = mcfg->id.pvt_id;
1181 msg.param_data_size = size; 1183 msg.param_data_size = size;
1182 msg.large_param_id = param_id; 1184 msg.large_param_id = param_id;
1183 1185
@@ -1190,7 +1192,7 @@ int skl_get_module_params(struct skl_sst *ctx, u32 *params, int size,
1190 struct skl_ipc_large_config_msg msg; 1192 struct skl_ipc_large_config_msg msg;
1191 1193
1192 msg.module_id = mcfg->id.module_id; 1194 msg.module_id = mcfg->id.module_id;
1193 msg.instance_id = mcfg->id.instance_id; 1195 msg.instance_id = mcfg->id.pvt_id;
1194 msg.param_data_size = size; 1196 msg.param_data_size = size;
1195 msg.large_param_id = param_id; 1197 msg.large_param_id = param_id;
1196 1198
diff --git a/sound/soc/intel/skylake/skl-sst-utils.c b/sound/soc/intel/skylake/skl-sst-utils.c
index 5f1c203a448e..876b9e04e880 100644
--- a/sound/soc/intel/skylake/skl-sst-utils.c
+++ b/sound/soc/intel/skylake/skl-sst-utils.c
@@ -136,7 +136,7 @@ int snd_skl_get_module_info(struct skl_sst *ctx,
136EXPORT_SYMBOL_GPL(snd_skl_get_module_info); 136EXPORT_SYMBOL_GPL(snd_skl_get_module_info);
137 137
138static inline int skl_getid_32(struct uuid_module *module, u64 *val, 138static inline int skl_getid_32(struct uuid_module *module, u64 *val,
139 int word1_mask, int word2_mask) 139 int word1_mask, int word2_mask)
140{ 140{
141 int index, max_inst, pvt_id; 141 int index, max_inst, pvt_id;
142 u32 mask_val; 142 u32 mask_val;
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index 2d475b720963..b6fc374f38b5 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -505,12 +505,15 @@ skl_tplg_init_pipe_modules(struct skl *skl, struct skl_pipe *pipe)
505 * FE/BE params 505 * FE/BE params
506 */ 506 */
507 skl_tplg_update_module_params(w, ctx); 507 skl_tplg_update_module_params(w, ctx);
508 508 mconfig->id.pvt_id = skl_get_pvt_id(ctx, mconfig);
509 if (mconfig->id.pvt_id < 0)
510 return ret;
509 skl_tplg_set_module_init_data(w); 511 skl_tplg_set_module_init_data(w);
510 ret = skl_init_module(ctx, mconfig); 512 ret = skl_init_module(ctx, mconfig);
511 if (ret < 0) 513 if (ret < 0) {
514 skl_put_pvt_id(ctx, mconfig);
512 return ret; 515 return ret;
513 516 }
514 skl_tplg_alloc_pipe_mcps(skl, mconfig); 517 skl_tplg_alloc_pipe_mcps(skl, mconfig);
515 ret = skl_tplg_set_module_params(w, ctx); 518 ret = skl_tplg_set_module_params(w, ctx);
516 if (ret < 0) 519 if (ret < 0)
@@ -537,6 +540,7 @@ static int skl_tplg_unload_pipe_modules(struct skl_sst *ctx,
537 if (ret < 0) 540 if (ret < 0)
538 return -EIO; 541 return -EIO;
539 } 542 }
543 skl_put_pvt_id(ctx, mconfig);
540 } 544 }
541 545
542 /* no modules to unload in this path, so return */ 546 /* no modules to unload in this path, so return */