diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2016-09-26 05:15:23 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-09-26 12:03:53 -0400 |
commit | 90d19ba54b428a6bc8cc51ef6c60c6e65e6e2f35 (patch) | |
tree | 83ac2a0d8f2b78eda69e8c5dc8dfebeb2f80826f /sound/soc/codecs/wm_adsp.c | |
parent | 1fa96f3fdad7cef5d043a502682580d2bc3d5ace (diff) |
ASoC: wm_adsp: Put DSP into low power state between loading and running
Between when we load the DSP and when it actually starts running put the
core into a lower power state where the memory is retained but nothing
is clocked.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/wm_adsp.c')
-rw-r--r-- | sound/soc/codecs/wm_adsp.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index 4188c3763bc3..446f0297733f 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c | |||
@@ -2259,6 +2259,11 @@ static void wm_adsp2_boot_work(struct work_struct *work) | |||
2259 | 2259 | ||
2260 | mutex_lock(&dsp->pwr_lock); | 2260 | mutex_lock(&dsp->pwr_lock); |
2261 | 2261 | ||
2262 | ret = regmap_update_bits(dsp->regmap, dsp->base + ADSP2_CONTROL, | ||
2263 | ADSP2_MEM_ENA, ADSP2_MEM_ENA); | ||
2264 | if (ret != 0) | ||
2265 | goto err_mutex; | ||
2266 | |||
2262 | ret = wm_adsp2_ena(dsp); | 2267 | ret = wm_adsp2_ena(dsp); |
2263 | if (ret != 0) | 2268 | if (ret != 0) |
2264 | goto err_mutex; | 2269 | goto err_mutex; |
@@ -2282,6 +2287,12 @@ static void wm_adsp2_boot_work(struct work_struct *work) | |||
2282 | 2287 | ||
2283 | dsp->booted = true; | 2288 | dsp->booted = true; |
2284 | 2289 | ||
2290 | /* Turn DSP back off until we are ready to run */ | ||
2291 | ret = regmap_update_bits(dsp->regmap, dsp->base + ADSP2_CONTROL, | ||
2292 | ADSP2_SYS_ENA, 0); | ||
2293 | if (ret != 0) | ||
2294 | goto err_ena; | ||
2295 | |||
2285 | mutex_unlock(&dsp->pwr_lock); | 2296 | mutex_unlock(&dsp->pwr_lock); |
2286 | 2297 | ||
2287 | return; | 2298 | return; |
@@ -2344,6 +2355,10 @@ int wm_adsp2_event(struct snd_soc_dapm_widget *w, | |||
2344 | if (!dsp->booted) | 2355 | if (!dsp->booted) |
2345 | return -EIO; | 2356 | return -EIO; |
2346 | 2357 | ||
2358 | ret = wm_adsp2_ena(dsp); | ||
2359 | if (ret != 0) | ||
2360 | goto err; | ||
2361 | |||
2347 | /* Sync set controls */ | 2362 | /* Sync set controls */ |
2348 | ret = wm_coeff_sync_controls(dsp); | 2363 | ret = wm_coeff_sync_controls(dsp); |
2349 | if (ret != 0) | 2364 | if (ret != 0) |
@@ -2382,7 +2397,8 @@ int wm_adsp2_event(struct snd_soc_dapm_widget *w, | |||
2382 | dsp->booted = false; | 2397 | dsp->booted = false; |
2383 | 2398 | ||
2384 | regmap_update_bits(dsp->regmap, dsp->base + ADSP2_CONTROL, | 2399 | regmap_update_bits(dsp->regmap, dsp->base + ADSP2_CONTROL, |
2385 | ADSP2_CORE_ENA | ADSP2_START, 0); | 2400 | ADSP2_MEM_ENA | ADSP2_CORE_ENA | ADSP2_START, |
2401 | 0); | ||
2386 | 2402 | ||
2387 | /* Make sure DMAs are quiesced */ | 2403 | /* Make sure DMAs are quiesced */ |
2388 | regmap_write(dsp->regmap, dsp->base + ADSP2_RDMA_CONFIG_1, 0); | 2404 | regmap_write(dsp->regmap, dsp->base + ADSP2_RDMA_CONFIG_1, 0); |