[PATCH] ASoC: es8316: fix MCLK_DIV clearing and 20dB mic boost routing

From: Harry Bit

Date: Fri Nov 27 2026 - 22:42:24 EST


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@xxxxxxxxx>
---
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