Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7878143rwb; Tue, 6 Dec 2022 10:59:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf6mEYiG0XRqNU51rx6DLVjcEs695J4sYOY+oZwK++mf15c3qwB/ONVM/FVTsxWUcrD52KDc X-Received: by 2002:a17:906:a242:b0:7c0:8889:92b with SMTP id bi2-20020a170906a24200b007c08889092bmr28208880ejb.439.1670353172113; Tue, 06 Dec 2022 10:59:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670353172; cv=none; d=google.com; s=arc-20160816; b=Lt7bmZ9+wsVig3HcAq1RUIvJCA9VuvnoDhezS46JheA/U8OLEZM5XeBQj4rGsdSE6R dcW5Febflm2JHdD+264KaFm33NYuyk1TIqsErPAw3O5eIOjmbfDPDQWmJI0JyA13DlP3 fkaZfLc4FWedc4Zs7jOFLoflp/GLqBezuJvD+tOU9OSwAGe+euAzWocjQ+ODAmN5JrOV HAbrwS9rFXbJEnJ3WFRq5YOvA/Vf7BbFKA4Auy5MQxnBIQ7wBdEJSgU2rXfyzKeyJrIt LzHjhoc8epL2FO3diJwCxvbcl0hGBZiM5uUQaAGwrdfqcd1JhUDjD+782cU6q4R3oKnR jNGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=T+en6e3AXE3m/+a/1SsKJ6NeYBJ+M/f4BlVdIYx79zE=; b=zP1V+8YCV2+8hFgH4fy6M901ApV9BzB4SCDxLHoxMsVuiXvgvvyLMTjRSaIS19xnin mj+s2CvaLFKf6w1xDGE4hx8KEIqaGABkhpuoP14x0xjgz91G0t3IsjQs5yjdyW87e9nr f53XuEHDCVehTg3QX5k0L/vSMv/Dy35FfiOgK1PIqpguQebpkAqq6DDTAA8nS1i4tbin CIBzfOIQy0oxnCU3PzOzRldJvCpYkpoE0SVVT+sYqV8EKLfnacCD8rd66+bye5vJlEI4 ly8qR2A6EqKUGDbcqyZKxQ+hgyZeP6CtstyD1FhW3r2ZL509HAjiEO7pWeMGa5NhYGFU y9Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@edward-p.xyz header.s=default header.b=ndbeQvwn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=edward-p.xyz Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz31-20020a1709077d9f00b007c01839ded7si15640729ejc.993.2022.12.06.10.59.13; Tue, 06 Dec 2022 10:59:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@edward-p.xyz header.s=default header.b=ndbeQvwn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=edward-p.xyz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229573AbiLFSja (ORCPT + 77 others); 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: 8bit X-Spam-Status: No, score=2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, FROM_SUSPICIOUS_NTLD_FP,RDNS_NONE,SPF_HELO_SOFTFAIL,SPF_SOFTFAIL, T_PDS_OTHER_BAD_TLD autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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=216756 --- 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, } } +static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec, + const struct hda_fixup *fix, int action) +{ + struct alc_spec *spec = codec->spec; + + if (action == HDA_FIXUP_ACT_PRE_PROBE) { + spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; + spec->gen.hp_automute_hook = alc897_hp_automute_hook; + } +} + 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), @@ -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, }; static const struct hda_fixup alc662_fixups[] = { @@ -11469,6 +11482,19 @@ static const struct hda_fixup alc662_fixups[] = { { } }, }, + [ALC897_FIXUP_LENOVO_HEADSET_MODE] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc897_fixup_lenovo_headset_mode, + }, + [ALC897_FIXUP_HEADSET_MIC_PIN2] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl[]) { + { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */ + { } + }, + .chained = true, + .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE + }, }; static const struct snd_pci_quirk alc662_fixup_tbl[] = { @@ -11521,6 +11547,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN), SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN), SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN), + SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2), SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), -- 2.38.1