android_kernel_motorola_sm6225/sound/soc/meson
Jerome Brunet 67d8b2cecb ASoC: meson: axg-tdm-formatter: fix channel slot allocation
[ Upstream commit c1f848f12103920ca165758aedb1c10904e193e1 ]

When the tdm lane mask is computed, the driver currently fills the 1st lane
before moving on to the next. If the stream has less channels than the
lanes can accommodate, slots will be disabled on the last lanes.

Unfortunately, the HW distribute channels in a different way. It distribute
channels in pair on each lanes before moving on the next slots.

This difference leads to problems if a device has an interface with more
than 1 lane and with more than 2 slots per lane.

For example: a playback interface with 2 lanes and 4 slots each (total 8
slots - zero based numbering)
- Playing a 8ch stream:
  - All slots activated by the driver
  - channel #2 will be played on lane #1 - slot #0 following HW placement
- Playing a 4ch stream:
  - Lane #1 disabled by the driver
  - channel #2 will be played on lane #0 - slot #2

This behaviour is obviously not desirable.

Change the way slots are activated on the TDM lanes to follow what the HW
does and make sure each channel always get mapped to the same slot/lane.

Fixes: 1a11d88f49 ("ASoC: meson: add tdm formatter base driver")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20230809171931.1244502-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-30 16:31:49 +02:00
..
axg-card.c ASoC: meson: align axg card driver with DT bindings documentation 2018-07-26 15:45:44 +01:00
axg-fifo.c ASoC: meson: add missing free_irq() in error path 2020-06-25 15:32:52 +02:00
axg-fifo.h
axg-frddr.c
axg-spdifout.c ASoC: meson: add axg spdif output 2018-07-18 13:08:39 +01:00
axg-tdm-formatter.c ASoC: meson: axg-tdm-formatter: fix channel slot allocation 2023-08-30 16:31:49 +02:00
axg-tdm-formatter.h ASoC: meson: add tdm formatter base driver 2018-07-20 17:38:27 +01:00
axg-tdm-interface.c ASoC: meson: axg-tdm-interface: fix loopback 2021-01-19 18:22:37 +01:00
axg-tdm.h ASoC: meson: axg-tdm: fix sample clock inversion 2019-07-26 09:14:07 +02:00
axg-tdmin.c ASoC: meson: axg-tdmin: right_j is not supported 2020-01-27 14:50:55 +01:00
axg-tdmout.c ASoC: meson: axg-tdmout: right_j is not supported 2020-01-27 14:50:55 +01:00
axg-toddr.c ASoC: meson: add axg toddr driver 2018-07-18 13:08:37 +01:00
Kconfig ASoC: meson: fix COMPILE_TEST error 2020-12-30 11:25:53 +01:00
Makefile ASoC: meson: add axg sound card support 2018-07-20 17:40:12 +01:00