]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: fsl_sai: use DIV_ROUND_CLOSEST() to calculate divider
authorSascha Hauer <s.hauer@pengutronix.de>
Wed, 2 Mar 2022 08:34:27 +0000 (09:34 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 7 Mar 2022 13:13:09 +0000 (13:13 +0000)
commit28fccc679165e50e68adde6ca252c6ba6b069585
tree2074ea987682d6faeceba7a245cb7c6580cf54e7
parentbc24cacf5819ecbf0f021e32c1607c4bdac9d85c
ASoC: fsl_sai: use DIV_ROUND_CLOSEST() to calculate divider

In fsl_sai_set_bclk() we want to calculate the divider that gets us
closest to the desired frequency, so use DIV_ROUND_CLOSEST() instead of
just doing a clk_rate/freq.
Also discard invalid ratios earlier.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.kernel.org/r/20220302083428.3804687-7-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_sai.c