[PATCH 1/2] ASoC: aw88399: skip BSTS check when boost converter is bypassed
From: Marco Giunta
Date: Sat Sep 26 2026 - 08:26:36 EST
The sysst check in aw_dev_check_sysst() requires BSTS (boost finished)
to assert, but on hardware where the boost converter is bypassed via
external power supply (BSTCTRL10 register 0x69, EN_HVBAT bit 2 set),
BSTS (SYSST register 0x01, bit 9) will never assert.
The vendor's generic driver (aw883xx) handles this by reading EN_HVBAT and
conditionally masking out BSTS from the sysst check. The in-tree driver
missed this logic when the original code was ported upstream.
Add the same conditional check, matching the vendor driver's
aw_dev_sysst_check() implementation.
Fixes: 8ade6cc7e261 ("ASoC: codecs: Add aw88399 amplifier driver")
Signed-off-by: Marco Giunta <marco_giunta@xxxxxxxxxx>
---
include/sound/aw88399.h | 5 +++++
sound/soc/codecs/aw88399-lib.c | 13 +++++++++++++
2 files changed, 18 insertions(+)
diff --git a/include/sound/aw88399.h b/include/sound/aw88399.h
index a1e0de6be8ea..974b5774ac2b 100644
--- a/include/sound/aw88399.h
+++ b/include/sound/aw88399.h
@@ -449,6 +449,11 @@
#define AW88399_NOISE_GATE_EN_MASK \
(~(((1<<AW88399_NOISE_GATE_EN_BITS_LEN)-1) << AW88399_NOISE_GATE_EN_START_BIT))
+#define AW88399_EPS_EN_START_BIT (2)
+#define AW88399_EPS_EN_BITS_LEN (1)
+#define AW88399_EPS_EN_MASK \
+ (~(((1 << AW88399_EPS_EN_BITS_LEN) - 1) << AW88399_EPS_EN_START_BIT))
+
#define AW88399_WDT_CNT_START_BIT (0)
#define AW88399_WDT_CNT_BITS_LEN (8)
#define AW88399_WDT_CNT_MASK \
diff --git a/sound/soc/codecs/aw88399-lib.c b/sound/soc/codecs/aw88399-lib.c
index 809c2faa0c0c..1ba0147cf4df 100644
--- a/sound/soc/codecs/aw88399-lib.c
+++ b/sound/soc/codecs/aw88399-lib.c
@@ -183,6 +183,19 @@ static int aw_dev_check_sysst(struct aw88399 *aw88399)
else
check_val = AW88399_BIT_SYSST_SWS_CHECK;
+ /*
+ * When an external power supply (EPS) is used to feed the amplifier
+ * (EN_HVBAT bit in BSTCTRL10 set), the boost converter is bypassed,
+ * and BSTS (boost finished) will never assert. Skip the BSTS check in
+ * this case, matching the vendor driver's behavior.
+ */
+ ret = regmap_read(aw_dev->regmap, AW88399_BSTCTRL10_REG, ®_val);
+ if (ret)
+ return ret;
+
+ if (reg_val & (~AW88399_EPS_EN_MASK))
+ check_val &= ~AW88399_BSTS_FINISHED_VALUE;
+
/*
* On some hardware the BSTS (boost-finished) status bit does not
* reliably assert even when audio output is working normally.
--
2.55.0