From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: "R, Dharageswari" Date: Mon, 25 Dec 2017 07:03:56 +0530 Subject: [PATCH] ASoC: Intel: Skylake: Add API to reset private instance id of modules When the Audio DSP becomes unresponsive, DSP will be reset and firmware will be downloaded again. As a consequence of this driver resources need to be reinitialized with its default values. With this patch an API is added to reset private/dynamic instance id of the modules. This will be used during recovery of the Audio DSP Change-Id: Id4e7c4fca80d3dd97b823853cfd476d3d82dd116 Signed-off-by: R, Dharageswari Signed-off-by: Pradeep Tewani Reviewed-on: Reviewed-by: Periyasamy, SriramX Reviewed-by: Prakash, Divya1 Reviewed-by: Kale, Sanyog R Reviewed-by: Prusty, Subhransu S Tested-by: Madiwalar, MadiwalappaX --- sound/soc/intel/skylake/skl-sst-dsp.h | 1 + sound/soc/intel/skylake/skl-sst-utils.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h index 207bf3fe8ffd..807f5b7db0ae 100644 --- a/sound/soc/intel/skylake/skl-sst-dsp.h +++ b/sound/soc/intel/skylake/skl-sst-dsp.h @@ -307,6 +307,7 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw, int skl_get_module_id(struct skl_sst *ctx, uuid_le *uuid_mod); int skl_get_pvt_id(struct skl_sst *ctx, uuid_le *uuid_mod, int instance_id); int skl_put_pvt_id(struct skl_sst *ctx, uuid_le *uuid_mod, int *pvt_id); +void skl_reset_instance_id(struct skl_sst *ctx); int skl_get_pvt_instance_id_map(struct skl_sst *ctx, int module_id, int instance_id); void skl_freeup_uuid_list(struct skl_sst *ctx); diff --git a/sound/soc/intel/skylake/skl-sst-utils.c b/sound/soc/intel/skylake/skl-sst-utils.c index f20b842af4e4..8f4056ebf670 100644 --- a/sound/soc/intel/skylake/skl-sst-utils.c +++ b/sound/soc/intel/skylake/skl-sst-utils.c @@ -292,7 +292,21 @@ int skl_put_pvt_id(struct skl_sst *ctx, uuid_le *uuid_mod, int *pvt_id) } EXPORT_SYMBOL_GPL(skl_put_pvt_id); +void skl_reset_instance_id(struct skl_sst *ctx) +{ + struct uuid_module *module; + int size, i; + + list_for_each_entry(module, &ctx->uuid_list, list) { + for (i = 0; i < MAX_INSTANCE_BUFF; i++) + module->pvt_id[i] = 0; + + size = sizeof(int) * module->max_instance; + memset(module->instance_id, -1, size); + } +} +EXPORT_SYMBOL_GPL(skl_reset_instance_id); int skl_dsp_crash_dump_read(struct skl_sst *ctx, int stack_size) { -- https://clearlinux.org