From patchwork Mon Feb 24 09:52:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 3708031 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 92244BF13A for ; Mon, 24 Feb 2014 09:54:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C7B252015A for ; Mon, 24 Feb 2014 09:54:41 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id C99A620149 for ; Mon, 24 Feb 2014 09:54:40 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id AA7992652BF; Mon, 24 Feb 2014 10:54:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 7D95A2654AC; Mon, 24 Feb 2014 10:53:39 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id A6EB92654AC; Mon, 24 Feb 2014 10:53:38 +0100 (CET) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 440A9265327 for ; Mon, 24 Feb 2014 10:52:41 +0100 (CET) Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1A017ACA0 for ; Mon, 24 Feb 2014 09:52:41 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Mon, 24 Feb 2014 10:52:41 +0100 Message-Id: <1393235561-15733-1-git-send-email-tiwai@suse.de> X-Mailer: git-send-email 1.8.5.2 Subject: [alsa-devel] [PATCH] ALSA: hda - Avoid codec D3 for keeping mute LED up on Lenovo Yxx0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The GPIO line used for the mute LED control on Lenovo Yxx0 laptops is cleared unexpectedly when the codec goes to D3, typically by power-saving. For avoiding it, add a power filter in the fixup. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=16373 Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 3829cb5ebc2b..817a52efe750 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -4832,6 +4832,17 @@ static void alc662_led_gpio1_mute_hook(void *private_data, int enabled) spec->gpio_led); } +/* avoid D3 for keeping GPIO up */ +static unsigned int gpio_led_power_filter(struct hda_codec *codec, + hda_nid_t nid, + unsigned int power_state) +{ + struct alc_spec *spec = codec->spec; + if (nid == codec->afg && power_state == AC_PWRST_D3 && spec->gpio_led) + return AC_PWRST_D0; + return power_state; +} + static void alc662_fixup_led_gpio1(struct hda_codec *codec, const struct hda_fixup *fix, int action) {