ASoC: Convert WM8903 bias management to use snd_soc_update_bits()
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 10 Feb 2011 13:32:58 +0000 (13:32 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 11 Feb 2011 11:13:48 +0000 (11:13 +0000)
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
sound/soc/codecs/wm8903.c

index 2f912276a8f5b5c4614099418a5ce86b612071c1..b88c6165dd25a30e3a78a9693ca1c7a050872946 100644 (file)
@@ -1139,15 +1139,13 @@ static int wm8903_add_widgets(struct snd_soc_codec *codec)
 static int wm8903_set_bias_level(struct snd_soc_codec *codec,
                                 enum snd_soc_bias_level level)
 {
-       u16 reg;
-
        switch (level) {
        case SND_SOC_BIAS_ON:
+               break;
        case SND_SOC_BIAS_PREPARE:
-               reg = snd_soc_read(codec, WM8903_VMID_CONTROL_0);
-               reg &= ~(WM8903_VMID_RES_MASK);
-               reg |= WM8903_VMID_RES_50K;
-               snd_soc_write(codec, WM8903_VMID_CONTROL_0, reg);
+               snd_soc_update_bits(codec, WM8903_VMID_CONTROL_0,
+                                   WM8903_VMID_RES_MASK,
+                                   WM8903_VMID_RES_50K);
                break;
 
        case SND_SOC_BIAS_STANDBY:
@@ -1174,10 +1172,9 @@ static int wm8903_set_bias_level(struct snd_soc_codec *codec,
                                            WM8903_CP_DYN_V);
                }
 
-               reg = snd_soc_read(codec, WM8903_VMID_CONTROL_0);
-               reg &= ~(WM8903_VMID_RES_MASK);
-               reg |= WM8903_VMID_RES_250K;
-               snd_soc_write(codec, WM8903_VMID_CONTROL_0, reg);
+               snd_soc_update_bits(codec, WM8903_VMID_CONTROL_0,
+                                   WM8903_VMID_RES_MASK,
+                                   WM8903_VMID_RES_250K);
                break;
 
        case SND_SOC_BIAS_OFF: