[PATCH v2] ALSA: hda/realtek: Add GPIO2 low quirk for ASUS E5402WHA

From: Zhang Heng

Date: Tue Oct 13 2026 - 03:15:29 EST


The internal speaker amplifier on the ASUS ExpertCenter AIO E5402WHA
(ALC256, SSID 1043:3500) is enabled via GPIO2 and is active-low.
Driving GPIO2 high, as ALC256_FIXUP_ASUS_AIO_GPIO2 does on the ZN270IE,
keeps the speakers muted. Add a dedicated fixup that drives GPIO2 low
so the internal speakers work.

Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221938
Tested-by: Johan den Hollander <johan.den.hollander@xxxxxxxxxxx>
Signed-off-by: Zhang Heng <zhangheng@xxxxxxxxxx>
---
sound/hda/codecs/realtek/alc269.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index 9eeb3a66b2b9..92686e71dad1 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -2809,6 +2809,19 @@ static void alc275_fixup_gpio4_off(struct hda_codec *codec,
}
}

+static void alc256_fixup_asus_aio_gpio2_low(struct hda_codec *codec,
+ const struct hda_fixup *fix,
+ int action)
+{
+ struct alc_spec *spec = codec->spec;
+
+ if (action == HDA_FIXUP_ACT_PRE_PROBE) {
+ spec->gpio_mask |= 0x04;
+ spec->gpio_dir |= 0x04;
+ spec->gpio_data &= ~0x04;
+ }
+}
+
/* Quirk for Thinkpad X1 7th and 8th Gen
* The following fixed routing needed
* DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
@@ -4250,6 +4263,7 @@ enum {
ALC256_FIXUP_ASUS_HEADSET_MODE,
ALC256_FIXUP_ASUS_MIC,
ALC256_FIXUP_ASUS_AIO_GPIO2,
+ ALC256_FIXUP_ASUS_AIO_GPIO2_LOW,
ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
ALC233_FIXUP_LENOVO_MULTI_CODECS,
@@ -5584,6 +5598,10 @@ static const struct hda_fixup alc269_fixups[] = {
/* Set up GPIO2 for the speaker amp */
.v.func = alc_fixup_gpio4,
},
+ [ALC256_FIXUP_ASUS_AIO_GPIO2_LOW] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = alc256_fixup_asus_aio_gpio2_low,
+ },
[ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
.type = HDA_FIXUP_PINS,
.v.pins = (const struct hda_pintbl[]) {
@@ -8124,6 +8142,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1043, 0x31e1, "ASUS B5605CCA", ALC294_FIXUP_ASUS_CS35L41_SPI_2),
SND_PCI_QUIRK(0x1043, 0x31f1, "ASUS B3605CCA", ALC294_FIXUP_ASUS_CS35L41_SPI_2),
SND_PCI_QUIRK(0x1043, 0x3391, "ASUS PM3606CKA", ALC287_FIXUP_CS35L41_I2C_2),
+ SND_PCI_QUIRK(0x1043, 0x3500, "ASUS E5402WHA", ALC256_FIXUP_ASUS_AIO_GPIO2_LOW),
SND_PCI_QUIRK(0x1043, 0x3501, "ASUS PM3606CHA", ALC256_FIXUP_ASUS_SPEAKER_COEFS),
SND_PCI_QUIRK(0x1043, 0x3601, "ASUS PM5406CGA", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x1043, 0x3611, "ASUS PM5606CGA", ALC287_FIXUP_CS35L41_I2C_2),
--
2.25.1