linux/sound/soc/fsl
Maarten Zanders b2dd1d0d32
ASoC: fsl_sai: Fix sync error in consumer mode
When configured for default synchronisation (Rx syncs to Tx) and the
SAI operates in consumer mode (clocks provided externally to Tx), a
synchronisation error occurs on Tx on the first attempt after device
initialisation when the playback stream is started while a capture
stream is already active. This results in channel shift/swap on the
playback stream.
Subsequent streams (ie after that first failing one) always work
correctly, no matter the order, with or without the other stream active.

This issue was observed (and fix tested) on an i.MX6UL board connected
to an ADAU1761 codec, where the codec provides both frame and bit clock
(connected to TX pins).

To fix this, always initialize the 'other' xCR4 and xCR5 registers when
we're starting a stream which is synced to the opposite one, irregardless
of the producer/consumer status.

Fixes: 51659ca069 ("ASoC: fsl-sai: set xCR4/xCR5/xMR for SAI master mode")

Signed-off-by: Maarten Zanders <maarten@zanders.be>
Reviewed-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://patch.msgid.link/20251024135716.584265-1-maarten@zanders.be
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-28 10:22:12 +00:00
..
Kconfig ASoC: fsl: Standardize ASoC menu 2025-06-24 01:01:13 +01:00
Makefile ASoC: fsl_asrc_m2m: Add memory to memory function 2024-12-13 08:57:09 +00:00
efika-audio-fabric.c
eukrea-tlv320.c
fsl-asoc-card.c ASoC: fsl-asoc-card: add sysclk_ratio for calculate sysclk frequency 2025-07-13 22:37:01 +01:00
fsl_asrc.c ASoC: codec: Convert to GPIO descriptors for 2025-07-14 11:34:16 +01:00
fsl_asrc.h ASoC: fsl_asrc: define functions for memory to memory usage 2024-12-13 08:57:07 +00:00
fsl_asrc_common.h ASoC: fsl_asrc_m2m: Add memory to memory function 2024-12-13 08:57:09 +00:00
fsl_asrc_dma.c ASoC: fsl_asrc_dma: get codec or cpu dai from backend 2025-04-06 23:18:18 +01:00
fsl_asrc_m2m.c ASoC: fsl_asrc_m2m: return error value in asrc_m2m_device_run() 2025-01-20 13:50:31 +00:00
fsl_aud2htx.c ASoC: fsl: Convert to RUNTIME_PM_OPS() and co 2025-03-17 10:14:39 +00:00
fsl_aud2htx.h
fsl_audmix.c ASoC: fsl_audmix: register card device depends on 'dais' property 2025-03-03 13:48:38 +00:00
fsl_audmix.h
fsl_dma.c ASoC: Switch back to struct platform_driver::remove() 2024-09-09 18:26:49 +01:00
fsl_dma.h
fsl_easrc.c ASoC: fsl_easrc: register m2m platform device 2024-12-13 08:57:11 +00:00
fsl_easrc.h ASoC: fsl_easrc: define functions for memory to memory usage 2024-12-13 08:57:08 +00:00
fsl_esai.c ASoC: fsl: Convert to RUNTIME_PM_OPS() and co 2025-03-17 10:14:39 +00:00
fsl_esai.h
fsl_micfil.c ASoC: fsl_micfil: correct the endian format for DSD 2025-10-23 13:42:34 +01:00
fsl_micfil.h ASoC: fsl_micfil: Add decimation filter bypass mode support 2025-02-11 13:36:18 +00:00
fsl_mqs.c ASoC: fsl_mqs: rename system manager indices for i.MX95 2025-07-03 12:59:59 +01:00
fsl_qmc_audio.c ASoC: fsl: fsl_qmc_audio: Drop struct qmc_dai_chan 2025-09-18 22:50:48 +01:00
fsl_rpmsg.c ASoC: fsl_rpmsg: Allocate a smaller buffer size for capture stream 2025-05-02 05:38:54 +09:00
fsl_rpmsg.h ASoC: fsl_rpmsg: Allocate a smaller buffer size for capture stream 2025-05-02 05:38:54 +09:00
fsl_sai.c ASoC: fsl_sai: Fix sync error in consumer mode 2025-10-28 10:22:12 +00:00
fsl_sai.h ASoC: fsl_sai: separate set_tdm_slot() for tx and rx 2025-04-06 23:23:29 +01:00
fsl_spdif.c ASoC: fsl_spdif: change IFACE_PCM to IFACE_MIXER 2024-12-11 18:45:27 +00:00
fsl_spdif.h
fsl_ssi.c ASoC: Switch back to struct platform_driver::remove() 2024-09-09 18:26:49 +01:00
fsl_ssi.h
fsl_ssi_dbg.c
fsl_utils.c ASoC: fsl_utils: Add function to constrain rates 2024-12-09 13:11:09 +00:00
fsl_utils.h ASoC: fsl_utils: Add function to constrain rates 2024-12-09 13:11:09 +00:00
fsl_xcvr.c ASoC: fsl_xcvr: get channel status data with firmware exists 2025-07-24 13:44:22 +01:00
fsl_xcvr.h ASoC: fsl_xcvr: Use regmap for PHY and PLL registers 2024-12-02 00:30:19 +00:00
imx-audio-rpmsg.c
imx-audmix.c ASoC: fsl: Rename stream name of SAI DAI driver 2025-02-24 18:35:53 +00:00
imx-audmux.c ASoC: fsl: Use kcalloc() instead of kzalloc() 2025-08-20 15:09:23 +01:00
imx-audmux.h
imx-card.c ASoC: imx-card: Add WM8524 support 2025-07-24 13:52:27 +01:00
imx-es8328.c
imx-hdmi.c ASoC: imx-hdmi: remove cpu_pdev related code 2025-08-24 22:41:09 +01:00
imx-pcm-dma.c
imx-pcm-fiq.c ASoC: fsl: imx-pcm-fiq: Switch to use hrtimer_setup() 2025-02-18 11:19:07 +01:00
imx-pcm-rpmsg.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
imx-pcm-rpmsg.h
imx-pcm.h
imx-rpmsg.c ASoC: Use of_property_present() for non-boolean properties 2025-01-09 18:50:14 +00:00
imx-sgtl5000.c ASoC: Switch back to struct platform_driver::remove() 2024-09-09 18:26:49 +01:00
imx-ssi.h
lpc3xxx-i2s.c ASoC: fsl: lpc3xxx: Make some symbols static 2024-08-02 14:05:32 +01:00
lpc3xxx-i2s.h ASoC: fsl: lpc3xxx-i2s: Include bitfield.h for FIELD_PREP 2024-07-01 20:07:28 +01:00
lpc3xxx-pcm.c ASoC: fsl: lpc3xxx: Make some symbols static 2024-08-02 14:05:32 +01:00
mpc5200_dma.c
mpc5200_dma.h
mpc5200_psc_ac97.c ASoC: Switch back to struct platform_driver::remove() 2024-09-09 18:26:49 +01:00
mpc5200_psc_i2s.c ASoC: Switch back to struct platform_driver::remove() 2024-09-09 18:26:49 +01:00
p1022_ds.c ASoC: Switch back to struct platform_driver::remove() 2024-09-09 18:26:49 +01:00
p1022_rdk.c ASoC: Switch back to struct platform_driver::remove() 2024-09-09 18:26:49 +01:00
pcm030-audio-fabric.c ASoC: Switch back to struct platform_driver::remove() 2024-09-09 18:26:49 +01:00