ASoC: adsp: Keep ADSP2 memory powered off when not in use
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 2 Dec 2012 12:37:00 +0000 (21:37 +0900)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 2 Dec 2012 15:09:20 +0000 (00:09 +0900)
Turn off the ADSP memory when we aren't using it, saving a small amount of
power.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/codecs/wm_adsp.c

index a41742d..3a8d75b 100644 (file)
@@ -629,6 +629,17 @@ int wm_adsp2_init(struct wm_adsp *adsp, bool dvfs)
 {
        int ret;
 
+       /*
+        * Disable the DSP memory by default when in reset for a small
+        * power saving.
+        */
+       ret = regmap_update_bits(adsp->regmap, adsp->base + ADSP2_CONTROL,
+                                ADSP2_MEM_ENA, 0);
+       if (ret != 0) {
+               adsp_err(adsp, "Failed to clear memory retention: %d\n", ret);
+               return ret;
+       }
+
        if (dvfs) {
                adsp->dvfs = devm_regulator_get(adsp->dev, "DCVDD");
                if (IS_ERR(adsp->dvfs)) {