* [PATCH 1/3] ASoC: Intel: Skylake: modify snd_skl_get_module_info args
2016-08-10 4:10 [PATCH 0/3] ASoC: Intel: Skylake: Refine manifest module info Vinod Koul
@ 2016-08-10 4:10 ` Vinod Koul
2016-08-10 4:10 ` [PATCH 2/3] ASoC: Intel: Skylake: Populate modules after loading Vinod Koul
2016-08-10 4:10 ` [PATCH 3/3] ASoC: Intel: Skylake: remove module id query at runtime Vinod Koul
2 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2016-08-10 4:10 UTC (permalink / raw)
To: alsa-devel
Cc: liam.r.girdwood, patches.audio, Dharageswari R, broonie,
Vinod Koul
From: Dharageswari R <dharageswari.r@intel.com>
snd_skl_get_module_info() takes skl_dfw_module as an argument. The users
then updates the topology data, so instead pass skl_module_cfg and let
snd_skl_get_module_info() fill that up.
Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/intel/skylake/skl-sst-dsp.h | 7 ++++---
sound/soc/intel/skylake/skl-sst-utils.c | 10 +++++-----
sound/soc/intel/skylake/skl-topology.c | 14 +-------------
3 files changed, 10 insertions(+), 21 deletions(-)
diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h
index fa053c039203..6ad5cab4b0d5 100644
--- a/sound/soc/intel/skylake/skl-sst-dsp.h
+++ b/sound/soc/intel/skylake/skl-sst-dsp.h
@@ -20,6 +20,7 @@
#include <sound/memalloc.h>
#include "skl-sst-cldma.h"
#include "skl-tplg-interface.h"
+#include "skl-topology.h"
struct sst_dsp;
struct skl_sst;
@@ -210,10 +211,10 @@ int bxt_sst_init_fw(struct device *dev, struct skl_sst *ctx);
void skl_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx);
void bxt_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx);
-int snd_skl_get_module_info(struct skl_sst *ctx, u8 *uuid,
- struct skl_dfw_module *dfw_config);
+int snd_skl_get_module_info(struct skl_sst *ctx,
+ struct skl_module_cfg *mconfig);
int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw,
- unsigned int offset, int index);
+ unsigned int offset, int index);
void skl_freeup_uuid_list(struct skl_sst *ctx);
int skl_dsp_strip_extended_manifest(struct firmware *fw);
diff --git a/sound/soc/intel/skylake/skl-sst-utils.c b/sound/soc/intel/skylake/skl-sst-utils.c
index fe36e0cf391c..0f990ebbe620 100644
--- a/sound/soc/intel/skylake/skl-sst-utils.c
+++ b/sound/soc/intel/skylake/skl-sst-utils.c
@@ -115,13 +115,13 @@ struct skl_ext_manifest_hdr {
u32 entries;
};
-int snd_skl_get_module_info(struct skl_sst *ctx, u8 *uuid,
- struct skl_dfw_module *dfw_config)
+int snd_skl_get_module_info(struct skl_sst *ctx,
+ struct skl_module_cfg *mconfig)
{
struct uuid_module *module;
uuid_le *uuid_mod;
- uuid_mod = (uuid_le *)uuid;
+ uuid_mod = (uuid_le *)mconfig->guid;
if (list_empty(&ctx->uuid_list)) {
dev_err(ctx->dev, "Module list is empty\n");
@@ -130,8 +130,8 @@ int snd_skl_get_module_info(struct skl_sst *ctx, u8 *uuid,
list_for_each_entry(module, &ctx->uuid_list, list) {
if (uuid_le_cmp(*uuid_mod, module->uuid) == 0) {
- dfw_config->module_id = module->id;
- dfw_config->is_loadable = module->is_loadable;
+ mconfig->id.module_id = module->id;
+ mconfig->is_loadable = module->is_loadable;
return 0;
}
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index c13fbefe6abf..c09e2c7608a3 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -475,24 +475,12 @@ skl_tplg_init_pipe_modules(struct skl *skl, struct skl_pipe *pipe)
/* check if module ids are populated */
if (mconfig->id.module_id < 0) {
- struct skl_dfw_module *dfw_config;
-
- dfw_config = kzalloc(sizeof(*dfw_config), GFP_KERNEL);
- if (!dfw_config)
- return -ENOMEM;
-
- ret = snd_skl_get_module_info(skl->skl_sst,
- mconfig->guid, dfw_config);
+ ret = snd_skl_get_module_info(skl->skl_sst, mconfig);
if (ret < 0) {
dev_err(skl->skl_sst->dev,
"query module info failed: %d\n", ret);
- kfree(dfw_config);
return ret;
}
- mconfig->id.module_id = dfw_config->module_id;
- mconfig->is_loadable = dfw_config->is_loadable;
-
- kfree(dfw_config);
}
/* check resource available */
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/3] ASoC: Intel: Skylake: Populate modules after loading
2016-08-10 4:10 [PATCH 0/3] ASoC: Intel: Skylake: Refine manifest module info Vinod Koul
2016-08-10 4:10 ` [PATCH 1/3] ASoC: Intel: Skylake: modify snd_skl_get_module_info args Vinod Koul
@ 2016-08-10 4:10 ` Vinod Koul
2016-08-10 20:04 ` Applied "ASoC: Intel: Skylake: Populate modules after loading" to the asoc tree Mark Brown
2016-08-10 4:10 ` [PATCH 3/3] ASoC: Intel: Skylake: remove module id query at runtime Vinod Koul
2 siblings, 1 reply; 6+ messages in thread
From: Vinod Koul @ 2016-08-10 4:10 UTC (permalink / raw)
To: alsa-devel; +Cc: liam.r.girdwood, patches.audio, broonie, Vinod Koul
Once topology and firmware are loaded, we can parse the manifest. Use driver
pipe and widget list to get list of all modules and populate the data.
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/intel/skylake/skl-pcm.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index 140249269cdb..eb1f00b28df1 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -1138,6 +1138,32 @@ static int skl_pcm_new(struct snd_soc_pcm_runtime *rtd)
return retval;
}
+static int skl_populate_modules(struct skl *skl)
+{
+ struct skl_pipeline *p;
+ struct skl_pipe_module *m;
+ struct snd_soc_dapm_widget *w;
+ struct skl_module_cfg *mconfig;
+ int ret;
+
+ list_for_each_entry(p, &skl->ppl_list, node) {
+ list_for_each_entry(m, &p->pipe->w_list, node) {
+
+ w = m->w;
+ mconfig = w->priv;
+
+ ret = snd_skl_get_module_info(skl->skl_sst, mconfig);
+ if (ret < 0) {
+ dev_err(skl->skl_sst->dev,
+ "query module info failed:%d\n", ret);
+ goto err;
+ }
+ }
+ }
+err:
+ return ret;
+}
+
static int skl_platform_soc_probe(struct snd_soc_platform *platform)
{
struct hdac_ext_bus *ebus = dev_get_drvdata(platform->dev);
@@ -1169,6 +1195,7 @@ static int skl_platform_soc_probe(struct snd_soc_platform *platform)
dev_err(platform->dev, "Failed to boot first fw: %d\n", ret);
return ret;
}
+ skl_populate_modules(skl);
}
pm_runtime_mark_last_busy(platform->dev);
pm_runtime_put_autosuspend(platform->dev);
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/3] ASoC: Intel: Skylake: remove module id query at runtime
2016-08-10 4:10 [PATCH 0/3] ASoC: Intel: Skylake: Refine manifest module info Vinod Koul
2016-08-10 4:10 ` [PATCH 1/3] ASoC: Intel: Skylake: modify snd_skl_get_module_info args Vinod Koul
2016-08-10 4:10 ` [PATCH 2/3] ASoC: Intel: Skylake: Populate modules after loading Vinod Koul
@ 2016-08-10 4:10 ` Vinod Koul
2016-08-10 20:04 ` Applied "ASoC: Intel: Skylake: remove module id query at runtime" to the asoc tree Mark Brown
2 siblings, 1 reply; 6+ messages in thread
From: Vinod Koul @ 2016-08-10 4:10 UTC (permalink / raw)
To: alsa-devel; +Cc: liam.r.girdwood, patches.audio, broonie, Vinod Koul
Now that we have balanced loading of the topology file and split of init
and fw_init and fill module data during asoc probe.
So remove it from runtime, but keep error check in case things fall apart.
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/intel/skylake/skl-topology.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index c09e2c7608a3..4bc8f9c269db 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -475,12 +475,10 @@ skl_tplg_init_pipe_modules(struct skl *skl, struct skl_pipe *pipe)
/* check if module ids are populated */
if (mconfig->id.module_id < 0) {
- ret = snd_skl_get_module_info(skl->skl_sst, mconfig);
- if (ret < 0) {
- dev_err(skl->skl_sst->dev,
- "query module info failed: %d\n", ret);
- return ret;
- }
+ dev_err(skl->skl_sst->dev,
+ "module %pUL id not populated\n",
+ (uuid_le *)mconfig->guid);
+ return -EIO;
}
/* check resource available */
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread