History

ALSA: hda/realtek: Enable jack detection on Minisforum AI X1 Pro

The firmware of the Minisforum AI X1 Pro leaves the headphone jack detector reset bit asserted on its ALC245 codec. As a result, pin sense on NID 0x21 always reports the jack as absent. Clear only the Reset HP JD bit during codec initialization. Preserve the remaining coefficient bits. This makes pin sense and the generic HDA auto-mute logic work normally. Apply the fixup at INIT to also reapply the setting after codec reinitialization and resume. Tested on a Minisforum AI X1 Pro with codec 0x10ec0245 and subsystem 0x1f4cb020 using Ubuntu 26.04 kernel 7.0.0-28-generic.

Jeremie Pardou committed 3 months ago

Commit 6bd8a571 parent 81774801 file · +16 −0Browse files

Unified · Split

sound/hda/codecs/realtek/alc269.c+16−0
@@ -1398,6 +1398,15 @@ static void alc245_fixup_hp_gpio_led(struct hda_codec *codec, · 1397 unmodified lines
13981398 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
13991399 }
14001400
1401+static void alc245_fixup_minisforum_jack_detect(struct hda_codec *codec,
1402+ const struct hda_fixup *fix,
1403+ int action)
1404+{
1405+ if (action == HDA_FIXUP_ACT_INIT)
1406+ /* Clear Reset HP JD while preserving the other coefficient bits. */
1407+ alc_update_coef_idx(codec, 0x4a, BIT(15), 0);
1408+}
1409+
14011410 /* turn on/off mic-mute LED per capture hook via VREF change */
14021411 static int vref_micmute_led_set(struct led_classdev *led_cdev,
14031412 enum led_brightness brightness)
@@ -4237,6 +4246,7 @@ enum { · 2833 unmodified lines
42374246 ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318,
42384247 ALC256_FIXUP_CHROME_BOOK,
42394248 ALC245_FIXUP_CLEVO_NOISY_MIC,
4249+ ALC245_FIXUP_MINISFORUM_JACK_DETECT,
42404250 ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE,
42414251 ALC233_FIXUP_MEDION_MTL_SPK,
42424252 ALC269_FIXUP_STARLABS_LIMIT_INT_MIC_BOOST,
@@ -6796,6 +6806,10 @@ static const struct hda_fixup alc269_fixups[] = { · 2553 unmodified lines
67966806 .chained = true,
67976807 .chain_id = ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
67986808 },
6809+ [ALC245_FIXUP_MINISFORUM_JACK_DETECT] = {
6810+ .type = HDA_FIXUP_FUNC,
6811+ .v.func = alc245_fixup_minisforum_jack_detect,
6812+ },
67996813 [ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE] = {
68006814 .type = HDA_FIXUP_PINS,
68016815 .v.pins = (const struct hda_pintbl[]) {
@@ -8167,6 +8181,8 @@ static const struct hda_quirk alc269_fixup_tbl[] = { · 1365 unmodified lines
81678181 SND_PCI_QUIRK(0x1e50, 0x7038, "Positivo DN140", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
81688182 SND_PCI_QUIRK(0x1ee7, 0x2078, "HONOR BRB-X M1010", ALC2XX_FIXUP_HEADSET_MIC),
81698183 SND_PCI_QUIRK(0x1ee7, 0x2081, "HONOR MRB-XXX M1020", ALC256_FIXUP_HONOR_MRB_XXX_M1020_AUDIO),
8184+ SND_PCI_QUIRK(0x1f4c, 0xb020, "Minisforum AI X1 Pro",
8185+ ALC245_FIXUP_MINISFORUM_JACK_DETECT),
81708186 SND_PCI_QUIRK(0x1f4c, 0xe001, "Minisforum V3 (SE)", ALC245_FIXUP_BASS_HP_DAC),
81718187 SND_PCI_QUIRK(0x1f66, 0x0105, "Ayaneo Portable Game Player", ALC287_FIXUP_CS35L41_I2C_2),
81728188 SND_PCI_QUIRK(0x2014, 0x800a, "Positivo ARN50", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),