aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSenthilnathan Veppur <senthilnathanx.veppur@intel.com>2016-07-26 08:36:44 -0400
committerMark Brown <broonie@kernel.org>2016-08-08 06:54:59 -0400
commita8e2c19efd5d27577661124b1033b344650e4899 (patch)
tree73f26c8fa1fb07c7e5f9e2393e9416a851abf13c
parent15ecaba9148da2d4088c7025d06312d1cbd9d5eb (diff)
ASoC: Intel: Skylake: add additional args to module parsing
For additional library parsing, we need to pass firmware to be loaded and not use the pointer in context. Also, Library module IDs are combination of library index and module ID in manifest. So add the additional arguments of firmware and library offset to snd_skl_parse_uuids(). 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/bxt-sst.c2
-rw-r--r--sound/soc/intel/skylake/skl-sst-dsp.h3
-rw-r--r--sound/soc/intel/skylake/skl-sst-utils.c9
-rw-r--r--sound/soc/intel/skylake/skl-sst.c2
4 files changed, 9 insertions, 7 deletions
diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c
index eb68258b653d..d6bf32405b3b 100644
--- a/sound/soc/intel/skylake/bxt-sst.c
+++ b/sound/soc/intel/skylake/bxt-sst.c
@@ -175,7 +175,7 @@ static int bxt_load_base_firmware(struct sst_dsp *ctx)
175 if (ctx->fw == NULL) 175 if (ctx->fw == NULL)
176 goto sst_load_base_firmware_failed; 176 goto sst_load_base_firmware_failed;
177 177
178 ret = snd_skl_parse_uuids(ctx, BXT_ADSP_FW_BIN_HDR_OFFSET); 178 ret = snd_skl_parse_uuids(ctx, ctx->fw, BXT_ADSP_FW_BIN_HDR_OFFSET, 0);
179 if (ret < 0) 179 if (ret < 0)
180 goto sst_load_base_firmware_failed; 180 goto sst_load_base_firmware_failed;
181 181
diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h
index 7e994688d8a0..5bc77e1941a5 100644
--- a/sound/soc/intel/skylake/skl-sst-dsp.h
+++ b/sound/soc/intel/skylake/skl-sst-dsp.h
@@ -210,7 +210,8 @@ void bxt_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx);
210 210
211int snd_skl_get_module_info(struct skl_sst *ctx, u8 *uuid, 211int snd_skl_get_module_info(struct skl_sst *ctx, u8 *uuid,
212 struct skl_dfw_module *dfw_config); 212 struct skl_dfw_module *dfw_config);
213int snd_skl_parse_uuids(struct sst_dsp *ctx, unsigned int offset); 213int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw,
214 unsigned int offset, int index);
214void skl_freeup_uuid_list(struct skl_sst *ctx); 215void skl_freeup_uuid_list(struct skl_sst *ctx);
215 216
216int skl_dsp_strip_extended_manifest(struct firmware *fw); 217int 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 25fcb796bd86..d94ff958d7e5 100644
--- a/sound/soc/intel/skylake/skl-sst-utils.c
+++ b/sound/soc/intel/skylake/skl-sst-utils.c
@@ -140,7 +140,8 @@ EXPORT_SYMBOL_GPL(snd_skl_get_module_info);
140 * Parse the firmware binary to get the UUID, module id 140 * Parse the firmware binary to get the UUID, module id
141 * and loadable flags 141 * and loadable flags
142 */ 142 */
143int snd_skl_parse_uuids(struct sst_dsp *ctx, unsigned int offset) 143int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw,
144 unsigned int offset, int index)
144{ 145{
145 struct adsp_fw_hdr *adsp_hdr; 146 struct adsp_fw_hdr *adsp_hdr;
146 struct adsp_module_entry *mod_entry; 147 struct adsp_module_entry *mod_entry;
@@ -153,8 +154,8 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, unsigned int offset)
153 unsigned int safe_file; 154 unsigned int safe_file;
154 155
155 /* Get the FW pointer to derive ADSP header */ 156 /* Get the FW pointer to derive ADSP header */
156 stripped_fw.data = ctx->fw->data; 157 stripped_fw.data = fw->data;
157 stripped_fw.size = ctx->fw->size; 158 stripped_fw.size = fw->size;
158 159
159 skl_dsp_strip_extended_manifest(&stripped_fw); 160 skl_dsp_strip_extended_manifest(&stripped_fw);
160 161
@@ -205,7 +206,7 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, unsigned int offset)
205 uuid_bin = (uuid_le *)mod_entry->uuid.id; 206 uuid_bin = (uuid_le *)mod_entry->uuid.id;
206 memcpy(&module->uuid, uuid_bin, sizeof(module->uuid)); 207 memcpy(&module->uuid, uuid_bin, sizeof(module->uuid));
207 208
208 module->id = i; 209 module->id = (i | (index << 12));
209 module->is_loadable = mod_entry->type.load_type; 210 module->is_loadable = mod_entry->type.load_type;
210 211
211 list_add_tail(&module->list, &skl->uuid_list); 212 list_add_tail(&module->list, &skl->uuid_list);
diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c
index 6de4c027a65b..6e9c634cf84f 100644
--- a/sound/soc/intel/skylake/skl-sst.c
+++ b/sound/soc/intel/skylake/skl-sst.c
@@ -88,7 +88,7 @@ static int skl_load_base_firmware(struct sst_dsp *ctx)
88 } 88 }
89 } 89 }
90 90
91 ret = snd_skl_parse_uuids(ctx, SKL_ADSP_FW_BIN_HDR_OFFSET); 91 ret = snd_skl_parse_uuids(ctx, ctx->fw, SKL_ADSP_FW_BIN_HDR_OFFSET, 0);
92 if (ret < 0) { 92 if (ret < 0) {
93 dev_err(ctx->dev, 93 dev_err(ctx->dev,
94 "UUID parsing err: %d\n", ret); 94 "UUID parsing err: %d\n", ret);