ALSA: hda/realtek: Add quirk for CSL Unity BF24B

The CSL Unity BF24B all-in-one PC uses a Realtek ALC662 rev3 audio
codec and requires the correct GPIO configuration to enable sound
output from both the speakers and the headphone.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=221258
Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
Link: https://patch.msgid.link/20260409024028.1297587-1-zhangheng@kylinos.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Zhang Heng 2026-04-09 10:40:28 +08:00 committed by Takashi Iwai
parent 3f44bccdd6
commit de65275fc9

View File

@ -255,6 +255,25 @@ static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
alc_fixup_headset_mode(codec, fix, action);
}
static void alc662_fixup_csl_amp(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
struct alc_spec *spec = codec->spec;
switch (action) {
case HDA_FIXUP_ACT_PRE_PROBE:
spec->gpio_mask |= 0x03;
spec->gpio_dir |= 0x03;
break;
case HDA_FIXUP_ACT_INIT:
/* need to toggle GPIO to enable the amp */
alc_update_gpio_data(codec, 0x03, true);
msleep(100);
alc_update_gpio_data(codec, 0x03, false);
break;
}
}
enum {
ALC662_FIXUP_ASPIRE,
ALC662_FIXUP_LED_GPIO1,
@ -313,6 +332,7 @@ enum {
ALC897_FIXUP_HEADSET_MIC_PIN2,
ALC897_FIXUP_UNIS_H3C_X500S,
ALC897_FIXUP_HEADSET_MIC_PIN3,
ALC662_FIXUP_CSL_GPIO,
};
static const struct hda_fixup alc662_fixups[] = {
@ -766,11 +786,16 @@ static const struct hda_fixup alc662_fixups[] = {
{ }
},
},
[ALC662_FIXUP_CSL_GPIO] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc662_fixup_csl_amp,
},
};
static const struct hda_quirk alc662_fixup_tbl[] = {
SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
SND_PCI_QUIRK(0x1019, 0x9859, "JP-IK LEAP W502", ALC897_FIXUP_HEADSET_MIC_PIN3),
SND_PCI_QUIRK(0x1022, 0xc950, "CSL Unity BF24B", ALC662_FIXUP_CSL_GPIO),
SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),