]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: wm8900: Fix wrong mask for setting DAC_CLKDIV/ADC_CLKDIV/LRCLK_MODE
authorAxel Lin <axel.lin@gmail.com>
Sun, 16 Oct 2011 15:27:55 +0000 (23:27 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 17 Oct 2011 21:49:28 +0000 (22:49 +0100)
After checking the datasheet, I think what we want to do here is to
clear the WM8900_REG_CLOCKING2_DAC_CLKDIV/WM8900_REG_CLOCKING2_ADC_CLKDIV/
WM8900_REG_DACCTRL_AIF_LRCLKRATE bits and then OR with div value.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/codecs/wm8900.c

index 082040eda8a22817f1944cfcfa8af5742fa89d19..b16522ff3ae154e036790bff3279623ab9223219 100644 (file)
@@ -844,17 +844,17 @@ static int wm8900_set_dai_clkdiv(struct snd_soc_dai *codec_dai,
        case WM8900_DAC_CLKDIV:
                reg = snd_soc_read(codec, WM8900_REG_CLOCKING2);
                snd_soc_write(codec, WM8900_REG_CLOCKING2,
-                            div | (reg & WM8900_REG_CLOCKING2_DAC_CLKDIV));
+                            div | (reg & ~WM8900_REG_CLOCKING2_DAC_CLKDIV));
                break;
        case WM8900_ADC_CLKDIV:
                reg = snd_soc_read(codec, WM8900_REG_CLOCKING2);
                snd_soc_write(codec, WM8900_REG_CLOCKING2,
-                            div | (reg & WM8900_REG_CLOCKING2_ADC_CLKDIV));
+                            div | (reg & ~WM8900_REG_CLOCKING2_ADC_CLKDIV));
                break;
        case WM8900_LRCLK_MODE:
                reg = snd_soc_read(codec, WM8900_REG_DACCTRL);
                snd_soc_write(codec, WM8900_REG_DACCTRL,
-                            div | (reg & WM8900_REG_DACCTRL_AIF_LRCLKRATE));
+                            div | (reg & ~WM8900_REG_DACCTRL_AIF_LRCLKRATE));
                break;
        default:
                return -EINVAL;