]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: sun8i-codec: Set the BCLK divider
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Thu, 9 Nov 2017 09:39:24 +0000 (10:39 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 9 Nov 2017 11:41:37 +0000 (11:41 +0000)
commit4ed9427a0d8417bc100b423d3c41ba71f0919b95
tree9d63b3570601c8ab9773302fa8fb502b330fc5e5
parent6b7871220084a6d0d57ed1f7fb74217a0304eab0
ASoC: sun8i-codec: Set the BCLK divider

While the current code was reporting to be able to work in master mode, it
failed to do so because the BCLK divider wasn't programmed, meaning that
the BCLK would run at the PLL's frequency no matter the sample rate.

It was obviously a bit too fast.

Add support to retrieve the divider to use, and set it. Since our PLL is
not always able to generate a perfect multiple of the sample rate, we'll
have to choose the closest divider that matches our setup.

Fixes: 34e3582f60fb ("ASoC: Add sun8i digital audio codec")
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>
sound/soc/sunxi/sun8i-codec.c