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 v2 1/4] ASoC: tlv320aic32x4: Add missing DAC and driver output mixer routes
Date: Thu, 26 Nov 2026 19:10:35 +0100 [thread overview]
Message-ID: <20261126181038.99595-2-gianfranco.mariotti94@gmail.com> (raw)
In-Reply-To: <20261126181038.99595-1-gianfranco.mariotti94@gmail.com>
The HPR and LOL output routing selection registers (Page 1, Registers 13
and 14) support routing the opposite DAC channel's negative
reconstruction filter terminal as well as bridging the HPL and LOR
output amplifier stages for mono differential configurations:
- AIC32X4_HPRROUTE bit 4: Left DAC negative terminal to HPR
- AIC32X4_HPRROUTE bit 0: HPL output driver to HPR (AIC32x4 only)
- AIC32X4_LOLROUTE bit 4: Right DAC negative terminal to LOL
- AIC32X4_LOLROUTE bit 0: LOR output driver to LOL
Add the corresponding DAPM mixer controls and routes, sourcing HPL/LOR
bridging from the HPL Power and LOR Power PGA widgets so the upstream
driver stage is powered when bridged.
Because AIC32X4_HPRROUTE bit 0 is reserved on TLV320AIC32x6 devices
(SLAA463 / SLAU306, which use ground-centered charge-pump headphone
drivers rather than AVDD-powered headphone drivers), register the HPR
Output Mixer widget in aic32x4_component_probe() so 'HPL Switch' and its
route are only exposed on AIC32X4_TYPE_AIC32X4.
Signed-off-by: Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
---
v2:
- Restrict 'HPL Switch' (AIC32X4_HPRROUTE bit 0) and its DAPM route to
AIC32X4_TYPE_AIC32X4, since bit 0 is reserved on TLV320AIC32x6
(Mark Brown).
sound/soc/codecs/tlv320aic32x4.c | 46 +++++++++++++++++++++++++++++---
1 file changed, 43 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index 875d934bb5c8d..ba881b28f1fd6 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -323,12 +323,17 @@ static const struct snd_kcontrol_new hpl_output_mixer_controls[] = {
};
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),
+ /* HPL Switch (bit 0) is AIC32x4-only; keep last for AIC32x6 */
+ 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("LOR Switch", AIC32X4_LOLROUTE, 0, 1, 0),
};
static const struct snd_kcontrol_new lor_output_mixer_controls[] = {
@@ -427,9 +432,6 @@ static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = {
SND_SOC_DAPM_PGA("LOL Power", AIC32X4_OUTPWRCTL, 3, 0, NULL, 0),
SND_SOC_DAPM_DAC("Right DAC", "Right Playback", AIC32X4_DACSETUP, 6, 0),
- SND_SOC_DAPM_MIXER("HPR Output Mixer", SND_SOC_NOPM, 0, 0,
- &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_MIXER("LOR Output Mixer", SND_SOC_NOPM, 0, 0,
&lor_output_mixer_controls[0],
@@ -487,6 +489,22 @@ static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = {
SND_SOC_DAPM_INPUT("CM_R"),
};
+static const struct snd_soc_dapm_widget aic32x4_hpr_dapm_widgets[] = {
+ SND_SOC_DAPM_MIXER("HPR Output Mixer", SND_SOC_NOPM, 0, 0,
+ &hpr_output_mixer_controls[0],
+ ARRAY_SIZE(hpr_output_mixer_controls)),
+};
+
+static const struct snd_soc_dapm_widget aic32x6_hpr_dapm_widgets[] = {
+ SND_SOC_DAPM_MIXER("HPR Output Mixer", SND_SOC_NOPM, 0, 0,
+ &hpr_output_mixer_controls[0],
+ ARRAY_SIZE(hpr_output_mixer_controls) - 1),
+};
+
+static const struct snd_soc_dapm_route aic32x4_extra_dapm_routes[] = {
+ {"HPR Output Mixer", "HPL Switch", "HPL Power"},
+};
+
static const struct snd_soc_dapm_route aic32x4_dapm_routes[] = {
/* Left Output */
{"HPL Output Mixer", "L_DAC Switch", "Left DAC"},
@@ -495,12 +513,15 @@ static const struct snd_soc_dapm_route aic32x4_dapm_routes[] = {
{"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", "LOR Switch", "LOR Power"},
{"LOL Power", NULL, "LOL Output Mixer"},
{"LOL", NULL, "LOL Power"},
/* Right Output */
+ {"HPR Output Mixer", "L_DAC Switch", "Left DAC"},
{"HPR Output Mixer", "R_DAC Switch", "Right DAC"},
{"HPR Output Mixer", "IN1_R Switch", "IN1_R"},
@@ -961,14 +982,33 @@ static void aic32x4_setup_gpios(struct snd_soc_component *component)
static int aic32x4_component_probe(struct snd_soc_component *component)
{
+ struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
struct aic32x4_priv *aic32x4 = snd_soc_component_get_drvdata(component);
u32 tmp_reg;
+ int ret;
struct clk *codec_clkin = aic32x4->clocks[AIC32X4_CLK_CODEC_CLKIN].clk;
struct clk *pll = aic32x4->clocks[AIC32X4_CLK_PLL].clk;
struct clk *bdiv = aic32x4->clocks[AIC32X4_CLK_BDIV].clk;
struct clk *mdac = aic32x4->clocks[AIC32X4_CLK_MDAC].clk;
+ if (aic32x4->type == AIC32X4_TYPE_AIC32X4) {
+ ret = snd_soc_dapm_new_controls(dapm, aic32x4_hpr_dapm_widgets,
+ ARRAY_SIZE(aic32x4_hpr_dapm_widgets));
+ if (ret)
+ return ret;
+
+ ret = snd_soc_dapm_add_routes(dapm, aic32x4_extra_dapm_routes,
+ ARRAY_SIZE(aic32x4_extra_dapm_routes));
+ if (ret)
+ return ret;
+ } else {
+ ret = snd_soc_dapm_new_controls(dapm, aic32x6_hpr_dapm_widgets,
+ ARRAY_SIZE(aic32x6_hpr_dapm_widgets));
+ if (ret)
+ return ret;
+ }
+
aic32x4_setup_gpios(component);
clk_set_parent(codec_clkin, pll);
--
2.25.1
next prev parent reply other threads:[~2026-11-26 18:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 18:10 [PATCH v2 0/4] ASoC: tlv320aic32x4: Complete analog routing, Mixer Amp bypass, and volume controls Gianfranco Mariotti
2026-11-26 18:10 ` Gianfranco Mariotti [this message]
2026-11-26 18:10 ` [PATCH v2 2/4] ASoC: tlv320aic32x4: Add Left and Right Mixer Amplifier DAPM support Gianfranco Mariotti
2026-11-26 18:10 ` [PATCH v2 3/4] ASoC: tlv320aic32x4: Add IN1 and Mixer Amp analog bypass volume controls Gianfranco Mariotti
2026-11-26 18:10 ` [PATCH v2 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=20261126181038.99595-2-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®