public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ALSA: hda/realtek: Add headphone quirks for Aya devices
@ 2023-08-02 15:37 Matthew Anderson
  2023-08-02 15:37 ` [PATCH 1/2] ALSA: hda/realtek: Add headphone quirk for Aya Neo Geek Matthew Anderson
  2023-08-02 15:37 ` [PATCH 2/2] ALSA: hda/realtek: Add headphone quirk for Aya Neo 2 Matthew Anderson
  0 siblings, 2 replies; 5+ messages in thread
From: Matthew Anderson @ 2023-08-02 15:37 UTC (permalink / raw)
  To: tiwai; +Cc: perex, alsa-devel, linux-kernel, Matthew Anderson

This patch series gets the headphones working properly on the
Aya Neo Geek/2 devices. You must apply the Geek patch before
the Aya 2.

Matthew Anderson (2):
  ALSA: hda/realtek: Add headphone quirk for Aya Neo Geek
  ALSA: hda/realtek: Add headphone quirk for Aya Neo 2

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

-- 
2.41.0


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

* [PATCH 1/2] ALSA: hda/realtek: Add headphone quirk for Aya Neo Geek
  2023-08-02 15:37 [PATCH 0/2] ALSA: hda/realtek: Add headphone quirks for Aya devices Matthew Anderson
@ 2023-08-02 15:37 ` Matthew Anderson
  2023-08-02 15:55   ` Takashi Iwai
  2023-08-02 15:37 ` [PATCH 2/2] ALSA: hda/realtek: Add headphone quirk for Aya Neo 2 Matthew Anderson
  1 sibling, 1 reply; 5+ messages in thread
From: Matthew Anderson @ 2023-08-02 15:37 UTC (permalink / raw)
  To: tiwai; +Cc: perex, alsa-devel, linux-kernel, Matthew Anderson

This fixes the headphones on the Aya Neo Geek handheld.
Signed-off-by: Matthew Anderson <ruinairas1992@gmail.com>
---
 sound/pci/hda/patch_realtek.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 44fccfb93cff..33f9beec8179 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6521,6 +6521,20 @@ static void alc294_gx502_toggle_output(struct hda_codec *codec,
 		alc_write_coef_idx(codec, 0x10, 0x0a20);
 }
 
+static void alc269_fixup_headphone_volume(struct hda_codec *codec,
+					const struct hda_fixup *fix, int action)
+{
+	/* Pin 0x21: Some devices share 0x14 for headphones and speakers.
+	 * This will fix ensure these devices have volume controls. */
+	if (!is_jack_detectable(codec, 0x21))
+		return;
+
+	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
+		static const hda_nid_t conn1[] = { 0x02 };
+		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
+	}
+}
+
 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
 					const struct hda_fixup *fix, int action)
 {
@@ -7016,6 +7030,7 @@ enum {
 	ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
 	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
 	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
+	ALC269_FIXUP_HEADSET_AYA_GEEK,
 	ALC269_FIXUP_HEADSET_MODE,
 	ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
 	ALC269_FIXUP_ASPIRE_HEADSET_MIC,
@@ -8440,6 +8455,10 @@ static const struct hda_fixup alc269_fixups[] = {
 		.chained = true,
 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
 	},
+	[ALC269_FIXUP_HEADSET_AYA_GEEK] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc269_fixup_headphone_volume,
+	},
 	[ALC299_FIXUP_PREDATOR_SPK] = {
 		.type = HDA_FIXUP_PINS,
 		.v.pins = (const struct hda_pintbl[]) {
@@ -9934,6 +9953,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
 	SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
 	SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
+	SND_PCI_QUIRK(0x1f66, 0x0101, "GEEK", ALC269_FIXUP_HEADSET_AYA_GEEK),
 	SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
 	SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
 	SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
-- 
2.41.0


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

* [PATCH 2/2] ALSA: hda/realtek: Add headphone quirk for Aya Neo 2
  2023-08-02 15:37 [PATCH 0/2] ALSA: hda/realtek: Add headphone quirks for Aya devices Matthew Anderson
  2023-08-02 15:37 ` [PATCH 1/2] ALSA: hda/realtek: Add headphone quirk for Aya Neo Geek Matthew Anderson
@ 2023-08-02 15:37 ` Matthew Anderson
  2023-08-02 15:54   ` Takashi Iwai
  1 sibling, 1 reply; 5+ messages in thread
From: Matthew Anderson @ 2023-08-02 15:37 UTC (permalink / raw)
  To: tiwai; +Cc: perex, alsa-devel, linux-kernel, Matthew Anderson

This fixes the headphones on the Aya Neo 2 handheld.
Signed-off-by: Matthew Anderson <ruinairas1992@gmail.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 33f9beec8179..5d31cbe5d40b 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -7030,6 +7030,7 @@ enum {
 	ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
 	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
 	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
+	ALC269_FIXUP_HEADSET_AYA_2,
 	ALC269_FIXUP_HEADSET_AYA_GEEK,
 	ALC269_FIXUP_HEADSET_MODE,
 	ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
@@ -8455,6 +8456,10 @@ static const struct hda_fixup alc269_fixups[] = {
 		.chained = true,
 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
 	},
+	[ALC269_FIXUP_HEADSET_AYA_2] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc269_fixup_headphone_volume,
+	},
 	[ALC269_FIXUP_HEADSET_AYA_GEEK] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc269_fixup_headphone_volume,
@@ -9953,6 +9958,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
 	SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
 	SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
+	SND_PCI_QUIRK(0x1f66, 0x0101, "AYANEO 2", ALC269_FIXUP_HEADSET_AYA_2),
 	SND_PCI_QUIRK(0x1f66, 0x0101, "GEEK", ALC269_FIXUP_HEADSET_AYA_GEEK),
 	SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
 	SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
-- 
2.41.0


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

* Re: [PATCH 2/2] ALSA: hda/realtek: Add headphone quirk for Aya Neo 2
  2023-08-02 15:37 ` [PATCH 2/2] ALSA: hda/realtek: Add headphone quirk for Aya Neo 2 Matthew Anderson
@ 2023-08-02 15:54   ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2023-08-02 15:54 UTC (permalink / raw)
  To: Matthew Anderson; +Cc: tiwai, perex, alsa-devel, linux-kernel

On Wed, 02 Aug 2023 17:37:30 +0200,
Matthew Anderson wrote:
> 
> This fixes the headphones on the Aya Neo 2 handheld.
> Signed-off-by: Matthew Anderson <ruinairas1992@gmail.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 33f9beec8179..5d31cbe5d40b 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -7030,6 +7030,7 @@ enum {
>  	ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
>  	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
>  	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
> +	ALC269_FIXUP_HEADSET_AYA_2,
>  	ALC269_FIXUP_HEADSET_AYA_GEEK,
>  	ALC269_FIXUP_HEADSET_MODE,
>  	ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
> @@ -8455,6 +8456,10 @@ static const struct hda_fixup alc269_fixups[] = {
>  		.chained = true,
>  		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
>  	},
> +	[ALC269_FIXUP_HEADSET_AYA_2] = {
> +		.type = HDA_FIXUP_FUNC,
> +		.v.func = alc269_fixup_headphone_volume,
> +	},
>  	[ALC269_FIXUP_HEADSET_AYA_GEEK] = {
>  		.type = HDA_FIXUP_FUNC,
>  		.v.func = alc269_fixup_headphone_volume,
> @@ -9953,6 +9958,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
>  	SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
>  	SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
>  	SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
> +	SND_PCI_QUIRK(0x1f66, 0x0101, "AYANEO 2", ALC269_FIXUP_HEADSET_AYA_2),
>  	SND_PCI_QUIRK(0x1f66, 0x0101, "GEEK", ALC269_FIXUP_HEADSET_AYA_GEEK),
>  	SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
>  	SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),

Hmm, both devices have the very same SSID (1f66:0101)?  Then it's
superfluous.

And, if you have two devices that require the same quirk but with
different SSIDs, both can use the same ALC269_FIXUP_HEADSET_AYA_GEEK,
instead of defining two.


thanks,

Takashi

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

* Re: [PATCH 1/2] ALSA: hda/realtek: Add headphone quirk for Aya Neo Geek
  2023-08-02 15:37 ` [PATCH 1/2] ALSA: hda/realtek: Add headphone quirk for Aya Neo Geek Matthew Anderson
@ 2023-08-02 15:55   ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2023-08-02 15:55 UTC (permalink / raw)
  To: Matthew Anderson; +Cc: tiwai, perex, alsa-devel, linux-kernel

On Wed, 02 Aug 2023 17:37:29 +0200,
Matthew Anderson wrote:
> 
> This fixes the headphones on the Aya Neo Geek handheld.

It'd be helpful if you describe a bit more about the problem itself.

> Signed-off-by: Matthew Anderson <ruinairas1992@gmail.com>

Please put a blank line before Signed-off-by line.


thanks,

Takashi

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

end of thread, other threads:[~2023-08-02 15:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-02 15:37 [PATCH 0/2] ALSA: hda/realtek: Add headphone quirks for Aya devices Matthew Anderson
2023-08-02 15:37 ` [PATCH 1/2] ALSA: hda/realtek: Add headphone quirk for Aya Neo Geek Matthew Anderson
2023-08-02 15:55   ` Takashi Iwai
2023-08-02 15:37 ` [PATCH 2/2] ALSA: hda/realtek: Add headphone quirk for Aya Neo 2 Matthew Anderson
2023-08-02 15:54   ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox