ASoC: aw88399: skip BSTS check when boost converter is bypassed

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: 8ade6cc7e2 ("ASoC: codecs: Add aw88399 amplifier driver")
Signed-off-by: Marco Giunta <marco_giunta@outlook.it>
Link: https://patch.msgid.link/SN6PR19MB2303FF1922BF5F876378066FFC8F2@SN6PR19MB2303.namprd19.prod.outlook.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Marco Giunta 2026-09-26 14:25:58 +02:00 committed by Mark Brown
parent 20b2f7f756
commit 664824782d
2 changed files with 18 additions and 0 deletions

View File

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

View File

@ -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, &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.