ASoC: wm8962: Wait for updated value of WM8962_CLOCKING1 register
authorChancel Liu <chancel.liu@nxp.com>
Wed, 9 Nov 2022 12:13:54 +0000 (20:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Dec 2022 10:37:15 +0000 (11:37 +0100)
commitd9f0107be1a973b9c89df52e8d0a23114aa98f98
treec0af0c61f65a5e6d79319798d52d6a0ae43f61ae
parent7ae0262748e5d8ff1e42b77bb19bba474733f280
ASoC: wm8962: Wait for updated value of WM8962_CLOCKING1 register

[ Upstream commit 3ca507bf99611c82dafced73e921c1b10ee12869 ]

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 <chancel.liu@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221109121354.123958-1-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/codecs/wm8962.c