All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harry Bit <idleassetsd@gmail.com>
To: Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Daniel Drake <drake@endlessm.com>,
	Katsuhiro Suzuki <katsuhiro@katsuster.net>,
	Matteo Martelli <matteomartelli3@gmail.com>,
	Binbin Zhou <zhoubinbin@loongson.cn>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	Harry Bit <idleassetsd@gmail.com>
Subject: [PATCH] ASoC: es8316: fix MCLK_DIV clearing and 20dB mic boost routing
Date: Sat, 28 Nov 2026 11:42:10 +0800	[thread overview]
Message-ID: <20261128034210.746029-1-idleassetsd@gmail.com> (raw)

Clear ES8316_CLKMGR_CLKSW_MCLK_DIV when switching from a halved MCLK
back to an unhalved MCLK rate, and wire the missing 20 dB microphone
boost Differential Mux DAPM routes for MIC1 and MIC2.

Fixes: b8b88b70875a ("ASoC: add es8316 codec driver")
Fixes: 869f30782cda ("ASoC: es8316: Enable support for MCLK div by 2")
Signed-off-by: Harry Bit <idleassetsd@gmail.com>
---
 sound/soc/codecs/es8316.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c
index 334ac9119c..f329771bf9 100644
--- a/sound/soc/codecs/es8316.c
+++ b/sound/soc/codecs/es8316.c
@@ -305,6 +305,8 @@ static const struct snd_soc_dapm_route es8316_dapm_routes[] = {
 
 	{"Differential Mux", "lin1-rin1", "MIC1"},
 	{"Differential Mux", "lin2-rin2", "MIC2"},
+	{"Differential Mux", "lin1-rin1 with 20db Boost", "MIC1"},
+	{"Differential Mux", "lin2-rin2 with 20db Boost", "MIC2"},
 	{"Line input PGA", NULL, "Differential Mux"},
 
 	{"Mono ADC", NULL, "ADC Clock"},
@@ -514,11 +516,10 @@ static int es8316_pcm_hw_params(struct snd_pcm_substream *substream,
 		}
 	} while (!clk_valid);
 
-	if (clk != es8316->sysclk) {
-		snd_soc_component_update_bits(component, ES8316_CLKMGR_CLKSW,
-					      ES8316_CLKMGR_CLKSW_MCLK_DIV,
-					      ES8316_CLKMGR_CLKSW_MCLK_DIV);
-	}
+	snd_soc_component_update_bits(component, ES8316_CLKMGR_CLKSW,
+				      ES8316_CLKMGR_CLKSW_MCLK_DIV,
+				      clk != es8316->sysclk ?
+				      ES8316_CLKMGR_CLKSW_MCLK_DIV : 0);
 
 	lrck_divider = clk / params_rate(params);
 	bclk_divider = lrck_divider / 4;
-- 
2.47.3


                 reply	other threads:[~2026-11-28  3:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261128034210.746029-1-idleassetsd@gmail.com \
    --to=idleassetsd@gmail.com \
    --cc=broonie@kernel.org \
    --cc=drake@endlessm.com \
    --cc=katsuhiro@katsuster.net \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=matteomartelli3@gmail.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=zhoubinbin@loongson.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.