ASoC: tlv320aic3x: Don't sync first two registers from register cache
[linux-2.6-block.git] / sound / soc / codecs / tlv320aic3x.c
index 3bedab26892f9d7243025d05258e028b032a8300..9047bb173c6b9b1618d4f24dc3e0dd49acae4f02 100644 (file)
@@ -157,7 +157,8 @@ static int aic3x_read(struct snd_soc_codec *codec, unsigned int reg,
 static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol,
                                        struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
+       struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol);
+       struct snd_soc_dapm_widget *widget = wlist->widgets[0];
        struct soc_mixer_control *mc =
                (struct soc_mixer_control *)kcontrol->private_value;
        unsigned int reg = mc->reg;
@@ -884,7 +885,7 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream,
        if (bypass_pll)
                return 0;
 
-       /* Use PLL, compute apropriate setup for j, d, r and p, the closest
+       /* Use PLL, compute appropriate setup for j, d, r and p, the closest
         * one wins the game. Try with d==0 first, next with d!=0.
         * Constraints for j are according to the datasheet.
         * The sysclk is divided by 1000 to prevent integer overflows.
@@ -1113,7 +1114,7 @@ static int aic3x_set_power(struct snd_soc_codec *codec, int power)
 
                /* Sync reg_cache with the hardware */
                codec->cache_only = 0;
-               for (i = 0; i < ARRAY_SIZE(aic3x_reg); i++)
+               for (i = AIC3X_SAMPLE_RATE_SEL_REG; i < ARRAY_SIZE(aic3x_reg); i++)
                        snd_soc_write(codec, i, cache[i]);
                if (aic3x->model == AIC3X_MODEL_3007)
                        aic3x_init_3007(codec);