Commit ef2a352c authored by Dharageswari R's avatar Dharageswari R Committed by Mark Brown

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: default avatarDharageswari R <dharageswari.r@intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 700a9a63
...@@ -787,6 +787,7 @@ static int skl_alloc_queue(struct skl_module_pin *mpin, ...@@ -787,6 +787,7 @@ static int skl_alloc_queue(struct skl_module_pin *mpin,
mpin[i].in_use = true; mpin[i].in_use = true;
mpin[i].id.module_id = id.module_id; mpin[i].id.module_id = id.module_id;
mpin[i].id.instance_id = id.instance_id; mpin[i].id.instance_id = id.instance_id;
mpin[i].id.pvt_id = id.pvt_id;
mpin[i].tgt_mcfg = tgt_cfg; mpin[i].tgt_mcfg = tgt_cfg;
return i; return i;
} }
...@@ -810,6 +811,7 @@ static void skl_free_queue(struct skl_module_pin *mpin, int q_index) ...@@ -810,6 +811,7 @@ static void skl_free_queue(struct skl_module_pin *mpin, int q_index)
mpin[q_index].in_use = false; mpin[q_index].in_use = false;
mpin[q_index].id.module_id = 0; mpin[q_index].id.module_id = 0;
mpin[q_index].id.instance_id = 0; mpin[q_index].id.instance_id = 0;
mpin[q_index].id.pvt_id = 0;
} }
mpin[q_index].pin_state = SKL_PIN_UNBIND; mpin[q_index].pin_state = SKL_PIN_UNBIND;
mpin[q_index].tgt_mcfg = NULL; mpin[q_index].tgt_mcfg = NULL;
...@@ -850,7 +852,7 @@ int skl_init_module(struct skl_sst *ctx, ...@@ -850,7 +852,7 @@ int skl_init_module(struct skl_sst *ctx,
struct skl_ipc_init_instance_msg msg; struct skl_ipc_init_instance_msg msg;
dev_dbg(ctx->dev, "%s: module_id = %d instance=%d\n", __func__, dev_dbg(ctx->dev, "%s: module_id = %d instance=%d\n", __func__,
mconfig->id.module_id, mconfig->id.instance_id); mconfig->id.module_id, mconfig->id.pvt_id);
if (mconfig->pipe->state != SKL_PIPE_CREATED) { if (mconfig->pipe->state != SKL_PIPE_CREATED) {
dev_err(ctx->dev, "Pipe not created state= %d pipe_id= %d\n", 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,7 +868,7 @@ int skl_init_module(struct skl_sst *ctx,
} }
msg.module_id = mconfig->id.module_id; msg.module_id = mconfig->id.module_id;
msg.instance_id = mconfig->id.instance_id; msg.instance_id = mconfig->id.pvt_id;
msg.ppl_instance_id = mconfig->pipe->ppl_id; msg.ppl_instance_id = mconfig->pipe->ppl_id;
msg.param_data_size = module_config_size; msg.param_data_size = module_config_size;
msg.core_id = mconfig->core_id; 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,9 +889,9 @@ static void skl_dump_bind_info(struct skl_sst *ctx, struct skl_module_cfg
*src_module, struct skl_module_cfg *dst_module) *src_module, struct skl_module_cfg *dst_module)
{ {
dev_dbg(ctx->dev, "%s: src module_id = %d src_instance=%d\n", dev_dbg(ctx->dev, "%s: src module_id = %d src_instance=%d\n",
__func__, src_module->id.module_id, src_module->id.instance_id); __func__, src_module->id.module_id, src_module->id.pvt_id);
dev_dbg(ctx->dev, "%s: dst_module=%d dst_instacne=%d\n", __func__, dev_dbg(ctx->dev, "%s: dst_module=%d dst_instacne=%d\n", __func__,
dst_module->id.module_id, dst_module->id.instance_id); dst_module->id.module_id, dst_module->id.pvt_id);
dev_dbg(ctx->dev, "src_module state = %d dst module state = %d\n", dev_dbg(ctx->dev, "src_module state = %d dst module state = %d\n",
src_module->m_state, dst_module->m_state); src_module->m_state, dst_module->m_state);
...@@ -936,9 +938,9 @@ int skl_unbind_modules(struct skl_sst *ctx, ...@@ -936,9 +938,9 @@ int skl_unbind_modules(struct skl_sst *ctx,
return 0; return 0;
msg.module_id = src_mcfg->id.module_id; msg.module_id = src_mcfg->id.module_id;
msg.instance_id = src_mcfg->id.instance_id; msg.instance_id = src_mcfg->id.pvt_id;
msg.dst_module_id = dst_mcfg->id.module_id; msg.dst_module_id = dst_mcfg->id.module_id;
msg.dst_instance_id = dst_mcfg->id.instance_id; msg.dst_instance_id = dst_mcfg->id.pvt_id;
msg.bind = false; msg.bind = false;
ret = skl_ipc_bind_unbind(&ctx->ipc, &msg); ret = skl_ipc_bind_unbind(&ctx->ipc, &msg);
...@@ -997,9 +999,9 @@ int skl_bind_modules(struct skl_sst *ctx, ...@@ -997,9 +999,9 @@ int skl_bind_modules(struct skl_sst *ctx,
msg.src_queue, msg.dst_queue); msg.src_queue, msg.dst_queue);
msg.module_id = src_mcfg->id.module_id; msg.module_id = src_mcfg->id.module_id;
msg.instance_id = src_mcfg->id.instance_id; msg.instance_id = src_mcfg->id.pvt_id;
msg.dst_module_id = dst_mcfg->id.module_id; msg.dst_module_id = dst_mcfg->id.module_id;
msg.dst_instance_id = dst_mcfg->id.instance_id; msg.dst_instance_id = dst_mcfg->id.pvt_id;
msg.bind = true; msg.bind = true;
ret = skl_ipc_bind_unbind(&ctx->ipc, &msg); 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,7 +1179,7 @@ int skl_set_module_params(struct skl_sst *ctx, u32 *params, int size,
struct skl_ipc_large_config_msg msg; struct skl_ipc_large_config_msg msg;
msg.module_id = mcfg->id.module_id; msg.module_id = mcfg->id.module_id;
msg.instance_id = mcfg->id.instance_id; msg.instance_id = mcfg->id.pvt_id;
msg.param_data_size = size; msg.param_data_size = size;
msg.large_param_id = param_id; msg.large_param_id = param_id;
...@@ -1190,7 +1192,7 @@ int skl_get_module_params(struct skl_sst *ctx, u32 *params, int size, ...@@ -1190,7 +1192,7 @@ int skl_get_module_params(struct skl_sst *ctx, u32 *params, int size,
struct skl_ipc_large_config_msg msg; struct skl_ipc_large_config_msg msg;
msg.module_id = mcfg->id.module_id; msg.module_id = mcfg->id.module_id;
msg.instance_id = mcfg->id.instance_id; msg.instance_id = mcfg->id.pvt_id;
msg.param_data_size = size; msg.param_data_size = size;
msg.large_param_id = param_id; msg.large_param_id = param_id;
......
...@@ -136,7 +136,7 @@ int snd_skl_get_module_info(struct skl_sst *ctx, ...@@ -136,7 +136,7 @@ int snd_skl_get_module_info(struct skl_sst *ctx,
EXPORT_SYMBOL_GPL(snd_skl_get_module_info); EXPORT_SYMBOL_GPL(snd_skl_get_module_info);
static inline int skl_getid_32(struct uuid_module *module, u64 *val, static inline int skl_getid_32(struct uuid_module *module, u64 *val,
int word1_mask, int word2_mask) int word1_mask, int word2_mask)
{ {
int index, max_inst, pvt_id; int index, max_inst, pvt_id;
u32 mask_val; u32 mask_val;
......
...@@ -505,12 +505,15 @@ skl_tplg_init_pipe_modules(struct skl *skl, struct skl_pipe *pipe) ...@@ -505,12 +505,15 @@ skl_tplg_init_pipe_modules(struct skl *skl, struct skl_pipe *pipe)
* FE/BE params * FE/BE params
*/ */
skl_tplg_update_module_params(w, ctx); skl_tplg_update_module_params(w, ctx);
mconfig->id.pvt_id = skl_get_pvt_id(ctx, mconfig);
if (mconfig->id.pvt_id < 0)
return ret;
skl_tplg_set_module_init_data(w); skl_tplg_set_module_init_data(w);
ret = skl_init_module(ctx, mconfig); ret = skl_init_module(ctx, mconfig);
if (ret < 0) if (ret < 0) {
skl_put_pvt_id(ctx, mconfig);
return ret; return ret;
}
skl_tplg_alloc_pipe_mcps(skl, mconfig); skl_tplg_alloc_pipe_mcps(skl, mconfig);
ret = skl_tplg_set_module_params(w, ctx); ret = skl_tplg_set_module_params(w, ctx);
if (ret < 0) if (ret < 0)
...@@ -537,6 +540,7 @@ static int skl_tplg_unload_pipe_modules(struct skl_sst *ctx, ...@@ -537,6 +540,7 @@ static int skl_tplg_unload_pipe_modules(struct skl_sst *ctx,
if (ret < 0) if (ret < 0)
return -EIO; return -EIO;
} }
skl_put_pvt_id(ctx, mconfig);
} }
/* no modules to unload in this path, so return */ /* no modules to unload in this path, so return */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment