ASoC: cs42l42: Ensure MCLKint is a multiple of the sample rate
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Fri, 27 Jan 2023 16:51:06 +0000 (16:51 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 31 Jan 2023 12:10:47 +0000 (12:10 +0000)
commit17cb563baef9c4f2d244035a95e361dd673941fa
treeac625ad429d498f0b49041b41951728e64a64e01
parentb558c6fd08f59b78166828c342beb2a36258e9fe
ASoC: cs42l42: Ensure MCLKint is a multiple of the sample rate

The chosen clocking configuration must give an internal MCLK (MCLKint)
that is an integer multiple of the sample rate.

On I2S each of the supported bit clock frequencies can only be generated
from one sample rate group (either the 44100 or the 48000) so the code
could use only the bitclock to look up a PLL config.

The relationship between sample rate and bitclock frequency is more
complex on Soundwire and so it is possible to set a frame shape to
generate a bitclock from the "wrong" group. For example 2*147 with a
48000 sample rate would give a bitclock of 14112000 which on I2S
could only be derived from a 44100 sample rate.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230127165111.3010960-4-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs42l42.c