Received: by 10.213.65.68 with SMTP id h4csp910301imn; Tue, 27 Mar 2018 11:02:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+x5wnXUuLhYwpjKr1HJJ95ZgZMQs1WqB7VD2tUy8jQLNbWMneM6tWG7sjmMEsFVI67g4cn X-Received: by 10.101.66.132 with SMTP id j4mr210919pgp.47.1522173722828; Tue, 27 Mar 2018 11:02:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522173722; cv=none; d=google.com; s=arc-20160816; b=VfiGJDSOI0BYi1M9mTdTijv1QWBTwHcSX6qum0yVGciiJS0PvKPD87dEgWYaWjjgWM qjsPMWH+uNAxvDkoCbbOWv79NkPjgSh6qnB8N3CW6oDCueuYFkn10t16+btm0OEJNrHP H0ZxcbswB9ITZzLkoxk+CFwR+IM/nhkpTuO94znQbUDBXJDPdgWWMNrX8uJCmJHgxC+W nETij/3ntKiBFLzPupSduO2egMfauIi5PRANaRNxE40u2PqbynHEUrPzHMF8tVatepSA nflsRuicQUqzBsjPTuVTB9e6UtT9PPCxZIexxnSL4HLb/DP+ZQnDtxDDCQ1ImWhgaoGe Yosw== 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=MnIqDu2qF0+1CoBRPsOGH54r4zhZUUS93rN3sNAGfZ0=; b=ugATPf+tttEFO2Gm472O58b9ei928BGpqGxat5nUKHEMmzjC8Pn0vlz2XfV9ECVaOR PFx0uFW5VoKRjCyRbfx2xwXqty2IymUCDFCMHjfKZNkTfxgAfYMNClmmmMcIP5VBJW3m /ToVup+VnQq3HwcvIEBjJbXFh18fIgVNS29dRI3iNNHMhGI4V1hLcbIqYIONzKFylgoe i17nDe6yTaDMoDHmJf0IZJAOfYrjMOQd+zNJoBJgBw8WDJNPBLk4Jje2e2gpnkf4WqPK HtdUkZng925pMOqzvu1YcxtgUEGcmm4ZDyIRjTD0FJHgV5Lze4eY2ZiDGZOK2XjAXwFB QIBw== 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 1-v6si1743642plj.275.2018.03.27.11.01.48; Tue, 27 Mar 2018 11:02:02 -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 S1753016AbeC0QaQ (ORCPT + 99 others); Tue, 27 Mar 2018 12:30:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41684 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752978AbeC0QaN (ORCPT ); Tue, 27 Mar 2018 12:30:13 -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 D9B161145; Tue, 27 Mar 2018 16:30:12 +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.4 06/43] ALSA: hda/realtek - Always immediately update mute LED with pin VREF Date: Tue, 27 Mar 2018 18:27:10 +0200 Message-Id: <20180327162716.740674905@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162716.407986916@linuxfoundation.org> References: <20180327162716.407986916@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.4-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 @@ -3261,8 +3261,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 */