[PATCH 0/5] ASoC: Fix missing channel fixup for codec end of ch_map

Richard Fitzgerald posted 5 patches 2 weeks, 1 day ago
include/sound/soc.h                  |  3 +-
include/sound/soc_sdw_utils.h        |  2 --
sound/soc/sdw_utils/soc_sdw_cs_amp.c | 46 ----------------------------
sound/soc/sdw_utils/soc_sdw_utils.c  | 24 +++++++++------
sound/soc/soc-pcm.c                  | 18 ++++++++---
5 files changed, 29 insertions(+), 64 deletions(-)
[PATCH 0/5] ASoC: Fix missing channel fixup for codec end of ch_map
Posted by Richard Fitzgerald 2 weeks, 1 day ago
Struct snd_soc_dai_link_ch_map had a single mask member to set the
CPU channel masks. But no fixup was done to the codec end of the link.

For example if a 4-channel CPU capture DAI was made from two codecs both
supplying 2 channels, the hw_params() of the codec would be passed a
channel count of 4.

On SoundWire this could cause multiple codecs to send data in the same
bits of a frame because the unused channels were not disabled.

The changes in this series are:
- Separate channel masks for CPU and codec in struct
  snd_soc_dai_link_ch_map .

- Apply the codec channel mask as a channel count fixup if the machine
  drive has not set a TDM mask.

- Set the codec channel mask in the SoundWire machine driver.

- Remove the workaround from the cs_amp machine driver.

Richard Fitzgerald (5):
  ASoC: Rename snd_soc_dai_link_ch_map.ch_mask to cpu_ch_mask
  ASoC: Add codec_ch_mask to snd_soc_dai_link_ch_map
  ASoC: soc-pcm: Apply snd_soc_dai_link_ch_map.codec_ch_mask to codec
    params
  ASoC: sdw_utils: Set snd_soc_dai_link_ch_map.codec_ch_mask for capture
  ASoC: sdw_utils: cs_amp: Delete bogus and incorrect capture channel
    fixup

 include/sound/soc.h                  |  3 +-
 include/sound/soc_sdw_utils.h        |  2 --
 sound/soc/sdw_utils/soc_sdw_cs_amp.c | 46 ----------------------------
 sound/soc/sdw_utils/soc_sdw_utils.c  | 24 +++++++++------
 sound/soc/soc-pcm.c                  | 18 ++++++++---
 5 files changed, 29 insertions(+), 64 deletions(-)

-- 
2.47.3
Re: [PATCH 0/5] ASoC: Fix missing channel fixup for codec end of ch_map
Posted by Mark Brown 1 week, 4 days ago
On Thu, 10 Sep 2026 12:44:55 +0100, Richard Fitzgerald wrote:
> ASoC: Fix missing channel fixup for codec end of ch_map
> 
> Struct snd_soc_dai_link_ch_map had a single mask member to set the
> CPU channel masks. But no fixup was done to the codec end of the link.
> 
> For example if a 4-channel CPU capture DAI was made from two codecs both
> supplying 2 channels, the hw_params() of the codec would be passed a
> channel count of 4.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.3

Thanks!

[1/5] ASoC: Rename snd_soc_dai_link_ch_map.ch_mask to cpu_ch_mask
      https://git.kernel.org/broonie/sound/c/4d855d747521
[2/5] ASoC: Add codec_ch_mask to snd_soc_dai_link_ch_map
      https://git.kernel.org/broonie/sound/c/88b14c0d0bab
[3/5] ASoC: soc-pcm: Apply snd_soc_dai_link_ch_map.codec_ch_mask to codec params
      https://git.kernel.org/broonie/sound/c/6b382bdfe26a
[4/5] ASoC: sdw_utils: Set snd_soc_dai_link_ch_map.codec_ch_mask for capture
      https://git.kernel.org/broonie/sound/c/290845e151cd
[5/5] ASoC: sdw_utils: cs_amp: Delete bogus and incorrect capture channel fixup
      https://git.kernel.org/broonie/sound/c/b5b00a57868b

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark