Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Hridesh MG <hridesh699@gmail.com>
To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	 Jonathan Corbet <corbet@lwn.net>,
	 Stefan Binding <sbinding@opensource.cirrus.com>,
	 Kailang Yang <kailang@realtek.com>,
	 Simon Trimmer <simont@opensource.cirrus.com>,
	 Joshua Grisham <josh@joshuagrisham.com>,
	 Richard Fitzgerald <rf@opensource.cirrus.com>
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-doc@vger.kernel.org, Hridesh MG <hridesh699@gmail.com>
Subject: [PATCH 1/2] ALSA: hda/realtek: Fix headset mic on Acer Nitro 5
Date: Thu, 14 Nov 2024 22:11:19 +0530	[thread overview]
Message-ID: <20241114-alc287-nitro5-v1-1-72e5bf2275c3@gmail.com> (raw)
In-Reply-To: <20241114-alc287-nitro5-v1-0-72e5bf2275c3@gmail.com>

The headset jack on the realtek ALC287 codec for the Acer Nitro 5
AN515-58 laptop requires a fixup to detect microphone input.

The required pin config and verbs were obtained by reverse engineering
the windows driver using RtHD dump.

Signed-off-by: Hridesh MG <hridesh699@gmail.com>
---
 sound/pci/hda/patch_realtek.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 571fa8a6c9e1204892a93ffb24acce65400ce4b2..0204ed80791db87153dad80d6a25466985ce5784 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -7780,6 +7780,8 @@ enum {
 	ALC287_FIXUP_LENOVO_SSID_17AA3820,
 	ALC245_FIXUP_CLEVO_NOISY_MIC,
 	ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE,
+	ALC_287_FIXUP_ACER_NITRO_HEADSET_MIC_PIN,
+	ALC_287_FIXUP_ACER_NITRO_HEADSET_MIC_VERBS,
 };
 
 /* A special fixup for Lenovo C940 and Yoga Duet 7;
@@ -10154,6 +10156,23 @@ static const struct hda_fixup alc269_fixups[] = {
 		.chained = true,
 		.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
 	},
+	[ALC_287_FIXUP_ACER_NITRO_HEADSET_MIC_PIN] = {
+		.type = HDA_FIXUP_PINS,
+		.chained = true,
+		.chain_id = ALC_287_FIXUP_ACER_NITRO_HEADSET_MIC_VERBS,
+		.v.pins = (const struct hda_pintbl[]) {
+			{ 0x19, 0x03a19020 }, /* missing pin for headphone jack mic */
+			{ }
+		}
+	},
+	[ALC_287_FIXUP_ACER_NITRO_HEADSET_MIC_VERBS] = {
+		.type = HDA_FIXUP_VERBS,
+		.v.verbs = (const struct hda_verb[]) {
+			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
+			{ 0x20, AC_VERB_SET_PROC_COEF, 0xD689 },
+			{ }
+		}
+	}
 };
 
 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -10201,6 +10220,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
 	SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
 	SND_PCI_QUIRK(0x1025, 0x169a, "Acer Swift SFG16", ALC256_FIXUP_ACER_SFG16_MICMUTE_LED),
+	SND_PCI_QUIRK(0x1025, 0x159c, "Acer Nitro 5 AN515-58", ALC_287_FIXUP_ACER_NITRO_HEADSET_MIC_PIN),
 	SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
 	SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
 	SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
@@ -11217,6 +11237,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
 	{.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
 	{.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
 	{.id = ALC236_FIXUP_LENOVO_INV_DMIC, .name = "alc236-fixup-lenovo-inv-mic"},
+	{.id = ALC_287_FIXUP_ACER_NITRO_HEADSET_MIC_PIN, .name = "alc287-fixup-acer-nitro-headset-mic"},
 	{}
 };
 #define ALC225_STANDARD_PINS \

-- 
2.47.0


  reply	other threads:[~2024-11-14 16:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-14 16:41 [PATCH 0/2] Fix headset mic on Acer Nitro 5 Hridesh MG
2024-11-14 16:41 ` Hridesh MG [this message]
2024-11-17 13:45   ` [PATCH 1/2] ALSA: hda/realtek: " Takashi Iwai
2024-11-17 20:24     ` Hridesh MG
2024-11-18 13:52       ` Takashi Iwai
2024-11-20 17:32         ` Hridesh MG
2024-11-30 18:58           ` Hridesh MG
2024-12-01  8:26             ` Takashi Iwai
2024-12-05  2:46               ` Kailang
2024-12-05 17:22                 ` Hridesh MG
2024-11-14 16:41 ` [PATCH 2/2] docs: sound: Add a new hd-audio fixup model Hridesh MG

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241114-alc287-nitro5-v1-1-72e5bf2275c3@gmail.com \
    --to=hridesh699@gmail.com \
    --cc=corbet@lwn.net \
    --cc=josh@joshuagrisham.com \
    --cc=kailang@realtek.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=rf@opensource.cirrus.com \
    --cc=sbinding@opensource.cirrus.com \
    --cc=simont@opensource.cirrus.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox