aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2017-01-24 06:44:00 -0500
committerMark Brown <broonie@kernel.org>2017-01-24 07:14:36 -0500
commite779974b86491cc938dfdcbfbf8fb363a40bc9ea (patch)
tree46a454fdf2ed84d8b3e30dc62a63561aee4dd37b
parentbb24ee411ae949eaffe24c6be2b3d87f271507b5 (diff)
ASoC: wm_adsp: Set booted/running flags at the end of bring up
The booted and running flags should really only be set once all the steps at that power level have been complete. Currently operations can fail after the flags have been set, which would leave us in an inconsistent state where the flags are set but the things expected to reach that level have not happened. Whilst there isn't really any major impact from this it is best to clean it up. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/wm_adsp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 09e50e5e7870..746a5e23cb8b 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -2469,14 +2469,14 @@ static void wm_adsp2_boot_work(struct work_struct *work)
2469 if (ret != 0) 2469 if (ret != 0)
2470 goto err_ena; 2470 goto err_ena;
2471 2471
2472 dsp->booted = true;
2473
2474 /* Turn DSP back off until we are ready to run */ 2472 /* Turn DSP back off until we are ready to run */
2475 ret = regmap_update_bits(dsp->regmap, dsp->base + ADSP2_CONTROL, 2473 ret = regmap_update_bits(dsp->regmap, dsp->base + ADSP2_CONTROL,
2476 ADSP2_SYS_ENA, 0); 2474 ADSP2_SYS_ENA, 0);
2477 if (ret != 0) 2475 if (ret != 0)
2478 goto err_ena; 2476 goto err_ena;
2479 2477
2478 dsp->booted = true;
2479
2480 mutex_unlock(&dsp->pwr_lock); 2480 mutex_unlock(&dsp->pwr_lock);
2481 2481
2482 return; 2482 return;
@@ -2616,14 +2616,14 @@ int wm_adsp2_event(struct snd_soc_dapm_widget *w,
2616 if (ret != 0) 2616 if (ret != 0)
2617 goto err; 2617 goto err;
2618 2618
2619 dsp->running = true;
2620
2621 if (wm_adsp_fw[dsp->fw].num_caps != 0) { 2619 if (wm_adsp_fw[dsp->fw].num_caps != 0) {
2622 ret = wm_adsp_buffer_init(dsp); 2620 ret = wm_adsp_buffer_init(dsp);
2623 if (ret < 0) 2621 if (ret < 0)
2624 goto err; 2622 goto err;
2625 } 2623 }
2626 2624
2625 dsp->running = true;
2626
2627 mutex_unlock(&dsp->pwr_lock); 2627 mutex_unlock(&dsp->pwr_lock);
2628 2628
2629 break; 2629 break;