Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp797063imu; Wed, 23 Jan 2019 05:57:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN5qn83YYTrFbPCW1dmYiG3O3oRJDE7cC27rxxlNYrZA9sYqcJvBdbBuXEe5D/VAqNau88pD X-Received: by 2002:a62:64d7:: with SMTP id y206mr2116813pfb.84.1548251845511; Wed, 23 Jan 2019 05:57:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548251845; cv=none; d=google.com; s=arc-20160816; b=kXa9pQlOmd6Rm7DypvolGSrCiq81Ot0wDiHa6Qf66e9/tsBndFplb4+Yk1Gl7a9uJK +VVcH/ExBoLXsTE/w99kXGrsXHcaZqrQhRJjzIDh06u1a7eRNOH3x0W5P1CoqtjKg7+m fHNGzZt2X+CGzlTYrADeGt//jm1M7d0aQdTEN+yer546sMq43hBY1fASH+F7eLAT76ri rzQJlr5JfRcdGHfe4sFUj64BCkawG9PgEUYYmC3iU35+GML3e3E2Q4oYHBqkqhilzCg8 FMqOtUIMcvEp7Eyte2G0p6Ipl5QKsh11GYLyBQKsgsF8WFBBivXsaBStfR2BgSco6/tz VqNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=w58yPj2lTSvehg4lyjd2nxwjxwU8/PlFktPh4SuxLZ0=; b=Xlp07ZYBlkVa5dqDhCcEKC7o7RwFXevzXWXzRXyOZY6E8cDEvmklC5cvjd7oG0ytti 4ESAfJkIit6UG5n3lYD7I+sPd5958fFU+TbGEIFlbHqy7iB/I23CcY0z+9MH89iVzZGy 0praSxW04eZk/tz6jnQp4PNFfogcEaQjzBNBrA7CbLDCskxqpqAI7iMR+FsiI3tt9ZoI fNAWYJCdtMTgyYxRj7xEBGtKUKFbyuBU1alexjbU4yHP2qWWtqk1LqKQIgdL0iXXjn+G Py38r022pYgj+l4cwmSbNm0amMxrHXW4+IjstvjcIome0ul1zXVYK+DmYF3IxJNV/5Cq THVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hJN42FUA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c3si18358627pls.73.2019.01.23.05.57.05; Wed, 23 Jan 2019 05:57:25 -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=hJN42FUA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726236AbfAWN4B (ORCPT + 99 others); Wed, 23 Jan 2019 08:56:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:34808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbfAWN4A (ORCPT ); Wed, 23 Jan 2019 08:56:00 -0500 Received: from localhost (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (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 E18E72184B; Wed, 23 Jan 2019 13:55:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548251759; bh=84NIuvcSNDHtc6rbPcLmh1NQz5WLhU8cPh9SxqAnVpQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hJN42FUAB4hI9fuJVN1Ex34+cJpqnPoZcQNdOXfttwqSf4EWKN+6LgLpfKEieDtz+ G1Kbig22RIMpIIelqiND19P0KaW3n/op57JAh46US6Xz9g7lT0ax+iDyCk793ldTn+ OPuOxUuFK85rGLkKczsspqc+3e9wxs9S1M8zQyrM= Date: Wed, 23 Jan 2019 08:55:57 -0500 From: Sasha Levin To: =?iso-8859-1?Q?Jo=E3o?= Paulo Rechi Vita Cc: LKML , Stable , =?iso-8859-1?Q?Jo=E3o?= Paulo Rechi Vita , Andy Shevchenko , acpi4asus-user , Platform Driver Subject: Re: [PATCH AUTOSEL 4.20 008/117] platform/x86: asus-wmi: Tell the EC the OS will handle the display off hotkey Message-ID: <20190123135557.GG202535@sasha-vm> References: <20190108192628.121270-1-sashal@kernel.org> <20190108192628.121270-8-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 08, 2019 at 04:49:18PM -0800, Jo?o Paulo Rechi Vita wrote: >Hello Sasha, > >On Tue, Jan 8, 2019 at 11:26 AM Sasha Levin wrote: >> >> From: Jo?o Paulo Rechi Vita >> >> [ 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 > >I am not entirely sure this is linux-stable material. This patch makes >the "turn off the display backlight" hotkey work on some Asus machines >where, without this patch, the key would simply do nothing. It seems >to me this is more of a new feature support than a bug fix. That said, >if you or Andy think this should go to stable after this short >explanation, I'll not object it. I think I'll keep this in. It looks a lot like a quirk to make this device work. -- Thanks, Sasha