ASoC: fsl_asrc: refine the check of available clock divider
authorShengjiu Wang <shengjiu.wang@nxp.com>
Wed, 5 Jan 2022 11:08:03 +0000 (19:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:04:20 +0000 (11:04 +0100)
commit8f5e866cbb97fd959a027ee185da3df7b16c5084
tree6fffde8bdca07e921d810c497ebf6c9d0057b2da
parent0cd1ef3f7b898b7bb30e0ef0c475764b4007195a
ASoC: fsl_asrc: refine the check of available clock divider

[ Upstream commit 320386343451ab6a3577e0ee200dac56a6182944 ]

According to RM, the clock divider range is from 1 to 8, clock
prescaling ratio may be any power of 2 from 1 to 128.
So the supported divider is not all the value between
1 and 1024, just limited value in that range.

Create table for the supported divder and add function to
check the clock divider is available by comparing with
the table.

Fixes: d0250cf4f2ab ("ASoC: fsl_asrc: Add an option to select internal ratio mode")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1641380883-20709-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/fsl/fsl_asrc.c