ASoC: Use standard snd_soc_cache_sync() for WM9090
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 13 Dec 2011 13:04:26 +0000 (21:04 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 14 Dec 2011 09:07:39 +0000 (17:07 +0800)
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/codecs/wm9090.c

index d1d2c703eab2c75814e767b78439798ff6636ee9..41ebe0dce772c908bcbcf53fdaff8264ac497e55 100644 (file)
@@ -513,18 +513,7 @@ static int wm9090_set_bias_level(struct snd_soc_codec *codec,
        case SND_SOC_BIAS_STANDBY:
                if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
                        /* Restore the register cache */
-                       for (i = 1; i < codec->driver->reg_cache_size; i++) {
-                               if (reg_cache[i] == wm9090_reg_defaults[i])
-                                       continue;
-                               if (wm9090_volatile(codec, i))
-                                       continue;
-
-                               ret = snd_soc_write(codec, i, reg_cache[i]);
-                               if (ret != 0)
-                                       dev_warn(codec->dev,
-                                                "Failed to restore register %d: %d\n",
-                                                i, ret);
-                       }
+                       snd_soc_cache_sync(codec);
                }
 
                /* We keep VMID off during standby since the combination of