Skip to content

Commit cd22000

Browse files
committed
ASoC: wm8994: Lower AIFnCLK divisor when dropping to 32kHz
When lowering SYSCLK to 50kHz for accessory detection also lower the AIFnCLK divisor to normalise the clocking configuration within the device. This will not disrupt audio as we cannot support active audio with such a low SYSCLK. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
1 parent 6730049 commit cd22000

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎sound/soc/codecs/wm8994.c‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,6 +2258,18 @@ static int _wm8994_set_fll(struct snd_soc_codec *codec, int id, int src,
22582258

22592259
configure_clock(codec);
22602260

2261+
/*
2262+
* If SYSCLK will be less than 50kHz adjust AIFnCLK dividers
2263+
* for detection.
2264+
*/
2265+
if (max(wm8994->aifclk[0], wm8994->aifclk[1]) < 50000) {
2266+
dev_dbg(codec->dev, "Configuring AIFs for 128fs\n");
2267+
snd_soc_update_bits(codec, WM8994_AIF1_RATE,
2268+
WM8994_AIF1CLK_RATE_MASK, 0x1);
2269+
snd_soc_update_bits(codec, WM8994_AIF2_RATE,
2270+
WM8994_AIF2CLK_RATE_MASK, 0x1);
2271+
}
2272+
22612273
return 0;
22622274
}
22632275

0 commit comments

Comments
 (0)