[PATCH v3 2/2] ASoC: es8328: set SLRCK for the ES8388
From: Bob Hui
Date: Sat Oct 31 2026 - 06:44:03 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.
Assisted-by: Hermes:deepseek-v4-flash
Signed-off-by: Bob Hui <bg9oxa@xxxxxxx>
---
sound/soc/codecs/es8328.c | 17 +++++++++++++++++
sound/soc/codecs/es8328.h | 2 ++
2 files changed, 19 insertions(+)
diff --git a/sound/soc/codecs/es8328.c b/sound/soc/codecs/es8328.c
index 5618fd7e6eb6..c283e814177b 100644
--- a/sound/soc/codecs/es8328.c
+++ b/sound/soc/codecs/es8328.c
@@ -868,8 +868,25 @@ static int es8328_component_probe(struct snd_soc_component *component)
*/
regcache_drop_region(es8328->regmap, 0, ES8328_REG_MAX);
+ /*
+ * 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_slrck;
+ }
+
return 0;
+err_slrck:
+ clk_disable_unprepare(es8328->clk);
+
clk_fail:
regulator_bulk_disable(ARRAY_SIZE(es8328->supplies),
es8328->supplies);
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