Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1568577pxp; Thu, 10 Mar 2022 07:58:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/NvJCb2YpUWbpOethLGeAhhcXJsiJwwwVbviaERR36R8SAfJThh7eYlNKtKiglUFJy/oU X-Received: by 2002:a05:6402:5173:b0:415:f1e2:8d53 with SMTP id d19-20020a056402517300b00415f1e28d53mr4991199ede.95.1646927914111; Thu, 10 Mar 2022 07:58:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646927914; cv=none; d=google.com; s=arc-20160816; b=aE63pp8xd2/kwQXfG2b8XUYQTuHfQ8W6I3idT1em+lFHKFgynas7yKNUIgAkIyV4VW 7PEIzbswhB8tkIJlOa1t1gbhBAhkf1ovLPyq8fmjACWgg+B6O+1b8uUlESV8GGxz+0ox U499DLWMa8wPGjjh697pMoHPho+kiB9atst4TnUaCP3rojqno2YKcgRzMelkkB+bslpl yjnpxrVRM299RnOGuvUJkgAgmFDC1otg8gdvK1ZRGMOTlHr4MytmqYTScskS3lMd3sSO /I6xpdkVm4/JcVHFnps9RDMGZUjkrYz1avJDJkav0Lv/JeCQiRn1oSAWFYKCXjNzNl9Y ASkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=phNhWcxa30s+5PT279RDMe7kHIWzM/00vU3/LZOBHFQ=; b=zUwBAFcggcqs0+vxaSW6ee+aWTdEcYz2UaAFne0QL74u9Cb8DYxb/7IRooZLPD0ZUG bb7c3s5pE2v1bNGKqsr5LugeDoA7xQFTWg3tbHAQApRL9MWAQ4wK9eauBjVVidqbEJ5Z gYeWph/5ZGY4jI6+QjHxSzc2VFUXZaC3QsvxACeOAcnphJyaUUVlsl2KZQlzL6b3Rq7V AS0gSkYm6ez+0cZ6umDJwSigE1AUY6KTPCKEYo0HwqW/0PCmYUFKnLhhKwR3aC7ZPBEt NAmz0no4VlhyTrt1w5DKAXrexVRCFRIO7hQgfusgIgfuZpQOSyP/0wIBEdV7sniUMJ0q 4gLQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w17-20020a056402269100b004169f716df4si3119786edd.568.2022.03.10.07.58.11; Thu, 10 Mar 2022 07:58:34 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242258AbiCJNE3 (ORCPT + 99 others); Thu, 10 Mar 2022 08:04:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232078AbiCJNE1 (ORCPT ); Thu, 10 Mar 2022 08:04:27 -0500 Received: from smtpbguseast3.qq.com (smtpbguseast3.qq.com [54.243.244.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 279E0C791D for ; Thu, 10 Mar 2022 05:03:23 -0800 (PST) X-QQ-mid: bizesmtp78t1646917384tdsqalkf Received: from localhost.localdomain ( [113.57.152.160]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 10 Mar 2022 21:03:03 +0800 (CST) X-QQ-SSF: 01400000002000B0C000B00A0000000 X-QQ-FEAT: hAQ2xUxVESwZEQadtxikZbscZLrGOFgmNn+CeTtX4AR5qtfkmOVoFOHtsHJad G3G4uvIAGBdITa72ZM2D/poSJOHwAy34zaXbnYquS5owIxyXuhOkenVy/NNKnVOQY9LEHdr A47rhkY13bprr5ZopJn/Qs0h/sW6tGH8FhY6jYIRavc+YVEWqCn3M23PDLTqE6YoI4HlR6D p3XoavG5oiFwI6BMHp0fcG9T2kEXatWgBOrisD/1sfUz5NSO2tU6561qBlixpsY087HuOEI q/uLWO1zBM0js8+I2mDODwA9C+H6Z6VRoxwRRoYjGF68Yq14+lMOJG+LbQIJPTA8Xa204AG sxaWAL0 X-QQ-GoodBg: 2 From: huangwenhui To: perex@perex.cz, tiwai@suse.com Cc: jeremy.szu@canonical.com, hui.wang@canonical.com, wse@tuxedocomputers.com, cam@neo-zeon.de, kailang@realtek.com, tanureal@opensource.cirrus.com, sami@loone.fi, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, huangwenhui Subject: [PATCH] ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671 Date: Thu, 10 Mar 2022 21:03:01 +0800 Message-Id: <20220310130301.22827-1-huangwenhuia@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign2 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On a HP 288 Pro G8, the front Mic could not be detected. Signed-off-by: huangwenhui --- sound/pci/hda/patch_realtek.c | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 3a42457984e9..bcd56cdc07af 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -10519,6 +10519,37 @@ static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec, } } +static void alc671_fixup_hp288_headset_mic2(struct hda_codec *codec, + const struct hda_fixup *fix, int action) +{ + struct alc_spec *spec = codec->spec; + hda_nid_t hp_pin = alc_get_hp_pin(spec); + + static const struct hda_pintbl pincfgs[] = { + { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */ + { 0x1b, 0x0181304f }, + { } + }; + + if (!hp_pin) + hp_pin = 0x21; + + switch (action) { + case HDA_FIXUP_ACT_PRE_PROBE: + spec->gen.mixer_nid = 0; + spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; + snd_hda_apply_pincfgs(codec, pincfgs); + break; + case HDA_FIXUP_ACT_INIT: + alc_write_coef_idx(codec, 0x19, 0xa054); + msleep(80); + snd_hda_codec_write(codec, hp_pin, 0, + AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); + msleep(100); + break; + } +} + static void alc897_hp_automute_hook(struct hda_codec *codec, struct hda_jack_callback *jack) { @@ -10615,6 +10646,7 @@ enum { ALC669_FIXUP_ACER_ASPIRE_ETHOS, ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET, ALC671_FIXUP_HP_HEADSET_MIC2, + ALC671_FIXUP_HP288_HEADSET_MIC2, ALC662_FIXUP_ACER_X2660G_HEADSET_MODE, ALC662_FIXUP_ACER_NITRO_HEADSET_MODE, ALC668_FIXUP_ASUS_NO_HEADSET_MIC, @@ -10986,6 +11018,10 @@ static const struct hda_fixup alc662_fixups[] = { .type = HDA_FIXUP_FUNC, .v.func = alc671_fixup_hp_headset_mic2, }, + [ALC671_FIXUP_HP288_HEADSET_MIC2] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc671_fixup_hp288_headset_mic2, + }, [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = { .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl[]) { @@ -11067,6 +11103,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2), + SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP288_HEADSET_MIC2), SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE), SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50), SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50), -- 2.20.1