Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3758918pxk; Tue, 29 Sep 2020 05:41:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3A8QejZ4k0+RcepJw849wCFkXapZcCYxw1RMAHv7bx1LZfonUWV+gG138+LdVLjSrw5Bw X-Received: by 2002:a17:906:1dd0:: with SMTP id v16mr3573416ejh.309.1601383308818; Tue, 29 Sep 2020 05:41:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601383308; cv=none; d=google.com; s=arc-20160816; b=KiuOcTTBdFruOFBQqz4ZNhA7nxy4BiPoD+iTmzUMKPDac7snrK3dtuoQsTIzpaZuR4 CZGtejtAu4S3ydrgnQkg5NFn0yohHUkKV0mpm5DVr+SmQPV4+hchn6xnpENNu7R4qzzU lcyX5DjJzTEN44zVHcvDNVylBmUhYTiVU9oiZTgvpv16DyJOx9qvbJuVFPpStonnKD9n 4SQWHmwP0gvLxbL/a+NGdIC1HtcZFprzW0ArOUbiQwWP/gaZlbHaEMRBuJ7dIq2Yy1P6 vUf4NzypuVDqNTr5fNBTdIVrjGhY01f+EWFCQ5YRVk+y2AwVIfJ5GKNIgdCc4xnCt6Nj flgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0uuZ5CP3206Q/0kaB2thnCS9yn4GybyR2oJHKCRKSKA=; b=Jqj4F+lCQwzhY9DFibE6DPPFn3XTf5NNDZdQav/HH8GmoGbxFtQvhX7b0wSgZBEeOO 1FjaNQECOhUtGpTiVzqOBFwAzDkmD55bFUsT1RyYgxerasysjbHBUlqNAgZhpa9lVZ7G LsuvurOvXM0ZOZz4cw7gKe4/zVWcupeo0DiM2SsJWOgKWwmawKMhrcmv0y6V4w6mmwI4 ch9NqzkDethMxRRuWdLJdpkVQRWdjZcKaCBQ73BWVpw9afYUlpxmxTgSedSs3j9Bqo2T 4+tOfTmYUUcqurn/GhQRsQrznzpMYZPYGWF7t3UwO5DCY4o8R4CZ8gWzrQE95Cg/O2j6 LZaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZwIae0jd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l27si2716894eja.9.2020.09.29.05.41.25; Tue, 29 Sep 2020 05:41:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZwIae0jd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729512AbgI2Mkc (ORCPT + 99 others); Tue, 29 Sep 2020 08:40:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:58836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729248AbgI2LOu (ORCPT ); Tue, 29 Sep 2020 07:14:50 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7A63B20848; Tue, 29 Sep 2020 11:14:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601378090; bh=ZAE7QSARf1WPP7/bAdPuERVxfF2+6yJ1LQxVf2+g+40=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZwIae0jdNBRh7j6ft2acevEAWsHR4dZu0wctUpG2/k4SEqv4/jYRDV9MRfH5d4VJ5 lWJvzSeFQAM82vYO/6ICsckjxNGJZwpTxwQBZlFLnEG2zgSvnT8dy5uCEGxVhytf7U 0BY3mqb3ShtwFLoVYs0EEMTRAw0sX5cl95N2rgT8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kailang Yang , Hui Wang , Takashi Iwai Subject: [PATCH 4.14 027/166] ALSA: hda/realtek - Couldnt detect Mic if booting with headset plugged Date: Tue, 29 Sep 2020 12:58:59 +0200 Message-Id: <20200929105936.557926254@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105935.184737111@linuxfoundation.org> References: <20200929105935.184737111@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hui Wang commit 3f74249057827c5f6676c41c18f6be12ce1469ce upstream. We found a Mic detection issue on many Lenovo laptops, those laptops belong to differnt models and they have different audio design like internal mic connects to the codec or PCH, they all have this problem, the problem is if plugging a headset before powerup/reboot the machine, after booting up, the headphone could be detected but Mic couldn't. If we plug out and plug in the headset, both headphone and Mic could be detected then. Through debugging we found the codec on those laptops are same, it is alc257, and if we don't disable the 3k pulldown in alc256_shutup(), the issue will be fixed. So far there is no pop noise or power consumption regression on those laptops after this change. Cc: Kailang Yang Cc: Signed-off-by: Hui Wang Link: https://lore.kernel.org/r/20200914065118.19238-1-hui.wang@canonical.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/patch_realtek.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -3154,7 +3154,11 @@ static void alc256_shutup(struct hda_cod /* 3k pull low control for Headset jack. */ /* NOTE: call this before clearing the pin, otherwise codec stalls */ - alc_update_coef_idx(codec, 0x46, 0, 3 << 12); + /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly + * when booting with headset plugged. So skip setting it for the codec alc257 + */ + if (codec->core.vendor_id != 0x10ec0257) + alc_update_coef_idx(codec, 0x46, 0, 3 << 12); snd_hda_codec_write(codec, hp_pin, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);