Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: tlv320aic32x4: Ensure a minimum delay before clock stabilization

As indicated in the datasheet, a 10ms delay must be observed after
programming the divisors.

The lack of delay prevents the codec to work properly and the playback
appears extremely slow and totally un-audible on a custom sama5 based
board.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20200911173140.29984-2-miquel.raynal@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Miquel Raynal and committed by
Mark Brown
5b4458eb 501ef013

+8 -1
+8 -1
sound/soc/codecs/tlv320aic32x4-clk.c
··· 230 230 if (ret < 0) 231 231 return -EINVAL; 232 232 233 - return clk_aic32x4_pll_set_muldiv(pll, &settings); 233 + ret = clk_aic32x4_pll_set_muldiv(pll, &settings); 234 + if (ret) 235 + return ret; 236 + 237 + /* 10ms is the delay to wait before the clocks are stable */ 238 + msleep(10); 239 + 240 + return 0; 234 241 } 235 242 236 243 static int clk_aic32x4_pll_set_parent(struct clk_hw *hw, u8 index)