Received: by 10.213.65.68 with SMTP id h4csp907161imn; Tue, 27 Mar 2018 10:58:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx49B9NJworB4DxTZB+j6t7x/kgNV98ayLwNk4DWGunh58i7x4zDNazPQBGAtj7VP4aTWRK+X X-Received: by 10.101.87.201 with SMTP id q9mr191784pgr.215.1522173526816; Tue, 27 Mar 2018 10:58:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522173526; cv=none; d=google.com; s=arc-20160816; b=tn5qJLUV0MmPb4EJULyiCAE8Jy7YWjnc92C+glvUuIVDR49Zx5zsC/x8KJaVDjeJsN QMp4mdl3tQ9cOebcUeW0ol9OYc+PeRWc92LOaznzLzn7O9A0j4meKxe3Rk4LBEVXfml7 o59raJSzAj/FPSTesEKTYqCDKVQKzJb2EWrvjGGQ53YRe/Jgt7Y+sFEQPPiCBji1rf5Q Vt/EhqJHXmM2pgSmAhGS7RYaPGRMR+7PEhGID45yrbU6PriJ4uEJ8bZHkuRZStTzFvfj 37Eq4nmXYcq70FWk2yqiKSk/JiLGPvdzvQK/B4c2VkRqr8gJ2EpRPj8eWF3PG2V6TH0+ YVKg== 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=CY4utsT3MhyPGuD5XO1oLx4/qHuFXcenA5f1Mi+xwuA=; b=TRjfA9enOig+phD01cX0/rdKTPzgHqRmwfUu/3ji4eaLBEcR3zQX02dLess3cAxNEd WW+pZloOIAqpWuTNSc+stT5uAOpmei8bFp7Fwa4tC9QqsPqcnK+GKg3Rd+yRcFYDg7gE h5QcUQvrjoFFc5Mp4xaUob+2JRLawrS+Ag4tKm9PF4kBV7iUv5WMIh2Ud3QW49MDnBBm f1Uaj+6igcc9AIomsFIOeEZj/jzr70nImZpKJuiKzsrBqbL97U4DQYSbeUbWvzRukTJt PgNbjZ5FhbJt+rsem20CU8K6x9tJfN8/J8jDztW48pDsBdlJgYWxyc0NY+q+Pl1WzqMb cBkA== 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 h132si1188033pgc.308.2018.03.27.10.58.32; Tue, 27 Mar 2018 10:58:46 -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 S1753360AbeC0R5A (ORCPT + 99 others); Tue, 27 Mar 2018 13:57:00 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42752 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753221AbeC0QbA (ORCPT ); Tue, 27 Mar 2018 12:31:00 -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 7FEEFCF9; Tue, 27 Mar 2018 16:30:59 +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.9 06/67] ALSA: hda/realtek - Always immediately update mute LED with pin VREF Date: Tue, 27 Mar 2018 18:26:58 +0200 Message-Id: <20180327162727.022274592@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162726.702411083@linuxfoundation.org> References: <20180327162726.702411083@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.9-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 */