diff options
author | Jayachandran B <jayachandran.b@intel.com> | 2016-06-13 08:29:01 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-06-14 09:59:33 -0400 |
commit | 1665c177abf40338e7b5f1ae465d3aaabe5af9d0 (patch) | |
tree | 61ec443fe873056cd6c2b9798db328d36a8bd4f4 | |
parent | 316f135a4ec6fba2a53930f843a0c1c5d4ae1ea2 (diff) |
ASoC: Intel: Skylake: Enable firmware reload in suspend
Broxton DSP needs retains code loaded during runtime_pm cycles.
But it looses that on suspend cycle, so on resume we need to
download the firmware again.
This is done by adding a new flag and based on flag status, we
download the firmware.
Signed-off-by: Jayachandran B <jayachandran.b@intel.com>
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.c | 9 | ||||
-rw-r--r-- | sound/soc/intel/skylake/skl-sst-ipc.h | 3 | ||||
-rw-r--r-- | sound/soc/intel/skylake/skl-sst.c | 1 | ||||
-rw-r--r-- | sound/soc/intel/skylake/skl.c | 1 |
4 files changed, 14 insertions, 0 deletions
diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c index 46235b93e4f8..e50bac74f4a8 100644 --- a/sound/soc/intel/skylake/bxt-sst.c +++ b/sound/soc/intel/skylake/bxt-sst.c | |||
@@ -185,6 +185,7 @@ static int bxt_load_base_firmware(struct sst_dsp *ctx) | |||
185 | } else { | 185 | } else { |
186 | skl_dsp_set_state_locked(ctx, SKL_DSP_RUNNING); | 186 | skl_dsp_set_state_locked(ctx, SKL_DSP_RUNNING); |
187 | ret = 0; | 187 | ret = 0; |
188 | skl->fw_loaded = true; | ||
188 | } | 189 | } |
189 | } | 190 | } |
190 | 191 | ||
@@ -200,6 +201,14 @@ static int bxt_set_dsp_D0(struct sst_dsp *ctx) | |||
200 | 201 | ||
201 | skl->boot_complete = false; | 202 | skl->boot_complete = false; |
202 | 203 | ||
204 | if (skl->fw_loaded == false) { | ||
205 | dev_dbg(ctx->dev, "Re-loading fw\n"); | ||
206 | ret = bxt_load_base_firmware(ctx); | ||
207 | if (ret < 0) | ||
208 | dev_err(ctx->dev, "reload fw failed: %d\n", ret); | ||
209 | return ret; | ||
210 | } | ||
211 | |||
203 | ret = skl_dsp_enable_core(ctx); | 212 | ret = skl_dsp_enable_core(ctx); |
204 | if (ret < 0) { | 213 | if (ret < 0) { |
205 | dev_err(ctx->dev, "enable dsp core failed ret: %d\n", ret); | 214 | dev_err(ctx->dev, "enable dsp core failed ret: %d\n", ret); |
diff --git a/sound/soc/intel/skylake/skl-sst-ipc.h b/sound/soc/intel/skylake/skl-sst-ipc.h index 9f24261abf3e..5102c7b415fe 100644 --- a/sound/soc/intel/skylake/skl-sst-ipc.h +++ b/sound/soc/intel/skylake/skl-sst-ipc.h | |||
@@ -63,6 +63,9 @@ struct skl_sst { | |||
63 | 63 | ||
64 | /* Populate module information */ | 64 | /* Populate module information */ |
65 | struct list_head uuid_list; | 65 | struct list_head uuid_list; |
66 | |||
67 | /* Is firmware loaded */ | ||
68 | bool fw_loaded; | ||
66 | }; | 69 | }; |
67 | 70 | ||
68 | struct skl_ipc_init_instance_msg { | 71 | struct skl_ipc_init_instance_msg { |
diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index 4cabae54a71e..dff1076a5f9e 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c | |||
@@ -153,6 +153,7 @@ static int skl_load_base_firmware(struct sst_dsp *ctx) | |||
153 | 153 | ||
154 | dev_dbg(ctx->dev, "Download firmware successful%d\n", ret); | 154 | dev_dbg(ctx->dev, "Download firmware successful%d\n", ret); |
155 | skl_dsp_set_state_locked(ctx, SKL_DSP_RUNNING); | 155 | skl_dsp_set_state_locked(ctx, SKL_DSP_RUNNING); |
156 | skl->fw_loaded = true; | ||
156 | } | 157 | } |
157 | return 0; | 158 | return 0; |
158 | transfer_firmware_failed: | 159 | transfer_firmware_failed: |
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index c0f5d5565dea..734072c79205 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c | |||
@@ -248,6 +248,7 @@ static int skl_suspend(struct device *dev) | |||
248 | ret = _skl_suspend(ebus); | 248 | ret = _skl_suspend(ebus); |
249 | if (ret < 0) | 249 | if (ret < 0) |
250 | return ret; | 250 | return ret; |
251 | skl->skl_sst->fw_loaded = false; | ||
251 | } | 252 | } |
252 | 253 | ||
253 | if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) { | 254 | if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) { |