[PATCH v2 0/4] ASoC: tlv320aic32x4: Complete analog routing, Mixer Amp bypass, and volume controls
From: Gianfranco Mariotti
Date: Thu Nov 26 2026 - 13:10:53 EST
The TLV320AIC32x4 driver currently exposes only a subset of the codec's
analog input/output routing switches and omits support for its Left and
Right Mixer Amplifiers (MAL/MAR) and analog bypass volume attenuators.
This series completes the analog DAPM topology and mixer controls per
the TI TLV320AIC3204/3254 (SLAA557 / SLAA408) and TLV320AIC3206/3256
(SLAA463 / SLAU306) Application Reference Guides:
1. Add the missing cross-channel DAC negative terminal switches (L_DAC
to HPR, R_DAC to LOL) and output driver bridging switches (HPL to
HPR on AIC32x4 only, LOR to LOL) used for mono differential headphone
and line-out configurations.
2. Model the Left and Right MicPGAs and Left/Right Mixer Amplifiers
(MAL/MAR, Page 1, Register 9 bits 1:0) in DAPM and wire their routing
switches into the HPL, HPR, LOL, and LOR output mixers for amplified
analog ADC/DAC bypass.
3. Add the non-linear analog bypass attenuation volume controls for
IN1L/IN1R-to-HPL/HPR (Page 1, Registers 22-23) and MAL/MAR (Page 1,
Registers 24-25) using piecewise DECLARE_TLV_DB_RANGE tables.
4. Expose the CM2_L and CM2_R common-mode resistor selections in bits
1:0 of AIC32X4_LMICPGANIN and AIC32X4_RMICPGANIN (Page 1, Registers
54 and 57).
Tested on two TI TLV320AIC3204 boards (one wiring IN1 with LOL/LOR, the
other wiring IN3 with HPL/HPR) across headphone, line-out, capture,
driver bridging, and MicPGA-to-MAL/MAR analog bypass configurations.
Since neither board wires both IN1 and HPL/HPR on the same codec, the
direct IN1-to-HP bypass volume control ('IN1 Bypass Playback Volume')
was verified via alsa-lib TLV dB conversion and live I2C register
readback (Page 1, Registers 22-23) rather than end-to-end analog audio.
Changes in v2:
- Patch 1: Restrict HPR Output Mixer 'HPL Switch' (AIC32X4_HPRROUTE bit
0) and its DAPM route to AIC32X4_TYPE_AIC32X4, as bit 0 is reserved on
TLV320AIC32x6 devices (Mark Brown).
- Link to v1: https://lore.kernel.org/r/20261123234050.150364-1-gianfranco.mariotti94@xxxxxxxxx
Signed-off-by: Gianfranco Mariotti <gianfranco.mariotti94@xxxxxxxxx>
Gianfranco Mariotti (4):
ASoC: tlv320aic32x4: Add missing DAC and driver output mixer routes
ASoC: tlv320aic32x4: Add Left and Right Mixer Amplifier DAPM support
ASoC: tlv320aic32x4: Add IN1 and Mixer Amp analog bypass volume
controls
ASoC: tlv320aic32x4: Add CM2_L and CM2_R negative MicPGA input routing
sound/soc/codecs/tlv320aic32x4.c | 155 +++++++++++++++++++++++++++----
sound/soc/codecs/tlv320aic32x4.h | 4 +
2 files changed, 142 insertions(+), 17 deletions(-)
--
2.25.1