Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2465515pxj; Mon, 10 May 2021 03:45:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0lPwjnEcLugy8fNPhZzDJxigNKUelLU/cPJhQ1KcWeNlEqkzqr/tXB/BytSHSgqw4oYhp X-Received: by 2002:a05:6402:2750:: with SMTP id z16mr29300692edd.355.1620643559221; Mon, 10 May 2021 03:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620643559; cv=none; d=google.com; s=arc-20160816; b=dLnUf1WOWNu3PVvRs7UZlhH/d138OyNakrhcTPf3DKx7y16i17XOrw3LnovbWf1EHM YWIGbFDtN9FgkW5LjbyaUd2zzkA5CjBqUPMrLiOA9q5cV2sSMHShP9go3RCZrfMbLxG/ gcv+uWBGJZc/rH04ncNvkqu4R4YnsBbKrxC6EVnaybbxTS5s+kPbLWQLssobNYmsRGTJ 5oYnWOL7fzpBPqtgzcGVxZw8F4A4icl/TmLp6GpSm51JjvETlWgG5wS7QUXZzZI1va/e 7mlBacbLIs7vn+G59wxNlKRwLQCJMKypwWhvzCo/SYe5EvWS/1nb0hMP8FWGqOIsa+C0 EMsg== 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=PQpuY3lI0eVjVEZ0+8FvmQCCl0pFctLVMQMZ+OL7Vlc=; b=0weQKtXZfiTChbdwSgd4jxM+vfT53MPqiS5TEy07Qw2/vlIY5+QWJoAtpn08Q4UQ+K oBlk3McgacYLPrxUB4VqZHd+hFu+2YCZh9C/77HvNGT5eJJ5GgbQbXTSGmPt0VSOaKok Fg2YKljobLeMHtxV6FfKrGLOKaVWnEhPwyk4xFjERv3yiDyPb+/t1d8BLKzXFf/csUCV ggr7BfL5Jk5L5RO4UrkkAGDYFH0cbrfgW5Pj8DyH5pPy/Jxq+pPFoRR5RxUhVWP+KqIW iKF5eSjDSo+YwqbJJEQka19DvFeo/7RBNsPkw6PUcKvalb3Vvuw2OHtnNqCKdVuVOzaR SO0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CUrM23RW; 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=pass (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 h3si10768634ejy.308.2021.05.10.03.45.34; Mon, 10 May 2021 03:45:59 -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=@linuxfoundation.org header.s=korg header.b=CUrM23RW; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232830AbhEJKok (ORCPT + 99 others); Mon, 10 May 2021 06:44:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:40080 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231989AbhEJKfg (ORCPT ); Mon, 10 May 2021 06:35:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0F81B6144E; Mon, 10 May 2021 10:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642528; bh=DCHY9BwtrB1rxiIe8oM3OsBDQMo8xeEFLzJ/0d9rmWg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CUrM23RWnxjTtSVPfg10t9YGDfqRRXSFWK/L6qD/6A623KG8xe98uLHv8IW42/wpB a+hF7fYkz8HRHgteOovsyBeKlTnMsCnFJj7UmcBSvyCTRzVTFkVzCamKZ88tWw/X7q iQUiLokV8XdEIvm5wEww7uXxbXAivC1nh57GU3MU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Phil Calvin , Takashi Iwai Subject: [PATCH 5.4 132/184] ALSA: hda/realtek: fix mic boost on Intel NUC 8 Date: Mon, 10 May 2021 12:20:26 +0200 Message-Id: <20210510101954.490276309@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510101950.200777181@linuxfoundation.org> References: <20210510101950.200777181@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: Phil Calvin commit d1ee66c5d3c5a0498dd5e3f2af5b8c219a98bba5 upstream. Fix two bugs with the Intel HDA Realtek ALC233 sound codec present in Intel NUC NUC8i7BEH and probably a few other similar NUC models. These codecs advertise a 4-level microphone input boost amplifier on pin 0x19, but the highest two boost settings do not work correctly, and produce only low analog noise that does not seem to contain any discernible signal. There is an existing fixup for this exact problem but for a different PCI subsystem ID, so we re-use that logic. Changing the boost level also triggers a DC spike in the input signal that bleeds off over about a second and overwhelms any input during that time. Thankfully, the existing fixup has the side effect of making the boost control show up in userspace as a mute/unmute switch, and this keeps (e.g.) PulseAudio from fiddling with it during normal input volume adjustments. Finally, the NUC hardware has built-in inverted stereo mics. This patch also enables the usual fixup for this so the two channels cancel noise instead of the actual signal. [ Re-ordered the quirk entry point by tiwai ] Signed-off-by: Phil Calvin Cc: Link: https://lore.kernel.org/r/80dc5663-7734-e7e5-25ef-15b5df24511a@philcalvin.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/patch_realtek.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -6332,6 +6332,8 @@ enum { ALC269_FIXUP_LEMOTE_A1802, ALC269_FIXUP_LEMOTE_A190X, ALC256_FIXUP_INTEL_NUC8_RUGGED, + ALC233_FIXUP_INTEL_NUC8_DMIC, + ALC233_FIXUP_INTEL_NUC8_BOOST, ALC256_FIXUP_INTEL_NUC10, ALC255_FIXUP_XIAOMI_HEADSET_MIC, ALC274_FIXUP_HP_MIC, @@ -7043,6 +7045,16 @@ static const struct hda_fixup alc269_fix .type = HDA_FIXUP_FUNC, .v.func = alc233_fixup_lenovo_line2_mic_hotkey, }, + [ALC233_FIXUP_INTEL_NUC8_DMIC] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc_fixup_inv_dmic, + .chained = true, + .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST, + }, + [ALC233_FIXUP_INTEL_NUC8_BOOST] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc269_fixup_limit_int_mic_boost + }, [ALC255_FIXUP_DELL_SPK_NOISE] = { .type = HDA_FIXUP_FUNC, .v.func = alc_fixup_disable_aamix, @@ -8125,6 +8137,7 @@ static const struct snd_pci_quirk alc269 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE), SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), + SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC), SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED), SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),