linux/sound/soc/sunxi
Maxime Ripard 619c15f7fa
ASoC: sun4i-i2s: Change SR and WSS computation
The current computation for the SR (sample resolution) and the WSS (word
slot size) register parameters is based on a switch returning the matching
parameters for a given params width.

Later SoCs (A83t, H3, A64) changed that calculation, which was loosely the
same with an offset. Therefore, an offset was added to adjust those
parameters.

However, the calculation is a bit less trivial than initially thought.
Indeed, while we assumed that SR and WSS were always the same, on older
SoCs, SR will max at 24 (since those SoCs do not support 32 bits formats),
but the word size can be 32.

Newer SoCs can also support a much larger range (8 bits to 32 bits, by
increments of 4) of size than the older SoCs could.

Finally, the A64 and A83t were never adjusted to have that offset in the
first place, and were therefore broken from that point of view.

In order to fix all those issues, let's introduce two functions, get_wss
and get_sr, with their respective implementations for all the SoCs
supported so far.

Fixes: 21faaea134 ("ASoC: sun4i-i2s: Add support for A83T")
Fixes: 66ecce3325 ("ASoC: sun4i-i2s: Add compatibility with A64 codec I2S")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-06 17:39:29 +01:00
..
Kconfig ASoC: sunxi: rename SND_SUNXI_ADDA_PR_REGMAP to SND_SUN8I_ADDA_PR_REGMAP 2018-11-05 10:25:16 +00:00
Makefile ASoC: sunxi: Add new driver for Allwinner A64 codec's analog path controls 2018-10-17 11:11:01 +01:00
sun4i-codec.c ASoC: sun4i-codec: fix first delay on Speaker 2019-05-29 16:31:32 +01:00
sun4i-i2s.c ASoC: sun4i-i2s: Change SR and WSS computation 2019-06-06 17:39:29 +01:00
sun4i-spdif.c ASoC: sun4i-spdif: Add support for H6 SoC 2019-05-28 15:54:40 +01:00
sun8i-adda-pr-regmap.c ASoC: sun8i-codec-analog: split regmap code into separate driver 2018-10-17 11:10:59 +01:00
sun8i-adda-pr-regmap.h ASoC: sun8i-codec-analog: split regmap code into separate driver 2018-10-17 11:10:59 +01:00
sun8i-codec-analog.c ASoC: sun8i-codec-analog: split regmap code into separate driver 2018-10-17 11:10:59 +01:00
sun8i-codec.c ASoC: sun8i-codec: add missing route for ADC 2018-11-13 15:02:22 -08:00
sun50i-codec-analog.c ASoC: sunxi: sun50i-codec-analog: Rename hpvcc regulator supply to cpvdd 2019-02-19 15:36:02 +00:00