]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: hda/realtek: Add quirk for CSL Unity BF24B
authorZhang Heng <zhangheng@kylinos.cn>
Thu, 9 Apr 2026 02:40:28 +0000 (10:40 +0800)
committerTakashi Iwai <tiwai@suse.de>
Thu, 9 Apr 2026 06:32:36 +0000 (08:32 +0200)
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>
sound/hda/codecs/realtek/alc662.c

index 5073165d1f3cf9a3519d4f3e9c2d900c5e3af02f..3abe41c7315c4646d703ea626cf8d2aa13206caf 100644 (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),