]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - sound/soc/codecs/tlv320aic3x.c
Merge remote-tracking branches 'asoc/topic/suspend', 'asoc/topic/tas2552', 'asoc...
[karo-tx-linux.git] / sound / soc / codecs / tlv320aic3x.c
index 64f179ee98345f841319599c255188e14fc37767..f7c2a575a892a2c89f196409207d2db7a48f652d 100644 (file)
@@ -1121,6 +1121,7 @@ static int aic3x_regulator_event(struct notifier_block *nb,
 static int aic3x_set_power(struct snd_soc_codec *codec, int power)
 {
        struct aic3x_priv *aic3x = snd_soc_codec_get_drvdata(codec);
+       unsigned int pll_c, pll_d;
        int ret;
 
        if (power) {
@@ -1138,6 +1139,18 @@ static int aic3x_set_power(struct snd_soc_codec *codec, int power)
                /* Sync reg_cache with the hardware */
                regcache_cache_only(aic3x->regmap, false);
                regcache_sync(aic3x->regmap);
+
+               /* Rewrite paired PLL D registers in case cached sync skipped
+                * writing one of them and thus caused other one also not
+                * being written
+                */
+               pll_c = snd_soc_read(codec, AIC3X_PLL_PROGC_REG);
+               pll_d = snd_soc_read(codec, AIC3X_PLL_PROGD_REG);
+               if (pll_c == aic3x_reg[AIC3X_PLL_PROGC_REG].def ||
+                       pll_d == aic3x_reg[AIC3X_PLL_PROGD_REG].def) {
+                       snd_soc_write(codec, AIC3X_PLL_PROGC_REG, pll_c);
+                       snd_soc_write(codec, AIC3X_PLL_PROGD_REG, pll_d);
+               }
        } else {
                /*
                 * Do soft reset to this codec instance in order to clear
@@ -1222,20 +1235,6 @@ static struct snd_soc_dai_driver aic3x_dai = {
        .symmetric_rates = 1,
 };
 
-static int aic3x_suspend(struct snd_soc_codec *codec)
-{
-       aic3x_set_bias_level(codec, SND_SOC_BIAS_OFF);
-
-       return 0;
-}
-
-static int aic3x_resume(struct snd_soc_codec *codec)
-{
-       aic3x_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
-       return 0;
-}
-
 static void aic3x_mono_init(struct snd_soc_codec *codec)
 {
        /* DAC to Mono Line Out default volume and route to Output mixer */
@@ -1429,8 +1428,6 @@ static struct snd_soc_codec_driver soc_codec_dev_aic3x = {
        .idle_bias_off = true,
        .probe = aic3x_probe,
        .remove = aic3x_remove,
-       .suspend = aic3x_suspend,
-       .resume = aic3x_resume,
        .controls = aic3x_snd_controls,
        .num_controls = ARRAY_SIZE(aic3x_snd_controls),
        .dapm_widgets = aic3x_dapm_widgets,