linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda/realtek - Add disable auto-mute quirk for HP Spectre x360 laptop
@ 2018-11-21 14:11 Girija Kumar Kasinadhuni
  2018-11-21 16:51 ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Girija Kumar Kasinadhuni @ 2018-11-21 14:11 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Kailang Yang, Hui Wang,
	alsa-devel, linux-kernel
  Cc: Girija Kumar Kasinadhuni

This device makes a loud buzzing sound when a headphone is inserted while
playing audio at full volume through the speaker.

Signed-off-by: Girija Kumar Kasinadhuni <gkumar@neverware.com>
---
 sound/pci/hda/patch_realtek.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index fa61674..eeff2ff 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5495,6 +5495,7 @@ enum {
 	ALC255_FIXUP_DELL_HEADSET_MIC,
 	ALC295_FIXUP_HP_X360,
 	ALC221_FIXUP_HP_HEADSET_MIC,
+	ALC295_FIXUP_HP_DISABLE_AUTOMUTE,
 };
 
 static const struct hda_fixup alc269_fixups[] = {
@@ -6362,6 +6363,10 @@ static const struct hda_fixup alc269_fixups[] = {
 		.chained = true,
 		.chain_id = ALC269_FIXUP_HEADSET_MIC
 	},
+	[ALC295_FIXUP_HP_DISABLE_AUTOMUTE] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc_fixup_auto_mute_via_amp,
+	},
 };
 
 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -6486,6 +6491,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x103c, 0x82bf, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
 	SND_PCI_QUIRK(0x103c, 0x82c0, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
 	SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
+	SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre X360 ", ALC295_FIXUP_HP_DISABLE_AUTOMUTE),
 	SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
 	SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
 	SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ALSA: hda/realtek - Add disable auto-mute quirk for HP Spectre x360 laptop
  2018-11-21 14:11 [PATCH] ALSA: hda/realtek - Add disable auto-mute quirk for HP Spectre x360 laptop Girija Kumar Kasinadhuni
@ 2018-11-21 16:51 ` Takashi Iwai
  2018-11-21 17:49   ` [PATCH v2] ALSA: hda/realtek - Add " Girija Kumar Kasinadhuni
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2018-11-21 16:51 UTC (permalink / raw)
  To: Girija Kumar Kasinadhuni
  Cc: alsa-devel, Hui Wang, Jaroslav Kysela, KailangYang, linux-kernel

On Wed, 21 Nov 2018 15:11:31 +0100,
Girija Kumar Kasinadhuni wrote:
> 
> This device makes a loud buzzing sound when a headphone is inserted while
> playing audio at full volume through the speaker.
> 
> Signed-off-by: Girija Kumar Kasinadhuni <gkumar@neverware.com>

The fixup entry you added won't "disable" but it switch to the
auto-mute via amp instead of toggling pin control.
Please correct the subject and the description, and resubmit.


thanks,

Takashi



> ---
>  sound/pci/hda/patch_realtek.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> index fa61674..eeff2ff 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -5495,6 +5495,7 @@ enum {
>  	ALC255_FIXUP_DELL_HEADSET_MIC,
>  	ALC295_FIXUP_HP_X360,
>  	ALC221_FIXUP_HP_HEADSET_MIC,
> +	ALC295_FIXUP_HP_DISABLE_AUTOMUTE,
>  };
>  
>  static const struct hda_fixup alc269_fixups[] = {
> @@ -6362,6 +6363,10 @@ static const struct hda_fixup alc269_fixups[] = {
>  		.chained = true,
>  		.chain_id = ALC269_FIXUP_HEADSET_MIC
>  	},
> +	[ALC295_FIXUP_HP_DISABLE_AUTOMUTE] = {
> +		.type = HDA_FIXUP_FUNC,
> +		.v.func = alc_fixup_auto_mute_via_amp,
> +	},
>  };
>  
>  static const struct snd_pci_quirk alc269_fixup_tbl[] = {
> @@ -6486,6 +6491,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
>  	SND_PCI_QUIRK(0x103c, 0x82bf, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
>  	SND_PCI_QUIRK(0x103c, 0x82c0, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
>  	SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
> +	SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre X360 ", ALC295_FIXUP_HP_DISABLE_AUTOMUTE),
>  	SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
>  	SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
>  	SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] ALSA: hda/realtek - Add auto-mute quirk for HP Spectre x360 laptop
  2018-11-21 16:51 ` Takashi Iwai
@ 2018-11-21 17:49   ` Girija Kumar Kasinadhuni
  2018-11-21 22:23     ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Girija Kumar Kasinadhuni @ 2018-11-21 17:49 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Kailang Yang, Hui Wang,
	alsa-devel, linux-kernel
  Cc: Girija Kumar Kasinadhuni

This device makes a loud buzzing sound when a headphone is inserted while
playing audio at full volume through the speaker.

Signed-off-by: Girija Kumar Kasinadhuni <gkumar@neverware.com>
---
Changes in v2:
	- changed commit message
	- removed "disable" from description

 sound/pci/hda/patch_realtek.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index fa61674..69bb005 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5495,6 +5495,7 @@ enum {
 	ALC255_FIXUP_DELL_HEADSET_MIC,
 	ALC295_FIXUP_HP_X360,
 	ALC221_FIXUP_HP_HEADSET_MIC,
+	ALC295_FIXUP_HP_AUTO_MUTE,
 };
 
 static const struct hda_fixup alc269_fixups[] = {
@@ -6362,6 +6363,10 @@ static const struct hda_fixup alc269_fixups[] = {
 		.chained = true,
 		.chain_id = ALC269_FIXUP_HEADSET_MIC
 	},
+	[ALC295_FIXUP_HP_AUTO_MUTE] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc_fixup_auto_mute_via_amp,
+	},
 };
 
 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -6486,6 +6491,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x103c, 0x82bf, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
 	SND_PCI_QUIRK(0x103c, 0x82c0, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
 	SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
+	SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre X360 ", ALC295_FIXUP_HP_AUTO_MUTE),
 	SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
 	SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
 	SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] ALSA: hda/realtek - Add auto-mute quirk for HP Spectre x360 laptop
  2018-11-21 17:49   ` [PATCH v2] ALSA: hda/realtek - Add " Girija Kumar Kasinadhuni
@ 2018-11-21 22:23     ` Takashi Iwai
  2018-11-26 18:40       ` [PATCH v3] " Girija Kumar Kasinadhuni
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2018-11-21 22:23 UTC (permalink / raw)
  To: Girija Kumar Kasinadhuni
  Cc: alsa-devel, Hui Wang, Jaroslav Kysela, Kailang Yang, linux-kernel

On Wed, 21 Nov 2018 18:49:11 +0100,
Girija Kumar Kasinadhuni wrote:
> 
> @@ -6486,6 +6491,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
>  	SND_PCI_QUIRK(0x103c, 0x82bf, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
>  	SND_PCI_QUIRK(0x103c, 0x82c0, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
>  	SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
> +	SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre X360 ", ALC295_FIXUP_HP_AUTO_MUTE),

So this adds a new entry with the very same ID as the previous entry.
This won't work, unfortunately.  The quirk is chosen only for the
first matching one.

For making it working, you'd need to add to the chain of the existing
quirk instead.

And this shows that the patch wasn't properly tested...  Please check
the actual behavior before submitting the final version.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3] ALSA: hda/realtek - Add auto-mute quirk for HP Spectre x360 laptop
  2018-11-21 22:23     ` Takashi Iwai
@ 2018-11-26 18:40       ` Girija Kumar Kasinadhuni
  2018-11-27 11:19         ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Girija Kumar Kasinadhuni @ 2018-11-26 18:40 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Kailang Yang, Hui Wang,
	alsa-devel, linux-kernel
  Cc: Girija Kumar Kasinadhuni

This device makes a loud buzzing sound when a headphone is inserted while
playing audio at full volume through the speaker.

Signed-off-by: Girija Kumar Kasinadhuni <gkumar@neverware.com>
---
Apologies for the earlier patch not being tested properly. Verified this
time, and on the actual hardware. Here' s the alsa-info output.
http://www.alsa-project.org/db/?f=16bc34d9bf8c9b2536969c125c1721fee570c9b0

 sound/pci/hda/patch_realtek.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 970bc44..c39f7f2 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5495,6 +5495,7 @@ enum {
 	ALC255_FIXUP_DELL_HEADSET_MIC,
 	ALC295_FIXUP_HP_X360,
 	ALC221_FIXUP_HP_HEADSET_MIC,
+	ALC295_FIXUP_HP_AUTO_MUTE,
 };
 
 static const struct hda_fixup alc269_fixups[] = {
@@ -5659,6 +5660,8 @@ static const struct hda_fixup alc269_fixups[] = {
 	[ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc269_fixup_hp_mute_led_mic3,
+		.chained = true,
+		.chain_id = ALC295_FIXUP_HP_AUTO_MUTE
 	},
 	[ALC269_FIXUP_HP_GPIO_LED] = {
 		.type = HDA_FIXUP_FUNC,
@@ -6362,6 +6365,10 @@ static const struct hda_fixup alc269_fixups[] = {
 		.chained = true,
 		.chain_id = ALC269_FIXUP_HEADSET_MIC
 	},
+	[ALC295_FIXUP_HP_AUTO_MUTE] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc_fixup_auto_mute_via_amp,
+	},
 };
 
 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] ALSA: hda/realtek - Add auto-mute quirk for HP Spectre x360 laptop
  2018-11-26 18:40       ` [PATCH v3] " Girija Kumar Kasinadhuni
@ 2018-11-27 11:19         ` Takashi Iwai
  0 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2018-11-27 11:19 UTC (permalink / raw)
  To: Girija Kumar Kasinadhuni
  Cc: alsa-devel, Hui Wang, Jaroslav Kysela, Kailang Yang, linux-kernel

On Mon, 26 Nov 2018 19:40:46 +0100,
Girija Kumar Kasinadhuni wrote:
> 
> This device makes a loud buzzing sound when a headphone is inserted while
> playing audio at full volume through the speaker.
> 
> Signed-off-by: Girija Kumar Kasinadhuni <gkumar@neverware.com>
> ---
> Apologies for the earlier patch not being tested properly. Verified this
> time, and on the actual hardware. Here' s the alsa-info output.
> http://www.alsa-project.org/db/?f=16bc34d9bf8c9b2536969c125c1721fee570c9b0

Thanks, applied now.


Takashi

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-11-27 11:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-21 14:11 [PATCH] ALSA: hda/realtek - Add disable auto-mute quirk for HP Spectre x360 laptop Girija Kumar Kasinadhuni
2018-11-21 16:51 ` Takashi Iwai
2018-11-21 17:49   ` [PATCH v2] ALSA: hda/realtek - Add " Girija Kumar Kasinadhuni
2018-11-21 22:23     ` Takashi Iwai
2018-11-26 18:40       ` [PATCH v3] " Girija Kumar Kasinadhuni
2018-11-27 11:19         ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).