Received: by 10.213.65.68 with SMTP id h4csp870568imn; Tue, 27 Mar 2018 10:17:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+ksmxzwSFE64A+EurKuPwtCrVJllGmsYYm6Rnzuu6FcwTWp/whgpCdkRrzDw54FnOwJptU X-Received: by 2002:a17:902:604f:: with SMTP id a15-v6mr192580plt.184.1522171035774; Tue, 27 Mar 2018 10:17:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522171035; cv=none; d=google.com; s=arc-20160816; b=iZIsvyTEmPmgnBPiKKKbCf76bsbumBKIiRotEQMwEfIyM2QwgqC788rulx9TBNIkvb PCf+0v6yRRm6HhAd9iHR0P1iSbJ0hzK+rSK30lJTRTNIGPMbRO26kjk4fox0iKHTXuDy LU2eK/C0rvQPkOljN34QwVM0gJCmhqnSZdUxzZpNJ7TdTfUyhHO1V5nNhkQzoDOk1TdI 8h+EDR8B5p8P4gdrO4cj8Tk++zRngUVkTPn977znB1D+rscaGxJ7h2SRn2CqhhuFHEuR i0oyUNeMlKEuO6N68JfkWcdRGaqVXNCib8ydriworzAb0B22KxDbmLpBjA1FqaAQ/g3c 2oUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=4YBAMCxl5/AAxYS+8hv/5smrWIAvKpzC/RHRM6AWEc4=; b=mSkutchzB7fh0VZ/9QKXt82agwEcQ2OL0nkQKwSoAKLJCDR72pfDfA+kJ82Mo17pxi dvJRwM5n2mzEjQGbEz9XCLcHQFaYobI4N5VsfW9HcRQZl9gP+3rYPrSfwFM9ku6U/CQ4 i5NIDbixaM5v2w7ZlkTSvAQBPCmVgmatMYH8k7MRufHxjcxF6CgZGDtBfO0GAsEfyFtA TDKin1NYLteQVJTCmPvYEWQKn+W7FpVNKq+As7t8OA2fMukRgNr9wQ4NnhmfzvYp5cwc GxrTrinuGd2LaVf3HDalio0xcRBgNUeDNomGCeqB13k0ba65Qn8ZSoJatpwBstgDKZ3d N04w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u74si1143838pgc.264.2018.03.27.10.17.01; Tue, 27 Mar 2018 10:17:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755354AbeC0QjD (ORCPT + 99 others); Tue, 27 Mar 2018 12:39:03 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47036 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755307AbeC0Qi7 (ORCPT ); Tue, 27 Mar 2018 12:38:59 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id ACF6B102D; Tue, 27 Mar 2018 16:38:58 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 4.15 015/105] ALSA: hda/realtek - Always immediately update mute LED with pin VREF Date: Tue, 27 Mar 2018 18:26:55 +0200 Message-Id: <20180327162758.487676930@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162757.813009222@linuxfoundation.org> References: <20180327162757.813009222@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Iwai commit e40bdb03d3cd7da66bd0bc1e40cbcfb49351265c upstream. Some HP laptops have a mute mute LED controlled by a pin VREF. The Realtek codec driver updates the VREF via vmaster hook by calling snd_hda_set_pin_ctl_cache(). This works fine as long as the driver is running in a normal mode. However, when the VREF change happens during the codec being in runtime PM suspend, the regmap access will skip and postpone the actual register change. This ends up with the unchanged LED status until the next runtime PM resume even if you change the Master mute switch. (Interestingly, the machine keeps the LED status even after the codec goes into D3 -- but it's another story.) For improving this usability, let the driver temporarily powering up / down only during the pin VREF change. This can be achieved easily by wrapping the call with snd_hda_power_up_pm() / *_down_pm(). Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199073 Cc: 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 @@ -3511,8 +3511,12 @@ static void alc269_fixup_mic_mute_hook(v pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid); pinval &= ~AC_PINCTL_VREFEN; pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80; - if (spec->mute_led_nid) + if (spec->mute_led_nid) { + /* temporarily power up/down for setting VREF */ + snd_hda_power_up_pm(codec); snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval); + snd_hda_power_down_pm(codec); + } } /* Make sure the led works even in runtime suspend */