[PATCH v5 2/2] ASoC: es8328: set SLRCK for the ES8388

From: Bob Hui

Date: Tue Nov 03 2026 - 09:37:43 EST


The ES8388 has a single LRCK pin, so the DAC and the ADC have to take
their frame clock from that one pin. With SLRCK clear, which is the
power-on default, the capture path never gets a frame clock and records
digital silence while playback keeps working, so boards look like they
have a dead microphone.

Bit 7 of DAC Control 21 is SLRCK on the ES8388 but LD2MO, left DAC to the
mono mixer, on the ES8328, so only set it for the ES8388, using the
variant looked up from the match data.

Tested on a QuarkPi-CA2 (RK3588S, ES8388): capture goes from digital
silence to working audio.

Signed-off-by: Bob Hui <bg9oxa@xxxxxxx>
---
sound/soc/codecs/es8328.c | 14 ++++++++++++++
sound/soc/codecs/es8328.h | 2 ++
2 files changed, 16 insertions(+)

diff --git a/sound/soc/codecs/es8328.c b/sound/soc/codecs/es8328.c
index fc33d9418449..db3c2677d019 100644
--- a/sound/soc/codecs/es8328.c
+++ b/sound/soc/codecs/es8328.c
@@ -875,6 +875,20 @@ static int es8328_component_probe(struct snd_soc_component *component)
goto err_clk;
}

+ /*
+ * The ES8388 has a single LRCK pin, so the DAC and the ADC must
+ * share it: without SLRCK the capture path never gets a frame
+ * clock and records digital silence while playback still works.
+ * Bit 7 of DAC Control 21 is SLRCK on the ES8388 and LD2MO (left
+ * DAC to the mono mixer) on the ES8328.
+ */
+ if (es8328->type == ES8328_TYPE_ES8388) {
+ ret = snd_soc_component_write(component, ES8328_DACCONTROL21,
+ ES8328_DACCONTROL21_SLRCK);
+ if (ret)
+ goto err_clk;
+ }
+
return 0;

err_clk:
diff --git a/sound/soc/codecs/es8328.h b/sound/soc/codecs/es8328.h
index 3e2cfca050e2..6c175b3ee23e 100644
--- a/sound/soc/codecs/es8328.h
+++ b/sound/soc/codecs/es8328.h
@@ -232,6 +232,8 @@ int es8328_probe(struct device *dev, struct regmap *regmap,
#define ES8328_DACCONTROL21_LI2MOVOL (7 << 3)
#define ES8328_DACCONTROL21_LI2MO (1 << 6)
#define ES8328_DACCONTROL21_LD2MO (1 << 7)
+/* Bit 7 is SLRCK on the ES8388 and LD2MO on the ES8328 */
+#define ES8328_DACCONTROL21_SLRCK (1 << 7)

#define ES8328_DACCONTROL22 0x2c
#define ES8328_DACCONTROL22_RI2MOVOL (7 << 3)

--
2.34.1