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

63 lines
2.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "R, Dharageswari" <dharageswari.r@intel.com>
Date: Mon, 25 Dec 2017 07:06:05 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Add an API to reset the usage count of
the DSP cores
Add an interface to reset the usage count of ADSP cores. This is needed in
situations where the DSP needs to restart afresh, after a crash
Change-Id: I56fcd89a9055b99671f0d4229f19aa0fd3340d48
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: Kale, Sanyog R <sanyog.r.kale@intel.com>
Reviewed-by: Prakash, Divya1
Reviewed-by: Kp, Jeeja <jeeja.kp@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.c | 12 ++++++++++++
sound/soc/intel/skylake/skl-sst-dsp.h | 1 +
2 files changed, 13 insertions(+)
diff --git a/sound/soc/intel/skylake/skl-sst-dsp.c b/sound/soc/intel/skylake/skl-sst-dsp.c
index b34f7b73e24e..0b1cc44c901d 100644
--- a/sound/soc/intel/skylake/skl-sst-dsp.c
+++ b/sound/soc/intel/skylake/skl-sst-dsp.c
@@ -54,6 +54,18 @@ void skl_dsp_init_core_state(struct sst_dsp *ctx)
}
}
+void skl_dsp_reset_core_state(struct sst_dsp *ctx)
+{
+ struct skl_sst *skl = ctx->thread_context;
+ int i;
+
+ for (i = 0; i < skl->cores.count; i++) {
+ skl->cores.state[i] = SKL_DSP_RESET;
+ skl->cores.usage_count[i] = 0;
+ }
+}
+EXPORT_SYMBOL_GPL(skl_dsp_reset_core_state);
+
/* Get the mask for all enabled cores */
unsigned int skl_dsp_get_enabled_cores(struct sst_dsp *ctx)
{
diff --git a/sound/soc/intel/skylake/skl-sst-dsp.h b/sound/soc/intel/skylake/skl-sst-dsp.h
index 807f5b7db0ae..ef9bf4a4a1b7 100644
--- a/sound/soc/intel/skylake/skl-sst-dsp.h
+++ b/sound/soc/intel/skylake/skl-sst-dsp.h
@@ -273,6 +273,7 @@ bool is_skl_dsp_running(struct sst_dsp *ctx);
unsigned int skl_dsp_get_enabled_cores(struct sst_dsp *ctx);
void skl_dsp_init_core_state(struct sst_dsp *ctx);
+void skl_dsp_reset_core_state(struct sst_dsp *ctx);
int skl_dsp_enable_core(struct sst_dsp *ctx, unsigned int core_mask);
int skl_dsp_disable_core(struct sst_dsp *ctx, unsigned int core_mask);
int skl_dsp_core_power_up(struct sst_dsp *ctx, unsigned int core_mask);
--
https://clearlinux.org