diff options
author | Dharageswari R <dharageswari.r@intel.com> | 2016-08-10 00:10:48 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-08-10 13:54:05 -0400 |
commit | 0556ba463b2419e4f4833563aa3d75aafd9b9c01 (patch) | |
tree | 472917e3bd410ffc83f5b9c515dd808e2af0ab70 /sound/soc/intel | |
parent | da74273c49ebd7049fddc4af3845881c74e00f38 (diff) |
ASoC: Intel: Skylake: modify snd_skl_get_module_info args
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>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel')
-rw-r--r-- | sound/soc/intel/skylake/skl-sst-dsp.h | 7 | ||||
-rw-r--r-- | sound/soc/intel/skylake/skl-sst-utils.c | 10 | ||||
-rw-r--r-- | 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 @@ | |||
20 | #include <sound/memalloc.h> | 20 | #include <sound/memalloc.h> |
21 | #include "skl-sst-cldma.h" | 21 | #include "skl-sst-cldma.h" |
22 | #include "skl-tplg-interface.h" | 22 | #include "skl-tplg-interface.h" |
23 | #include "skl-topology.h" | ||
23 | 24 | ||
24 | struct sst_dsp; | 25 | struct sst_dsp; |
25 | struct skl_sst; | 26 | struct skl_sst; |
@@ -210,10 +211,10 @@ int bxt_sst_init_fw(struct device *dev, struct skl_sst *ctx); | |||
210 | void skl_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx); | 211 | void skl_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx); |
211 | void bxt_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx); | 212 | void bxt_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx); |
212 | 213 | ||
213 | int snd_skl_get_module_info(struct skl_sst *ctx, u8 *uuid, | 214 | int snd_skl_get_module_info(struct skl_sst *ctx, |
214 | struct skl_dfw_module *dfw_config); | 215 | struct skl_module_cfg *mconfig); |
215 | int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw, | 216 | int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw, |
216 | unsigned int offset, int index); | 217 | unsigned int offset, int index); |
217 | void skl_freeup_uuid_list(struct skl_sst *ctx); | 218 | void skl_freeup_uuid_list(struct skl_sst *ctx); |
218 | 219 | ||
219 | int skl_dsp_strip_extended_manifest(struct firmware *fw); | 220 | 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 d94ff958d7e5..e4865ea950d7 100644 --- a/sound/soc/intel/skylake/skl-sst-utils.c +++ b/sound/soc/intel/skylake/skl-sst-utils.c | |||
@@ -115,18 +115,18 @@ struct skl_ext_manifest_hdr { | |||
115 | u32 entries; | 115 | u32 entries; |
116 | }; | 116 | }; |
117 | 117 | ||
118 | int snd_skl_get_module_info(struct skl_sst *ctx, u8 *uuid, | 118 | int snd_skl_get_module_info(struct skl_sst *ctx, |
119 | struct skl_dfw_module *dfw_config) | 119 | struct skl_module_cfg *mconfig) |
120 | { | 120 | { |
121 | struct uuid_module *module; | 121 | struct uuid_module *module; |
122 | uuid_le *uuid_mod; | 122 | uuid_le *uuid_mod; |
123 | 123 | ||
124 | uuid_mod = (uuid_le *)uuid; | 124 | uuid_mod = (uuid_le *)mconfig->guid; |
125 | 125 | ||
126 | list_for_each_entry(module, &ctx->uuid_list, list) { | 126 | list_for_each_entry(module, &ctx->uuid_list, list) { |
127 | if (uuid_le_cmp(*uuid_mod, module->uuid) == 0) { | 127 | if (uuid_le_cmp(*uuid_mod, module->uuid) == 0) { |
128 | dfw_config->module_id = module->id; | 128 | mconfig->id.module_id = module->id; |
129 | dfw_config->is_loadable = module->is_loadable; | 129 | mconfig->is_loadable = module->is_loadable; |
130 | 130 | ||
131 | return 0; | 131 | return 0; |
132 | } | 132 | } |
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) | |||
475 | 475 | ||
476 | /* check if module ids are populated */ | 476 | /* check if module ids are populated */ |
477 | if (mconfig->id.module_id < 0) { | 477 | if (mconfig->id.module_id < 0) { |
478 | struct skl_dfw_module *dfw_config; | 478 | ret = snd_skl_get_module_info(skl->skl_sst, mconfig); |
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) { | 479 | if (ret < 0) { |
487 | dev_err(skl->skl_sst->dev, | 480 | dev_err(skl->skl_sst->dev, |
488 | "query module info failed: %d\n", ret); | 481 | "query module info failed: %d\n", ret); |
489 | kfree(dfw_config); | ||
490 | return ret; | 482 | return ret; |
491 | } | 483 | } |
492 | mconfig->id.module_id = dfw_config->module_id; | ||
493 | mconfig->is_loadable = dfw_config->is_loadable; | ||
494 | |||
495 | kfree(dfw_config); | ||
496 | } | 484 | } |
497 | 485 | ||
498 | /* check resource available */ | 486 | /* check resource available */ |