ASoC: Don't do runtime wm_hubs DC servo updates if using offset correction
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 29 Mar 2010 15:34:42 +0000 (16:34 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 5 Apr 2010 15:19:29 +0000 (16:19 +0100)
If we need to offset correct the DC servo then don't use runtime
recalibration since that is likely to introduce further offsets
which will be evident on powerdown.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
sound/soc/codecs/wm_hubs.c

index 2b5c0924f6153539f449e5227dad5d19157c4141..e81ba6d2d7cd003fdd9eaa3b6c47510a40b143a9 100644 (file)
@@ -162,10 +162,16 @@ static int wm8993_put_dc_servo(struct snd_kcontrol *kcontrol,
                               struct snd_ctl_elem_value *ucontrol)
 {
        struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct wm_hubs_data *hubs = codec->private_data;
        int ret;
 
        ret = snd_soc_put_volsw_2r(kcontrol, ucontrol);
 
+       /* If we're applying an offset correction then updating the
+        * callibration would be likely to introduce further offsets. */
+       if (hubs->dcs_codes)
+               return ret;
+
        /* Only need to do this if the outputs are active */
        if (snd_soc_read(codec, WM8993_POWER_MANAGEMENT_1)
            & (WM8993_HPOUT1L_ENA | WM8993_HPOUT1R_ENA))