mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
To: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Shenghao Ding <shenghao-ding@ti.com>, Kevin Lu <kevin-lu@ti.com>,
	Baojun Xu <baojun.xu@ti.com>, Sen Wang <sen@ti.com>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
Subject: [PATCH 2/4] ASoC: tlv320aic32x4: Add Left and Right Mixer Amplifier DAPM support
Date: Tue, 24 Nov 2026 00:40:48 +0100	[thread overview]
Message-ID: <20261123234050.150364-3-gianfranco.mariotti94@gmail.com> (raw)
In-Reply-To: <20261123234050.150364-1-gianfranco.mariotti94@gmail.com>

The TLV320AIC32x4 features Left and Right Mixer Amplifiers (MAL and MAR,
controlled by AIC32X4_OUTPWRCTL bits 1 and 0) that route amplified
signals from the Left and Right MicPGAs directly to the headphone and
line-out output mixers, bypassing the ADCs and DACs (TI SLAA557, Section
2.2.2 and Figure 2-1):
- AIC32X4_HPLROUTE bit 1 (MAL) and bit 0 (MAR)
- AIC32X4_HPRROUTE bit 1 (MAR)
- AIC32X4_LOLROUTE bit 1 (MAL)
- AIC32X4_LORROUTE bit 1 (MAR)

Insert Left MicPGA and Right MicPGA DAPM PGA widgets between the input
resistor muxes and the ADCs, feed MAL Power and MAR Power from the
respective MicPGAs, and wire the MAL/MAR switches into the HPL, HPR,
LOL, and LOR output mixers.

Signed-off-by: Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
---
 sound/soc/codecs/tlv320aic32x4.c | 48 ++++++++++++++++++++++----------
 1 file changed, 34 insertions(+), 14 deletions(-)

diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index f39856d0b1f19..9f90e41076992 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -320,23 +320,28 @@ static const struct snd_kcontrol_new aic32x4_snd_controls[] = {
 static const struct snd_kcontrol_new hpl_output_mixer_controls[] = {
 	SOC_DAPM_SINGLE("L_DAC Switch", AIC32X4_HPLROUTE, 3, 1, 0),
 	SOC_DAPM_SINGLE("IN1_L Switch", AIC32X4_HPLROUTE, 2, 1, 0),
+	SOC_DAPM_SINGLE("MAL Switch", AIC32X4_HPLROUTE, 1, 1, 0),
+	SOC_DAPM_SINGLE("MAR Switch", AIC32X4_HPLROUTE, 0, 1, 0),
 };
 
 static const struct snd_kcontrol_new hpr_output_mixer_controls[] = {
 	SOC_DAPM_SINGLE("L_DAC Switch", AIC32X4_HPRROUTE, 4, 1, 0),
 	SOC_DAPM_SINGLE("R_DAC Switch", AIC32X4_HPRROUTE, 3, 1, 0),
 	SOC_DAPM_SINGLE("IN1_R Switch", AIC32X4_HPRROUTE, 2, 1, 0),
+	SOC_DAPM_SINGLE("MAR Switch", AIC32X4_HPRROUTE, 1, 1, 0),
 	SOC_DAPM_SINGLE("HPL Switch", AIC32X4_HPRROUTE, 0, 1, 0),
 };
 
 static const struct snd_kcontrol_new lol_output_mixer_controls[] = {
 	SOC_DAPM_SINGLE("R_DAC Switch", AIC32X4_LOLROUTE, 4, 1, 0),
 	SOC_DAPM_SINGLE("L_DAC Switch", AIC32X4_LOLROUTE, 3, 1, 0),
+	SOC_DAPM_SINGLE("MAL Switch", AIC32X4_LOLROUTE, 1, 1, 0),
 	SOC_DAPM_SINGLE("LOR Switch", AIC32X4_LOLROUTE, 0, 1, 0),
 };
 
 static const struct snd_kcontrol_new lor_output_mixer_controls[] = {
 	SOC_DAPM_SINGLE("R_DAC Switch", AIC32X4_LORROUTE, 3, 1, 0),
+	SOC_DAPM_SINGLE("MAR Switch", AIC32X4_LORROUTE, 1, 1, 0),
 };
 
 static const char * const resistor_text[] = {
@@ -424,6 +429,7 @@ static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = {
 			   &hpl_output_mixer_controls[0],
 			   ARRAY_SIZE(hpl_output_mixer_controls)),
 	SND_SOC_DAPM_PGA("HPL Power", AIC32X4_OUTPWRCTL, 5, 0, NULL, 0),
+	SND_SOC_DAPM_PGA("MAL Power", AIC32X4_OUTPWRCTL, 1, 0, NULL, 0),
 
 	SND_SOC_DAPM_MIXER("LOL Output Mixer", SND_SOC_NOPM, 0, 0,
 			   &lol_output_mixer_controls[0],
@@ -435,12 +441,14 @@ static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = {
 			   &hpr_output_mixer_controls[0],
 			   ARRAY_SIZE(hpr_output_mixer_controls)),
 	SND_SOC_DAPM_PGA("HPR Power", AIC32X4_OUTPWRCTL, 4, 0, NULL, 0),
+	SND_SOC_DAPM_PGA("MAR Power", AIC32X4_OUTPWRCTL, 0, 0, NULL, 0),
 	SND_SOC_DAPM_MIXER("LOR Output Mixer", SND_SOC_NOPM, 0, 0,
 			   &lor_output_mixer_controls[0],
 			   ARRAY_SIZE(lor_output_mixer_controls)),
 	SND_SOC_DAPM_PGA("LOR Power", AIC32X4_OUTPWRCTL, 2, 0, NULL, 0),
 
 	SND_SOC_DAPM_ADC("Right ADC", "Right Capture", AIC32X4_ADCSETUP, 6, 0),
+	SND_SOC_DAPM_PGA("Right MicPGA", SND_SOC_NOPM, 0, 0, NULL, 0),
 	SND_SOC_DAPM_MUX("IN1_R to Right Mixer Positive Resistor", SND_SOC_NOPM, 0, 0,
 			 in1r_to_rmixer_controls),
 	SND_SOC_DAPM_MUX("IN2_R to Right Mixer Positive Resistor", SND_SOC_NOPM, 0, 0,
@@ -457,6 +465,7 @@ static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = {
 			 in3l_to_rmixer_controls),
 
 	SND_SOC_DAPM_ADC("Left ADC", "Left Capture", AIC32X4_ADCSETUP, 7, 0),
+	SND_SOC_DAPM_PGA("Left MicPGA", SND_SOC_NOPM, 0, 0, NULL, 0),
 	SND_SOC_DAPM_MUX("IN1_L to Left Mixer Positive Resistor", SND_SOC_NOPM, 0, 0,
 			 in1l_to_lmixer_controls),
 	SND_SOC_DAPM_MUX("IN2_L to Left Mixer Positive Resistor", SND_SOC_NOPM, 0, 0,
@@ -495,12 +504,15 @@ static const struct snd_soc_dapm_route aic32x4_dapm_routes[] = {
 	/* Left Output */
 	{"HPL Output Mixer", "L_DAC Switch", "Left DAC"},
 	{"HPL Output Mixer", "IN1_L Switch", "IN1_L"},
+	{"HPL Output Mixer", "MAL Switch", "MAL Power"},
+	{"HPL Output Mixer", "MAR Switch", "MAR Power"},
 
 	{"HPL Power", NULL, "HPL Output Mixer"},
 	{"HPL", NULL, "HPL Power"},
 
 	{"LOL Output Mixer", "R_DAC Switch", "Right DAC"},
 	{"LOL Output Mixer", "L_DAC Switch", "Left DAC"},
+	{"LOL Output Mixer", "MAL Switch", "MAL Power"},
 	{"LOL Output Mixer", "LOR Switch", "LOR Power"},
 
 	{"LOL Power", NULL, "LOL Output Mixer"},
@@ -510,84 +522,92 @@ static const struct snd_soc_dapm_route aic32x4_dapm_routes[] = {
 	{"HPR Output Mixer", "L_DAC Switch", "Left DAC"},
 	{"HPR Output Mixer", "R_DAC Switch", "Right DAC"},
 	{"HPR Output Mixer", "IN1_R Switch", "IN1_R"},
+	{"HPR Output Mixer", "MAR Switch", "MAR Power"},
 	{"HPR Output Mixer", "HPL Switch", "HPL Power"},
 
 	{"HPR Power", NULL, "HPR Output Mixer"},
 	{"HPR", NULL, "HPR Power"},
 
 	{"LOR Output Mixer", "R_DAC Switch", "Right DAC"},
+	{"LOR Output Mixer", "MAR Switch", "MAR Power"},
 
 	{"LOR Power", NULL, "LOR Output Mixer"},
 	{"LOR", NULL, "LOR Power"},
 
 	/* Right Input */
-	{"Right ADC", NULL, "IN1_R to Right Mixer Positive Resistor"},
+	{"Right ADC", NULL, "Right MicPGA"},
+	{"MAR Power", NULL, "Right MicPGA"},
+
+	{"Right MicPGA", NULL, "IN1_R to Right Mixer Positive Resistor"},
 	{"IN1_R to Right Mixer Positive Resistor", "10 kOhm", "IN1_R"},
 	{"IN1_R to Right Mixer Positive Resistor", "20 kOhm", "IN1_R"},
 	{"IN1_R to Right Mixer Positive Resistor", "40 kOhm", "IN1_R"},
 
-	{"Right ADC", NULL, "IN2_R to Right Mixer Positive Resistor"},
+	{"Right MicPGA", NULL, "IN2_R to Right Mixer Positive Resistor"},
 	{"IN2_R to Right Mixer Positive Resistor", "10 kOhm", "IN2_R"},
 	{"IN2_R to Right Mixer Positive Resistor", "20 kOhm", "IN2_R"},
 	{"IN2_R to Right Mixer Positive Resistor", "40 kOhm", "IN2_R"},
 
-	{"Right ADC", NULL, "IN3_R to Right Mixer Positive Resistor"},
+	{"Right MicPGA", NULL, "IN3_R to Right Mixer Positive Resistor"},
 	{"IN3_R to Right Mixer Positive Resistor", "10 kOhm", "IN3_R"},
 	{"IN3_R to Right Mixer Positive Resistor", "20 kOhm", "IN3_R"},
 	{"IN3_R to Right Mixer Positive Resistor", "40 kOhm", "IN3_R"},
 
-	{"Right ADC", NULL, "IN2_L to Right Mixer Positive Resistor"},
+	{"Right MicPGA", NULL, "IN2_L to Right Mixer Positive Resistor"},
 	{"IN2_L to Right Mixer Positive Resistor", "10 kOhm", "IN2_L"},
 	{"IN2_L to Right Mixer Positive Resistor", "20 kOhm", "IN2_L"},
 	{"IN2_L to Right Mixer Positive Resistor", "40 kOhm", "IN2_L"},
 
-	{"Right ADC", NULL, "CM_R to Right Mixer Negative Resistor"},
+	{"Right MicPGA", NULL, "CM_R to Right Mixer Negative Resistor"},
 	{"CM_R to Right Mixer Negative Resistor", "10 kOhm", "CM_R"},
 	{"CM_R to Right Mixer Negative Resistor", "20 kOhm", "CM_R"},
 	{"CM_R to Right Mixer Negative Resistor", "40 kOhm", "CM_R"},
 
-	{"Right ADC", NULL, "IN1_L to Right Mixer Negative Resistor"},
+	{"Right MicPGA", NULL, "IN1_L to Right Mixer Negative Resistor"},
 	{"IN1_L to Right Mixer Negative Resistor", "10 kOhm", "IN1_L"},
 	{"IN1_L to Right Mixer Negative Resistor", "20 kOhm", "IN1_L"},
 	{"IN1_L to Right Mixer Negative Resistor", "40 kOhm", "IN1_L"},
 
-	{"Right ADC", NULL, "IN3_L to Right Mixer Negative Resistor"},
+	{"Right MicPGA", NULL, "IN3_L to Right Mixer Negative Resistor"},
 	{"IN3_L to Right Mixer Negative Resistor", "10 kOhm", "IN3_L"},
 	{"IN3_L to Right Mixer Negative Resistor", "20 kOhm", "IN3_L"},
 	{"IN3_L to Right Mixer Negative Resistor", "40 kOhm", "IN3_L"},
 
 	/* Left Input */
-	{"Left ADC", NULL, "IN1_L to Left Mixer Positive Resistor"},
+	{"Left ADC", NULL, "Left MicPGA"},
+	{"MAL Power", NULL, "Left MicPGA"},
+
+	{"Left MicPGA", NULL, "IN1_L to Left Mixer Positive Resistor"},
 	{"IN1_L to Left Mixer Positive Resistor", "10 kOhm", "IN1_L"},
 	{"IN1_L to Left Mixer Positive Resistor", "20 kOhm", "IN1_L"},
 	{"IN1_L to Left Mixer Positive Resistor", "40 kOhm", "IN1_L"},
 
-	{"Left ADC", NULL, "IN2_L to Left Mixer Positive Resistor"},
+	{"Left MicPGA", NULL, "IN2_L to Left Mixer Positive Resistor"},
 	{"IN2_L to Left Mixer Positive Resistor", "10 kOhm", "IN2_L"},
 	{"IN2_L to Left Mixer Positive Resistor", "20 kOhm", "IN2_L"},
 	{"IN2_L to Left Mixer Positive Resistor", "40 kOhm", "IN2_L"},
 
-	{"Left ADC", NULL, "IN3_L to Left Mixer Positive Resistor"},
+	{"Left MicPGA", NULL, "IN3_L to Left Mixer Positive Resistor"},
 	{"IN3_L to Left Mixer Positive Resistor", "10 kOhm", "IN3_L"},
 	{"IN3_L to Left Mixer Positive Resistor", "20 kOhm", "IN3_L"},
 	{"IN3_L to Left Mixer Positive Resistor", "40 kOhm", "IN3_L"},
 
-	{"Left ADC", NULL, "IN1_R to Left Mixer Positive Resistor"},
+	{"Left MicPGA", NULL, "IN1_R to Left Mixer Positive Resistor"},
 	{"IN1_R to Left Mixer Positive Resistor", "10 kOhm", "IN1_R"},
 	{"IN1_R to Left Mixer Positive Resistor", "20 kOhm", "IN1_R"},
 	{"IN1_R to Left Mixer Positive Resistor", "40 kOhm", "IN1_R"},
 
-	{"Left ADC", NULL, "CM_L to Left Mixer Negative Resistor"},
+	{"Left MicPGA", NULL, "CM_L to Left Mixer Negative Resistor"},
 	{"CM_L to Left Mixer Negative Resistor", "10 kOhm", "CM_L"},
 	{"CM_L to Left Mixer Negative Resistor", "20 kOhm", "CM_L"},
 	{"CM_L to Left Mixer Negative Resistor", "40 kOhm", "CM_L"},
 
-	{"Left ADC", NULL, "IN2_R to Left Mixer Negative Resistor"},
+	{"Left MicPGA", NULL, "IN2_R to Left Mixer Negative Resistor"},
 	{"IN2_R to Left Mixer Negative Resistor", "10 kOhm", "IN2_R"},
 	{"IN2_R to Left Mixer Negative Resistor", "20 kOhm", "IN2_R"},
 	{"IN2_R to Left Mixer Negative Resistor", "40 kOhm", "IN2_R"},
 
-	{"Left ADC", NULL, "IN3_R to Left Mixer Negative Resistor"},
+	{"Left MicPGA", NULL, "IN3_R to Left Mixer Negative Resistor"},
 	{"IN3_R to Left Mixer Negative Resistor", "10 kOhm", "IN3_R"},
 	{"IN3_R to Left Mixer Negative Resistor", "20 kOhm", "IN3_R"},
 	{"IN3_R to Left Mixer Negative Resistor", "40 kOhm", "IN3_R"},
-- 
2.25.1


  parent reply	other threads:[~2026-11-23 23:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 23:40 [PATCH 0/4] ASoC: tlv320aic32x4: Complete analog routing, Mixer Amp bypass, and volume controls Gianfranco Mariotti
2026-11-23 23:40 ` [PATCH 1/4] ASoC: tlv320aic32x4: Add missing DAC and driver output mixer routes Gianfranco Mariotti
2026-11-23 23:40 ` Gianfranco Mariotti [this message]
2026-11-23 23:40 ` [PATCH 3/4] ASoC: tlv320aic32x4: Add IN1 and Mixer Amp analog bypass volume controls Gianfranco Mariotti
2026-11-23 23:40 ` [PATCH 4/4] ASoC: tlv320aic32x4: Add CM2_L and CM2_R negative MicPGA input routing Gianfranco Mariotti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261123234050.150364-3-gianfranco.mariotti94@gmail.com \
    --to=gianfranco.mariotti94@gmail.com \
    --cc=baojun.xu@ti.com \
    --cc=broonie@kernel.org \
    --cc=kevin-lu@ti.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=sen@ti.com \
    --cc=shenghao-ding@ti.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®