ASoC: sun8i-codec: Correct the BCLK divisor calculation
authorSamuel Holland <samuel@sholland.org>
Wed, 14 Oct 2020 06:19:30 +0000 (01:19 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 26 Oct 2020 14:56:56 +0000 (14:56 +0000)
commit68a4f2caaa17ce62890c51ef957dd008c2e42aae
tree894a8f1b380cbc28b90ff057f5c83b21bfd781cf
parente511aed79632e8a2dd03068f8bd11b64cb0d7170
ASoC: sun8i-codec: Correct the BCLK divisor calculation

Previously, the BCLK divisor calculation assumed zero padding and
exactly two slots. In order to support the TDM slot binding and
20/24-bit word sizes, those assumptions must be removed.

Due to hardware limitations, the BCLK/LRCK ratio is not as simple as
"slot_width * slots". However, the correct value is already calculated
elsewhere in this function, since it must also be programmed into the
hardware. Reuse that value to calculate the correct SYSCLK/BCLK divisor.

Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20201014061941.4306-7-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sunxi/sun8i-codec.c