linux-stable/sound/soc/meson
Jerome Brunet c1f848f121
ASoC: meson: axg-tdm-formatter: fix channel slot allocation
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>
2023-08-10 00:22:55 +01:00
..
Kconfig ASoC: Fix 7/8 spaces indentation in Kconfig 2020-11-17 17:08:45 +00:00
Makefile ASoC: meson: g12a: add internal DAC glue driver 2020-02-21 16:39:04 +00:00
aiu-acodec-ctrl.c ASoC: meson: Remove now redundant non_legacy_dai_naming flag 2022-06-27 13:16:48 +01:00
aiu-codec-ctrl.c ASoC: meson: Remove now redundant non_legacy_dai_naming flag 2022-06-27 13:16:48 +01:00
aiu-encoder-i2s.c ASoC: meson: Rename set_fmt_new back to set_fmt 2022-06-06 12:34:06 +01:00
aiu-encoder-spdif.c ASoC: meson: aiu: Fix spelling mistake "Unsupport" -> "Unsupported" 2021-09-27 13:01:07 +01:00
aiu-fifo-i2s.c ASoC: meson: use helper function 2023-01-31 11:05:03 +00:00
aiu-fifo-spdif.c ASoC: meson: use helper function 2023-01-31 11:05:03 +00:00
aiu-fifo.c ASoC: meson: use helper function 2023-01-31 11:05:03 +00:00
aiu-fifo.h ASoC: meson: aiu: add i2s and spdif support 2020-02-13 20:57:22 +00:00
aiu.c ASoC: meson: aiu: Convert to platform remove callback returning void 2023-03-20 13:08:43 +00:00
aiu.h ASoC: constify of_phandle_args in snd_soc_get_dai_name() 2021-03-10 13:07:14 +00:00
axg-card.c ASoC: meson: use snd_soc_{of_}get_dlc() 2023-06-20 12:49:25 +01:00
axg-fifo.c ASoC: meson: Use dev_err_probe() helper 2021-12-20 12:47:17 +00:00
axg-fifo.h ASoC: meson: axg-fifo: relax period size constraints 2019-12-18 20:01:34 +00:00
axg-frddr.c ASoC: meson: Migrate to new style legacy DAI naming flag 2022-06-27 13:16:28 +01:00
axg-pdm.c ASoC: meson: axg-pdm: Fix double word in comments 2022-10-19 12:04:28 +01:00
axg-spdifin.c ASoC: meson: Migrate to new style legacy DAI naming flag 2022-06-27 13:16:28 +01:00
axg-spdifout.c ASoC: meson: Migrate to new style legacy DAI naming flag 2022-06-27 13:16:28 +01:00
axg-tdm-formatter.c ASoC: meson: axg-tdm-formatter: fix channel slot allocation 2023-08-10 00:22:55 +01:00
axg-tdm-formatter.h ASoC: meson: axg-tdm-formatters: fix sclk inversion 2020-07-30 19:45:01 +01:00
axg-tdm-interface.c ASoC: meson: Use the devm_clk_get_optional() helper 2023-03-27 13:04:26 +01:00
axg-tdm.h ASoC: meson: axg-tdm: fix sample clock inversion 2019-06-13 19:44:02 +01:00
axg-tdmin.c ASoC: meson: use helper function 2023-01-31 11:05:03 +00:00
axg-tdmout.c ASoC: meson: use helper function 2023-01-31 11:05:03 +00:00
axg-toddr.c ASoC: meson: Migrate to new style legacy DAI naming flag 2022-06-27 13:16:28 +01:00
g12a-toacodec.c ASoC: meson: Remove now redundant non_legacy_dai_naming flag 2022-06-27 13:16:48 +01:00
g12a-tohdmitx.c ASoC: meson: Remove now redundant non_legacy_dai_naming flag 2022-06-27 13:16:48 +01:00
gx-card.c ASoC: meson: use snd_soc_{of_}get_dlc() 2023-06-20 12:49:25 +01:00
meson-card-utils.c ASoC: meson: use snd_soc_{of_}get_dlc() 2023-06-20 12:49:25 +01:00
meson-card.h ASoC: meson: use snd_soc_{of_}get_dlc() 2023-06-20 12:49:25 +01:00
meson-codec-glue.c ASoC: meson: switch to use c2c_params instead of params 2023-04-05 12:16:37 +01:00
meson-codec-glue.h ASoC: meson: g12a: extract codec-to-codec utils 2020-02-13 20:57:20 +00:00
t9015.c ASoC: meson: Remove now redundant non_legacy_dai_naming flag 2022-06-27 13:16:48 +01:00