Skip to contentSkip to conversation

HP ALC671 support headset Mic

alsa-devel Kailang 2 participants 4 messages Jan 17, 2020 Sound

lore
Share & tools
lore

Kailang

author
#0 lore raw

Hi Takashi,

HP cPC need to support headset Mic.
Attach patch was the support patch.

BR,
Kailang

From b97f94fadcd1dc1a20fca198640aff715d9b0467 Mon Sep 17 00:00:00 2001
From: Kailang Yang <[email protected]>
Date: Fri, 17 Jan 2020 14:04:01 +0800
Subject: [PATCH] ALSA: hda/realtek - Add Headset Mic supported for HP cPC

HP ALC671 need to support Headset Mic.

Fixes d2cd795c4ece ("ALSA: hda - fixup for the bass speaker on Lenovo Carbon X1 7th gen")
sound/pci/hda/patch_realtek.c +44 -0
index 73407b25a777..e4469a25560e 100644
@@ -8482,6 +8482,29 @@ static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
 	}
 }
 
+static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
+					     const struct hda_fixup *fix, int action)
+{
+	struct alc_spec *spec = codec->spec;
+
+	static const struct hda_pintbl pincfgs[] = {
+		{ 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
+		{ 0x1b, 0x0181304f },
+		{ }
+	};
+
+	switch (action) {
+	case HDA_FIXUP_ACT_PRE_PROBE:
+		spec->gen.mixer_nid = 0;
+		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
+		snd_hda_apply_pincfgs(codec, pincfgs);
+		break;
+	case HDA_FIXUP_ACT_INIT:
+		alc_write_coef_idx(codec, 0x19, 0xa054);
+		break;
+	}
+}
+
 static const struct coef_fw alc668_coefs[] = {
 	WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03,    0x0),
 	WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06,    0x0), WRITE_COEF(0x07, 0x0f80),
@@ -8555,6 +8578,7 @@ enum {
 	ALC662_FIXUP_LENOVO_MULTI_CODECS,
 	ALC669_FIXUP_ACER_ASPIRE_ETHOS,
 	ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
+	ALC671_FIXUP_HP_HEADSET_MIC2,
 };
 
 static const struct hda_fixup alc662_fixups[] = {
@@ -8896,6 +8920,10 @@ static const struct hda_fixup alc662_fixups[] = {
 		.chained = true,
 		.chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
 	},
+	[ALC671_FIXUP_HP_HEADSET_MIC2] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc671_fixup_hp_headset_mic2,
+	},
 };
 
 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
@@ -9078,6 +9106,22 @@ static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
 		{0x12, 0x90a60130},
 		{0x14, 0x90170110},
 		{0x15, 0x0321101f}),
+	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
+		{0x14, 0x01014010},
+		{0x17, 0x90170150},
+		{0x1b, 0x01813030},
+		{0x21, 0x02211020}),
+	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
+		{0x14, 0x01014010},
+		{0x18, 0x01a19040},
+		{0x1b, 0x01813030},
+		{0x21, 0x02211020}),
+	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
+		{0x14, 0x01014020},
+		{0x17, 0x90170110},
+		{0x18, 0x01a19050},
+		{0x1b, 0x01813040},
+		{0x21, 0x02211030}),
 	{}
 };
 

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#1 lore raw

On Fri, 17 Jan 2020 07:14:46 +0100,
Kailang wrote:

Quoted 9 lines · Kailang

Hi Takashi,

HP cPC need to support headset Mic.
Attach patch was the support patch.

BR,
Kailang
[2 0005-hp-alc671-headset-mic.patch <application/octet-stream (base64)>]

Thanks, but the patch contains:

Quoted 1 line
Fixes d2cd795c4ece ("ALSA: hda - fixup for the bass speaker on Lenovo Carbon X1 7th gen")

This doesn't look correct to me. It's not about Lenovo X1, right?

Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

author
#2 lore raw
Quoted 24 lines

-----Original Message-----
From: Takashi Iwai <[email protected]>
Sent: Friday, January 17, 2020 4:02 PM
To: Kailang <[email protected]>
Cc: ([email protected]) <[email protected]>; Chih-Hsyuan Ho <[email protected]>; Hui Wang <[email protected]>
Subject: Re: HP ALC671 support headset Mic

On Fri, 17 Jan 2020 07:14:46 +0100,
Kailang wrote:

Quoted 9 lines · Kailang

Hi Takashi,

HP cPC need to support headset Mic.
Attach patch was the support patch.

BR,
Kailang
[2 0005-hp-alc671-headset-mic.patch <application/octet-stream (base64)>]

Quoted 5 lines

Thanks, but the patch contains:

Quoted 1 line
Fixes d2cd795c4ece ("ALSA: hda - fixup for the bass speaker on Lenovo

Carbon X1 7th gen")

This doesn't look correct to me. It's not about Lenovo X1, right?

Yes, it's typo.
Attach again.
Sorry.

Quoted 5 lines

Takashi

------Please consider the environment before printing this e-mail.

From b97f94fadcd1dc1a20fca198640aff715d9b0467 Mon Sep 17 00:00:00 2001
From: Kailang Yang <[email protected]>
Date: Fri, 17 Jan 2020 14:04:01 +0800
Subject: [PATCH] ALSA: hda/realtek - Add Headset Mic supported for HP cPC

HP ALC671 need to support Headset Mic.

sound/pci/hda/patch_realtek.c +44 -0
index 73407b25a777..e4469a25560e 100644
@@ -8482,6 +8482,29 @@ static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
 	}
 }
 
+static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
+					     const struct hda_fixup *fix, int action)
+{
+	struct alc_spec *spec = codec->spec;
+
+	static const struct hda_pintbl pincfgs[] = {
+		{ 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
+		{ 0x1b, 0x0181304f },
+		{ }
+	};
+
+	switch (action) {
+	case HDA_FIXUP_ACT_PRE_PROBE:
+		spec->gen.mixer_nid = 0;
+		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
+		snd_hda_apply_pincfgs(codec, pincfgs);
+		break;
+	case HDA_FIXUP_ACT_INIT:
+		alc_write_coef_idx(codec, 0x19, 0xa054);
+		break;
+	}
+}
+
 static const struct coef_fw alc668_coefs[] = {
 	WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03,    0x0),
 	WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06,    0x0), WRITE_COEF(0x07, 0x0f80),
@@ -8555,6 +8578,7 @@ enum {
 	ALC662_FIXUP_LENOVO_MULTI_CODECS,
 	ALC669_FIXUP_ACER_ASPIRE_ETHOS,
 	ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
+	ALC671_FIXUP_HP_HEADSET_MIC2,
 };
 
 static const struct hda_fixup alc662_fixups[] = {
@@ -8896,6 +8920,10 @@ static const struct hda_fixup alc662_fixups[] = {
 		.chained = true,
 		.chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
 	},
+	[ALC671_FIXUP_HP_HEADSET_MIC2] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc671_fixup_hp_headset_mic2,
+	},
 };
 
 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
@@ -9078,6 +9106,22 @@ static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
 		{0x12, 0x90a60130},
 		{0x14, 0x90170110},
 		{0x15, 0x0321101f}),
+	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
+		{0x14, 0x01014010},
+		{0x17, 0x90170150},
+		{0x1b, 0x01813030},
+		{0x21, 0x02211020}),
+	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
+		{0x14, 0x01014010},
+		{0x18, 0x01a19040},
+		{0x1b, 0x01813030},
+		{0x21, 0x02211020}),
+	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
+		{0x14, 0x01014020},
+		{0x17, 0x90170110},
+		{0x18, 0x01a19050},
+		{0x1b, 0x01813040},
+		{0x21, 0x02211030}),
 	{}
 };
 

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#3 lore raw
Quoted 23 lines · Kailang
Quoted 23 lines

-----Original Message-----
From: Takashi Iwai <[email protected]>
Sent: Friday, January 17, 2020 4:02 PM
To: Kailang <[email protected]>
Cc: ([email protected]) <[email protected]>; Chih-Hsyuan Ho <[email protected]>; Hui Wang <[email protected]>
Subject: Re: HP ALC671 support headset Mic

On Fri, 17 Jan 2020 07:14:46 +0100,
Kailang wrote:

Quoted 9 lines · Kailang

Hi Takashi,

HP cPC need to support headset Mic.
Attach patch was the support patch.

BR,
Kailang
[2 0005-hp-alc671-headset-mic.patch <application/octet-stream (base64)>]

Quoted 8 lines
Quoted 5 lines

Thanks, but the patch contains:

Quoted 1 line
Fixes d2cd795c4ece ("ALSA: hda - fixup for the bass speaker on Lenovo

Carbon X1 7th gen")

This doesn't look correct to me. It's not about Lenovo X1, right?

Yes, it's typo.
Attach again.
Sorry.

Applied now, thanks.

Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel