Skip to contentSkip to conversation

ALSA: hda/realtek: Improve fixup for HP Spectre x360 15-df0xxx

PATCH In review Elia Devito 2 participants 2 messages Jun 19, 2021 – Jun 20, 2021 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda/realtek: Improve fixup for HP Spectre x360 15-df0xxx

On HP Spectre x360 15-df0xxx, after system boot with plugged headset, the headset mic are not detected.
Moving pincfg and DAC's config to single fixup function fix this.

---
 sound/pci/hda/patch_realtek.c | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)
sound/pci/hda/patch_realtek.c +20 -7
index 59d0936377eb..07eabcf22b5f 100644
@@ -6354,6 +6354,24 @@ static void alc_fixup_no_int_mic(struct hda_codec *codec,
 	}
 }
 
+static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
+					  const struct hda_fixup *fix, int action)
+{
+	static const hda_nid_t conn[] = { 0x02 };
+	static const struct hda_pintbl pincfgs[] = {
+		{ 0x14, 0x90170110 },  /* rear speaker */
+		{ }
+	};
+
+	switch (action) {
+	case HDA_FIXUP_ACT_PRE_PROBE:
+		snd_hda_apply_pincfgs(codec, pincfgs);
+		/* force front speaker to DAC1 */
+		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
+		break;
+	}
+}
+
 /* for hda_fixup_thinkpad_acpi() */
 #include "thinkpad_helper.c"
 
@@ -8138,13 +8156,8 @@ static const struct hda_fixup alc269_fixups[] = {
 		.chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
 	},
 	[ALC285_FIXUP_HP_SPECTRE_X360] = {
-		.type = HDA_FIXUP_PINS,
-		.v.pins = (const struct hda_pintbl[]) {
-			{ 0x14, 0x90170110 }, /* enable top speaker */
-			{}
-		},
-		.chained = true,
-		.chain_id = ALC285_FIXUP_SPEAKER2_TO_DAC1,
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc285_fixup_hp_spectre_x360,
 	},
 	[ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
 		.type = HDA_FIXUP_FUNC,
Signature · 1 line
2.31.1
#1 lore raw
Quoted 6 lines · Elia Devito

On HP Spectre x360 15-df0xxx, after system boot with plugged headset, the headset mic are not detected.
Moving pincfg and DAC's config to single fixup function fix this.

Oh, this was an unintended bug. The actual fix isn't about moving two things into one fixup, but rather dropping the superfluous chain to ALC269_FIXUP_THINKPAD_ACPI.

Now applied with some more comments (and Cc to stable). Thanks.

Takashi