Skip to content

Commit 3ca507b

Browse files
Chancel Liubroonie
authored andcommitted
ASoC: wm8962: Wait for updated value of WM8962_CLOCKING1 register
DSPCLK_DIV field in WM8962_CLOCKING1 register is used to generate correct frequency of LRCLK and BCLK. Sometimes the read-only value can't be updated timely after enabling SYSCLK. This results in wrong calculation values. Delay is introduced here to wait for newest value from register. The time of the delay should be at least 500~1000us according to test. Signed-off-by: Chancel Liu <[email protected]> Acked-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 7d945b0 commit 3ca507b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sound/soc/codecs/wm8962.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,6 +2503,14 @@ static void wm8962_configure_bclk(struct snd_soc_component *component)
25032503
snd_soc_component_update_bits(component, WM8962_CLOCKING2,
25042504
WM8962_SYSCLK_ENA_MASK, WM8962_SYSCLK_ENA);
25052505

2506+
/* DSPCLK_DIV field in WM8962_CLOCKING1 register is used to generate
2507+
* correct frequency of LRCLK and BCLK. Sometimes the read-only value
2508+
* can't be updated timely after enabling SYSCLK. This results in wrong
2509+
* calculation values. Delay is introduced here to wait for newest
2510+
* value from register. The time of the delay should be at least
2511+
* 500~1000us according to test.
2512+
*/
2513+
usleep_range(500, 1000);
25062514
dspclk = snd_soc_component_read(component, WM8962_CLOCKING1);
25072515

25082516
if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_ON)

0 commit comments

Comments
 (0)