From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B987DC433DF for ; Tue, 23 Jun 2020 10:12:52 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3E7DD206D4 for ; Tue, 23 Jun 2020 10:12:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="VIjfPSzQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E7DD206D4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CD73C172B; Tue, 23 Jun 2020 12:12:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CD73C172B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592907170; bh=zEpQg7pV0j7ttcq6i249CBmrWyhwt5EXKxQN9sDU19o=; h=Date:From:To:Subject:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VIjfPSzQ1WT8tDH/hJw+FAppGo1mjEz5TyzBkRmwQ69W8wFt7uXvrKukyHeoMlBvT Lpzje/JRZXa5+cS/Xy0pHSFfcXkoM22TUbqliyyBhI5rA3GGATgs+4Rhtt7C13lv4b wqVMxfAkq7Vq69udbDKkftpSbX3dHwfVvMfmTjhI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 60707F80218; Tue, 23 Jun 2020 12:12:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 16B05F80234; Tue, 23 Jun 2020 12:11:59 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 46808F8010E for ; Tue, 23 Jun 2020 12:11:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 46808F8010E X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A6F74AE33 for ; Tue, 23 Jun 2020 10:11:51 +0000 (UTC) Date: Tue, 23 Jun 2020 12:11:52 +0200 Message-ID: From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: Re: [PATCH] ALSA: hda/conexant: Fix missing headphone node after reboot from Windows In-Reply-To: <20200623062510.27499-1-tiwai@suse.de> References: <20200623062510.27499-1-tiwai@suse.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Tue, 23 Jun 2020 08:25:10 +0200, Takashi Iwai wrote: > > When Lenovo Thinkpad E495 is rebooted from Windows, the headphone > control is lost. This seems because BIOS doesn't initialize the > headphone node (NID 0x16) properly after the reboot from Windows, as > Windows likely turns off the power at its exit. The node is left > as a vendor-specific unknown node and ignored by the HD-audio parser. > > This patch forcibly initializes the node at the probe time, by > overriding the widget caps and the connection list, so that the > headphone control is detected always at probe time. > > BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207741 > Cc: > Signed-off-by: Takashi Iwai This turned out to be not effective, the audio stream itself doesn't work as expected. thanks, Takashi > --- > sound/pci/hda/patch_conexant.c | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c > index 396b5503038a..37c8add48791 100644 > --- a/sound/pci/hda/patch_conexant.c > +++ b/sound/pci/hda/patch_conexant.c > @@ -215,6 +215,7 @@ enum { > CXT_FIXUP_MUTE_LED_GPIO, > CXT_FIXUP_HEADSET_MIC, > CXT_FIXUP_HP_MIC_NO_PRESENCE, > + CXT_FIXUP_THINKPAD_E495, > }; > > /* for hda_fixup_thinkpad_acpi() */ > @@ -673,6 +674,22 @@ static void cxt_fixup_mute_led_gpio(struct hda_codec *codec, > spec->gpio_led); > } > > +static void cxt_fixup_thinkpad_e495(struct hda_codec *codec, > + const struct hda_fixup *fix, > + int action) > +{ > + if (action == HDA_FIXUP_ACT_PRE_PROBE) { > + static const hda_nid_t conns[] = { 0x10, 0x11 }; > + /* BIOS invalidates the headphone pin NID 0x16 when rebooted > + * after Windows by some reason; > + * forcibly restoring the whole setup > + */ > + snd_hda_override_wcaps(codec, 0x16, 0x400581); > + snd_hda_codec_set_pincfg(codec, 0x16, 0x03211040); > + snd_hda_override_conn_list(codec, 0x16, ARRAY_SIZE(conns), > + conns); > + } > +} > > /* ThinkPad X200 & co with cxt5051 */ > static const struct hda_pintbl cxt_pincfg_lenovo_x200[] = { > @@ -846,6 +863,12 @@ static const struct hda_fixup cxt_fixups[] = { > .chained = true, > .chain_id = CXT_FIXUP_HEADSET_MIC, > }, > + [CXT_FIXUP_THINKPAD_E495] = { > + .type = HDA_FIXUP_FUNC, > + .v.func = cxt_fixup_thinkpad_e495, > + .chained = true, > + .chain_id = CXT_FIXUP_THINKPAD_ACPI, > + }, > }; > > static const struct snd_pci_quirk cxt5045_fixups[] = { > @@ -932,6 +955,7 @@ static const struct snd_pci_quirk cxt5066_fixups[] = { > SND_PCI_QUIRK(0x17aa, 0x3977, "Lenovo IdeaPad U310", CXT_FIXUP_STEREO_DMIC), > SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo G50-70", CXT_FIXUP_STEREO_DMIC), > SND_PCI_QUIRK(0x17aa, 0x397b, "Lenovo S205", CXT_FIXUP_STEREO_DMIC), > + SND_PCI_QUIRK(0x17aa, 0x5124, "Lenovo Thinkpad E495", CXT_FIXUP_THINKPAD_E495), > SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", CXT_FIXUP_THINKPAD_ACPI), > SND_PCI_QUIRK(0x1c06, 0x2011, "Lemote A1004", CXT_PINCFG_LEMOTE_A1004), > SND_PCI_QUIRK(0x1c06, 0x2012, "Lemote A1205", CXT_PINCFG_LEMOTE_A1205), > -- > 2.16.4 >