clear-pkgs-linux-iot-lts2018/0405-ASoC-Intel-Skylake-Add...

68 lines
2.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "R, Dharageswari" <dharageswari.r@intel.com>
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 <dharageswari.r@intel.com>
Signed-off-by: Pradeep Tewani <pradeep.d.tewani@intel.com>
Reviewed-on:
Reviewed-by: Periyasamy, SriramX <sriramx.periyasamy@intel.com>
Reviewed-by: Prakash, Divya1
Reviewed-by: Kale, Sanyog R <sanyog.r.kale@intel.com>
Reviewed-by: Prusty, Subhransu S <subhransu.s.prusty@intel.com>
Tested-by: Madiwalar, MadiwalappaX <madiwalappax.madiwalar@intel.com>
---
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 207bf3f..807f5b7 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 f20b842..8f4056e 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