ASoC: fsl_asrc: Add an option to select internal ratio mode
authorShengjiu Wang <shengjiu.wang@nxp.com>
Tue, 30 Jun 2020 13:56:07 +0000 (21:56 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 1 Jul 2020 16:21:07 +0000 (17:21 +0100)
commitd0250cf4f2abfbea64ed247230f08f5ae23979f0
tree8858f17b0087be1a7733ee50fe7176b3bcb05684
parent820d7fcb23c189e87bfe8c95a6e7215d873e5082
ASoC: fsl_asrc: Add an option to select internal ratio mode

The ASRC not only supports ideal ratio mode, but also supports
internal ratio mode.

For internal rato mode, the rate of clock source should be divided
with no remainder by sample rate, otherwise there is sound
distortion.

Add function fsl_asrc_select_clk() to find proper clock source for
internal ratio mode, if the clock source is available then internal
ratio mode will be selected.

With change, the ideal ratio mode is not the only option for user.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/1593525367-23221-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_asrc.c