Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2400564imu; Thu, 24 Jan 2019 12:07:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN6otJ61sHbw1m0zaOYsWUDfe3iRmPzTIdgYjahQScbwODVp34tVvTcJukLkwJ+1zHe9qxXV X-Received: by 2002:a17:902:e20b:: with SMTP id ce11mr7665481plb.251.1548360428548; Thu, 24 Jan 2019 12:07:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548360428; cv=none; d=google.com; s=arc-20160816; b=ZWCAaHm2qEflwuvMdPAbtlzGxYTf7495fS17tQSEeE/fAYblDiXexaBi2TBq1ZVl/x 43EP6QeNnupts4NvtLQU0hG1UtpjwGIHshBis0sRs1AWG8bmcqkrhOVr8gp2UIf0GPhP /c+jC6lu8b4hlwEkOfftiu317ArfF3CcngMiBn6i8k0UsrWKV1vq69hn4ZK263JOChFF dmM6fyHddALvatgchOwzL8x8b2EBgDmGWIuC4iKHvgJg9on2tEHS9BgAffzP81vRfNlE Bcva9tMPb58of1h6Sx/mJU98EujYUn1gAdMDZF6mMjoUbhrzSALvyok7sUREUiXLsOM/ +0Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jtU0WtA2Dxsu5VqDnvExiYxhxnCn2ku9zT9tmLYnIEI=; b=zIWgFtJiUCYxeAZxg/89pp9yC+mMlOI2EFE4DOgspFkh64oq+mEG0qAPsFXg/klPOh CVbD/VZD3ESCCsDhfntFoNqalEmS9Xd7uFmo9e1gFKz8snJozSLyX7ZPoXZteq2DJ2I8 5VdF5JSaMDAP2pSuHDeXpMrnSVytFWkqEqGMN1HANOyOfC396iFw2FfkvNeGb1w0xQkx 2f5gg6RnEw2ioVIY12LJvmfXVd3emlmJr2eBPORTNyqrak1KoVaXvrLGxDYs7zWHM4XC j26olht6lscQPY1yiLRXJvd5D4CdJNE6HK/lSCli0660qlEGQE0LyAUy0ygXh19daugk X63g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V+zgFfI3; 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 k18si22008894pfd.241.2019.01.24.12.06.52; Thu, 24 Jan 2019 12:07:08 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=V+zgFfI3; 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 S1731530AbfAXTbC (ORCPT + 99 others); Thu, 24 Jan 2019 14:31:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:58674 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731512AbfAXTbB (ORCPT ); Thu, 24 Jan 2019 14:31:01 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A6F6A218D4; Thu, 24 Jan 2019 19:30:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548358260; bh=VkcrIsgp7s+FViqzoIcfDhXYSZ0hNzbNZjpxmUi+1Vs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V+zgFfI3LtqOC4Q2BECJeCIeLcA0y9FxW5jo3CSqF3SEtdCmCanGFzv+ZMwRIxzWW LVTXQYgWbzij9DxKVYTzgvpEjA1ybDc8Z4sIgIgKRxHbiH8Qg9e18nTYRKMx3SYOaa C3cc43rKoap9rOei/3kFPKxau1f6vJLXmVmSplFQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?= , Andy Shevchenko , Sasha Levin Subject: [PATCH 4.14 10/63] platform/x86: asus-wmi: Tell the EC the OS will handle the display off hotkey Date: Thu, 24 Jan 2019 20:19:59 +0100 Message-Id: <20190124190156.203479785@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190124190155.176570028@linuxfoundation.org> References: <20190124190155.176570028@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 78f3ac76d9e5219589718b9e4733bee21627b3f5 ] In the past, Asus firmwares would change the panel backlight directly through the EC when the display off hotkey (Fn+F7) was pressed, and only notify the OS of such change, with 0x33 when the LCD was ON and 0x34 when the LCD was OFF. These are currently mapped to KEY_DISPLAYTOGGLE and KEY_DISPLAY_OFF, respectively. Most recently the EC on Asus most machines lost ability to toggle the LCD backlight directly, but unless the OS informs the firmware it is going to handle the display toggle hotkey events, the firmware still tries change the brightness through the EC, to no effect. The end result is a long list (at Endless we counted 11) of Asus laptop models where the display toggle hotkey does not perform any action. Our firmware engineers contacts at Asus were surprised that there were still machines out there with the old behavior. Calling WMNB(ASUS_WMI_DEVID_BACKLIGHT==0x00050011, 2) on the _WDG device tells the firmware that it should let the OS handle the display toggle event, in which case it will simply notify the OS of a key press with 0x35, as shown by the DSDT excerpts bellow. Scope (_SB) { (...) Device (ATKD) { (...) Name (_WDG, Buffer (0x28) { /* 0000 */ 0xD0, 0x5E, 0x84, 0x97, 0x6D, 0x4E, 0xDE, 0x11, /* 0008 */ 0x8A, 0x39, 0x08, 0x00, 0x20, 0x0C, 0x9A, 0x66, /* 0010 */ 0x4E, 0x42, 0x01, 0x02, 0x35, 0xBB, 0x3C, 0x0B, /* 0018 */ 0xC2, 0xE3, 0xED, 0x45, 0x91, 0xC2, 0x4C, 0x5A, /* 0020 */ 0x6D, 0x19, 0x5D, 0x1C, 0xFF, 0x00, 0x01, 0x08 }) Method (WMNB, 3, Serialized) { CreateDWordField (Arg2, Zero, IIA0) CreateDWordField (Arg2, 0x04, IIA1) Local0 = (Arg1 & 0xFFFFFFFF) (...) If ((Local0 == 0x53564544)) { (...) If ((IIA0 == 0x00050011)) { If ((IIA1 == 0x02)) { ^^PCI0.SBRG.EC0.SPIN (0x72, One) ^^PCI0.SBRG.EC0.BLCT = One } Return (One) } } (...) } (...) } (...) } (...) Scope (_SB.PCI0.SBRG.EC0) { (...) Name (BLCT, Zero) (...) Method (_Q10, 0, NotSerialized) // _Qxx: EC Query { If ((BLCT == Zero)) { Local0 = One Local0 = RPIN (0x72) Local0 ^= One SPIN (0x72, Local0) If (ATKP) { Local0 = (0x34 - Local0) ^^^^ATKD.IANE (Local0) } } ElseIf ((BLCT == One)) { If (ATKP) { ^^^^ATKD.IANE (0x35) } } } (...) } Signed-off-by: João Paulo Rechi Vita Signed-off-by: Andy Shevchenko Signed-off-by: Sasha Levin --- drivers/platform/x86/asus-wmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 7440f650e81a..3f662cd774d7 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -2147,7 +2147,8 @@ static int asus_wmi_add(struct platform_device *pdev) err = asus_wmi_backlight_init(asus); if (err && err != -ENODEV) goto fail_backlight; - } + } else + err = asus_wmi_set_devstate(ASUS_WMI_DEVID_BACKLIGHT, 2, NULL); status = wmi_install_notify_handler(asus->driver->event_guid, asus_wmi_notify, asus); -- 2.19.1