WSL2-Linux-Kernel/sound
Matteo Martelli 6958e0df8c ASoC: sunxi: sun4i-i2s: fix LRCLK polarity in i2s mode
[ Upstream commit 3e83957e8dd7433a69116780d9bad217b00913ea ]

This fixes the LRCLK polarity for sun8i-h3 and sun50i-h6 in i2s mode
which was wrongly inverted.

The LRCLK was being set in reversed logic compared to the DAI format:
inverted LRCLK for SND_SOC_DAIFMT_IB_NF and SND_SOC_DAIFMT_NB_NF; normal
LRCLK for SND_SOC_DAIFMT_IB_IF and SND_SOC_DAIFMT_NB_IF. Such reversed
logic applies properly for DSP_A, DSP_B, LEFT_J and RIGHT_J modes but
not for I2S mode, for which the LRCLK signal results reversed to what
expected on the bus. The issue is due to a misinterpretation of the
LRCLK polarity bit of the H3 and H6 i2s controllers. Such bit in this
case does not mean "0 => normal" or "1 => inverted" according to the
expected bus operation, but it means "0 => frame starts on low edge" and
"1 => frame starts on high edge" (from the User Manuals).

This commit fixes the LRCLK polarity by setting the LRCLK polarity bit
according to the selected bus mode and renames the LRCLK polarity bit
definition to avoid further confusion.

Fixes: dd657eae81 ("ASoC: sun4i-i2s: Fix the LRCK polarity")
Fixes: 73adf87b7a ("ASoC: sun4i-i2s: Add support for H6 I2S")
Signed-off-by: Matteo Martelli <matteomartelli3@gmail.com>
Link: https://patch.msgid.link/20240801-asoc-fix-sun4i-i2s-v2-1-a8e4e9daa363@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-09-12 11:07:52 +02:00
..
ac97
aoa ALSA: aoa: Fix I2S device accounting 2022-11-03 23:59:18 +09:00
arm
atmel
core ALSA: timer: Relax start tick time check for slave timer elements 2024-09-04 13:23:36 +02:00
drivers ALSA: mts64: fix possible null-ptr-defer in snd_mts64_interrupt 2022-12-31 13:14:16 +01:00
firewire Revert "ALSA: firewire-lib: operate for period elapse event in process context" 2024-08-19 05:45:34 +02:00
hda ALSA: hda: Add input value sanity checks to HDMI channel map controls 2024-09-12 11:07:45 +02:00
i2c ALSA: i2c/cs8427: fix iec958 mixer control deactivation 2023-04-20 12:13:51 +02:00
isa
mips
oss sound/oss/dmasound: fix 'dmasound_setup' defined but not used 2023-05-11 23:00:40 +09:00
parisc
pci ALSA: hda/realtek: Support mute LED on HP Laptop 14-dq2xxx 2024-09-12 11:07:43 +02:00
pcmcia
ppc
sh ALSA: sh: aica: reorder cleanup operations to avoid UAF bugs 2024-04-10 16:19:32 +02:00
soc ASoC: sunxi: sun4i-i2s: fix LRCLK polarity in i2s mode 2024-09-12 11:07:52 +02:00
sparc
spi
synth ALSA: emux: improve patch ioctl data validation 2024-07-05 09:14:43 +02:00
usb ALSA: usb-audio: Support Yamaha P-125 quirk entry 2024-09-04 13:23:15 +02:00
virtio
x86
xen
Kconfig um: Fix hostaudio build errors 2023-09-19 12:22:49 +02:00
Makefile
ac97_bus.c
last.c
sound_core.c