Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2365563imu; Thu, 24 Jan 2019 11:28:31 -0800 (PST) X-Google-Smtp-Source: ALg8bN4aC+V8UCOTzVujTrRSfSiVznEnbVHhS+y1Xp++SePOLc3tncIUy7/lQUSdhsSr2B4+S4VK X-Received: by 2002:a63:fa06:: with SMTP id y6mr7148337pgh.177.1548358111811; Thu, 24 Jan 2019 11:28:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548358111; cv=none; d=google.com; s=arc-20160816; b=aGuhjaFiZpmqZwdIiIsmQBXIem+ceneiFjXv8er9xbhp4xxuChaOPHRyUjPyb6qUHu e+4iim20ksuYmzER5HrnBIOeyRv2LoonI/Ux+tvjaiDHe80NuPstEZ5ROz7dFwjaCwxl 0M+JWM2yndmNQ1TBX2iV3xN9FAkP4NxaSfOxKNSrO0aU7mP6TwiIpx5FNZ/13f66FzWx /pz39YKD2U2u/urfCVS4EmYDnUflbHgvZQ6e/JbMFBVBbpsmZ7NRmB7/4HqwJ3twgifM bmqs6/tXV2x16h8qNnQXDrpX5GH1xIojLwKgSYwo6QUmeRSzFv5BDjz6s39vlP9UkKSH aAtA== 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=vqAHwnics9tavlyEkkeX6BhJSepXsWPch2ZZhBs9Ilo=; b=CXJVr+8FuepbZ54vyy9byAQcRuRkbcKrpRbAMAgC0fNaK6qU9oT0bTkIYaxn6prHRm IOfdAf3sX8v6tNsUDVq0ER304FC28Y/ynM8fh2J/8JCsRsD/TNqE9Cq1VTPvXjFjTNQB y3ghhgl5Rr0jqxW4/MM6Df/fX+6UFDDipLMtU0N4S176ldCBuj/U8gpeigJsUoKR3qMD 7jK8i018xQhNRYa5vQi4bxL1mjiXy7NZECocYYy3EgPkqKTRe+YL2raBBu3lJzgmqRe0 Y08YjB8W6fptzAIb9oduLAOgEJG7nMRFTBfvNAucjlEt2nNiPtnfazmHgWhGWjUss+y/ 70xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="AYcvX/SK"; 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 o184si23223637pgo.591.2019.01.24.11.28.15; Thu, 24 Jan 2019 11:28:31 -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="AYcvX/SK"; 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 S1730405AbfAXT1a (ORCPT + 99 others); Thu, 24 Jan 2019 14:27:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:53666 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730757AbfAXT10 (ORCPT ); Thu, 24 Jan 2019 14:27:26 -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 77E05218FC; Thu, 24 Jan 2019 19:27:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548358045; bh=5w1D3Ymi8glZakObHcArKutMVCXvR4By2hwXnGIhd2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AYcvX/SK9OAzTKa7vRDzL+EBHBf/Vy3DYf5/zEJe0ihAUi3DPTVfdVOk8gAiLRTWF Yzce6hs4lmbQst+nbLEhsJh9POOnurplP/XPIzB6A+D2LAZXUCGWKicUeLykvL2CmF /Q6vnkBM0gBGA9vZ3ShbfTUKuLeuorI29r/iqr9I= 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.4 077/104] platform/x86: asus-wmi: Tell the EC the OS will handle the display off hotkey Date: Thu, 24 Jan 2019 20:20:06 +0100 Message-Id: <20190124190203.900527311@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190124190154.968308875@linuxfoundation.org> References: <20190124190154.968308875@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.4-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 f96f7b865267..7c1defaef3f5 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -2084,7 +2084,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