diff options
author | Vinod Koul <vinod.koul@intel.com> | 2016-07-26 08:36:40 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-08-08 06:54:59 -0400 |
commit | b7c505554c11cc7978ab942b544d86dd92d59dcf (patch) | |
tree | 94182c1886cfdf16242fb20c170fdc603bf6408f | |
parent | 29b4817d4018df78086157ea3a55c1d9424a7cfc (diff) |
ASoC: Intel: Skylake: Move modules query to runtime
Since we are moving DSP init to later, at the topology load the
module info is not available.
So set the module id to -1 at init and query at first module
initialization.
Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/intel/skylake/skl-topology.c | 32 | ||||
-rw-r--r-- | sound/soc/intel/skylake/skl-topology.h | 2 |
2 files changed, 28 insertions, 6 deletions
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index cc0150fc2601..904103056d62 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c | |||
@@ -473,6 +473,28 @@ skl_tplg_init_pipe_modules(struct skl *skl, struct skl_pipe *pipe) | |||
473 | w = w_module->w; | 473 | w = w_module->w; |
474 | mconfig = w->priv; | 474 | mconfig = w->priv; |
475 | 475 | ||
476 | /* check if module ids are populated */ | ||
477 | if (mconfig->id.module_id < 0) { | ||
478 | struct skl_dfw_module *dfw_config; | ||
479 | |||
480 | dfw_config = kzalloc(sizeof(dfw_config), GFP_KERNEL); | ||
481 | if (!dfw_config) | ||
482 | return -ENOMEM; | ||
483 | |||
484 | ret = snd_skl_get_module_info(skl->skl_sst, | ||
485 | mconfig->guid, dfw_config); | ||
486 | if (ret < 0) { | ||
487 | dev_err(skl->skl_sst->dev, | ||
488 | "query module info failed: %d\n", ret); | ||
489 | kfree(dfw_config); | ||
490 | return ret; | ||
491 | } | ||
492 | mconfig->id.module_id = dfw_config->module_id; | ||
493 | mconfig->is_loadable = dfw_config->is_loadable; | ||
494 | |||
495 | kfree(dfw_config); | ||
496 | } | ||
497 | |||
476 | /* check resource available */ | 498 | /* check resource available */ |
477 | if (!skl_is_pipe_mcps_avail(skl, mconfig)) | 499 | if (!skl_is_pipe_mcps_avail(skl, mconfig)) |
478 | return -ENOMEM; | 500 | return -ENOMEM; |
@@ -1621,11 +1643,11 @@ static int skl_tplg_widget_load(struct snd_soc_component *cmpnt, | |||
1621 | w->priv = mconfig; | 1643 | w->priv = mconfig; |
1622 | memcpy(&mconfig->guid, &dfw_config->uuid, 16); | 1644 | memcpy(&mconfig->guid, &dfw_config->uuid, 16); |
1623 | 1645 | ||
1624 | ret = snd_skl_get_module_info(skl->skl_sst, mconfig->guid, dfw_config); | 1646 | /* |
1625 | if (ret < 0) | 1647 | * module binary can be loaded later, so set it to query when |
1626 | return ret; | 1648 | * module is load for a use case |
1627 | 1649 | */ | |
1628 | mconfig->id.module_id = dfw_config->module_id; | 1650 | mconfig->id.module_id = -1; |
1629 | mconfig->id.instance_id = dfw_config->instance_id; | 1651 | mconfig->id.instance_id = dfw_config->instance_id; |
1630 | mconfig->mcps = dfw_config->max_mcps; | 1652 | mconfig->mcps = dfw_config->max_mcps; |
1631 | mconfig->ibs = dfw_config->ibs; | 1653 | mconfig->ibs = dfw_config->ibs; |
diff --git a/sound/soc/intel/skylake/skl-topology.h b/sound/soc/intel/skylake/skl-topology.h index 22d3ef83817d..96fa86d0f93a 100644 --- a/sound/soc/intel/skylake/skl-topology.h +++ b/sound/soc/intel/skylake/skl-topology.h | |||
@@ -216,7 +216,7 @@ struct skl_module_fmt { | |||
216 | struct skl_module_cfg; | 216 | struct skl_module_cfg; |
217 | 217 | ||
218 | struct skl_module_inst_id { | 218 | struct skl_module_inst_id { |
219 | u32 module_id; | 219 | int module_id; |
220 | u32 instance_id; | 220 | u32 instance_id; |
221 | }; | 221 | }; |
222 | 222 | ||