aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8994_samsung.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-10-21 12:08:42 -0700
committerArve Hjønnevåg <arve@android.com>2011-11-17 17:51:26 -0800
commitc54363c80b2b84a92bb1954017c2177df1343d06 (patch)
tree834c5c5cd007503890de85ecf8d6fd0bb1c8fa04 /sound/soc/codecs/wm8994_samsung.c
parentf285e2c3263b94563bde469328e7915929d62b73 (diff)
downloadkernel_samsung_crespo-c54363c80b2b84a92bb1954017c2177df1343d06.zip
kernel_samsung_crespo-c54363c80b2b84a92bb1954017c2177df1343d06.tar.gz
kernel_samsung_crespo-c54363c80b2b84a92bb1954017c2177df1343d06.tar.bz2
ASoC: Save and restore DC servo state when unchanged
We only need to recalibrate the DC servo configuration when the analogue configuration is changed, which in this system means whenver the analogue volume is changed or whenever the path is changed. Use this to save the ~160ms taken by the recalibration by saving the value per-path We still need to recalibrate after volume changes and the first time a given path is used but these should be much less frequent events than headphone enable. Change-Id: I706fe161f5cc0709e58d7702b28796ed85c51384 Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8994_samsung.c')
-rwxr-xr-xsound/soc/codecs/wm8994_samsung.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8994_samsung.c b/sound/soc/codecs/wm8994_samsung.c
index adfb009..e48348d 100755
--- a/sound/soc/codecs/wm8994_samsung.c
+++ b/sound/soc/codecs/wm8994_samsung.c
@@ -228,6 +228,7 @@ static int wm899x_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
int reg = mc->reg;
+ struct wm8994_priv *wm8994 = codec->drvdata;
DEBUG_LOG("");
@@ -235,6 +236,12 @@ static int wm899x_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
if (ret < 0)
return ret;
+ /* Volume changes in the headphone path mean we need to
+ * recallibrate DC servo */
+ if (strcmp(kcontrol->id.name, "Playback Spkr Volume") == 0 ||
+ strcmp(kcontrol->id.name, "Playback Volume") == 0)
+ memset(wm8994->dc_servo, 0, sizeof(wm8994->dc_servo));
+
val = wm8994_read(codec, reg);
return wm8994_write(codec, reg, val | 0x0100);