From nobody Thu Sep 18 11:46:55 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5F7BC352A1 for ; Tue, 6 Dec 2022 18:39:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229619AbiLFSja (ORCPT ); Tue, 6 Dec 2022 13:39:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbiLFSj2 (ORCPT ); Tue, 6 Dec 2022 13:39:28 -0500 X-Greylist: delayed 1964 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 06 Dec 2022 10:39:27 PST Received: from mail.edward-p.xyz (unknown [IPv6:2403:ac80:cc:7::13f:adc5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4627D30550 for ; Tue, 6 Dec 2022 10:39:26 -0800 (PST) DKIM-Signature: a=rsa-sha256; bh=T+en6e3AXE3m/+a/1SsKJ6NeYBJ+M/f4BlVdIYx79zE=; c=relaxed/relaxed; d=edward-p.xyz; h=Subject:Subject:Sender:To:To:Cc:Cc:From:From:Date:Date:MIME-Version:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Reply-To:In-Reply-To:Message-Id:Message-Id:References:Autocrypt:Openpgp; i=@edward-p.xyz; s=default; t=1670349916; v=1; x=1670781916; b=ndbeQvwnsDAhdzCWhwNUER4mARyMBxiCwfnnRQprNcrBoyovwnQVkJnhne5rucfE7tUosjr/ 7YWvjF0fBzxtlk3YK9+wNjb3SvjRjDk+7h+yc8VecceIWYT1JO9jLHOQFrgNulhyyrg6BGBCQbI T8dHv5S98lGnlAO0hhdkCaYjcjt8QPB9sNO9sbC7wXZCGp19AhGgFh+Ga8nThZhoiGnHz8ua7ne eACrA+Enst4+49GCRTaylQT5x31Zo/olmZVXgnEVEwRloenEVIFSHUnDFcVgRvC6rRLAAcgaQVb mhO/eeNidPSDXle1XfhzSlxB1FtP/lr+zVcQbHezK0zQA== Received: by mail.edward-p.xyz (envelope-sender ) with ESMTPS id 62a3ecde; Wed, 07 Dec 2022 02:05:16 +0800 From: edward-p Cc: edward-p , Jaroslav Kysela , Takashi Iwai , Stefan Binding , Tim Crawford , Meng Tang , Kai-Heng Feng , Lucas Tanure , Philipp Jungkamp , Kailang Yang , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] ALSA: hda/realtek: Add quirk for Lenovo TianYi510Pro-14IOB Date: Wed, 7 Dec 2022 02:04:58 +0800 Message-Id: <20221206180459.44260-1-edward@edward-p.xyz> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Lenovo TianYi510Pro-14IOB (17aa:3742) require quirk for enabling headset-mic Signed-off-by: edward-p Link: https://bugzilla.kernel.org/show_bug.cgi?id=3D216756 --- sound/pci/hda/patch_realtek.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index e5c036385666..a2e1bdc06468 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -10960,6 +10960,17 @@ static void alc897_fixup_lenovo_headset_mic(struct= hda_codec *codec, } } =20 +static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec, + const struct hda_fixup *fix, int action) +{ + struct alc_spec *spec =3D codec->spec; + + if (action =3D=3D HDA_FIXUP_ACT_PRE_PROBE) { + spec->parse_flags |=3D HDA_PINCFG_HEADSET_MIC; + spec->gen.hp_automute_hook =3D alc897_hp_automute_hook; + } +} + static const struct coef_fw alc668_coefs[] =3D { WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0= x0), WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f= 80), @@ -11043,6 +11054,8 @@ enum { ALC897_FIXUP_LENOVO_HEADSET_MIC, ALC897_FIXUP_HEADSET_MIC_PIN, ALC897_FIXUP_HP_HSMIC_VERB, + ALC897_FIXUP_LENOVO_HEADSET_MODE, + ALC897_FIXUP_HEADSET_MIC_PIN2, }; =20 static const struct hda_fixup alc662_fixups[] =3D { @@ -11469,6 +11482,19 @@ static const struct hda_fixup alc662_fixups[] =3D { { } }, }, + [ALC897_FIXUP_LENOVO_HEADSET_MODE] =3D { + .type =3D HDA_FIXUP_FUNC, + .v.func =3D alc897_fixup_lenovo_headset_mode, + }, + [ALC897_FIXUP_HEADSET_MIC_PIN2] =3D { + .type =3D HDA_FIXUP_PINS, + .v.pins =3D (const struct hda_pintbl[]) { + { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detec= t */ + { } + }, + .chained =3D true, + .chain_id =3D ALC897_FIXUP_LENOVO_HEADSET_MODE + }, }; =20 static const struct snd_pci_quirk alc662_fixup_tbl[] =3D { @@ -11521,6 +11547,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[= ] =3D { SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEAD= SET_MIC_PIN), SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEA= DSET_MIC_PIN), SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEAD= SET_MIC_PIN), + SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_H= EADSET_MIC_PIN2), SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPA= D), SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD= ), SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), --=20 2.38.1