stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.4 01/28] platform/x86: asus-wmi: Tell the EC the OS will handle the display off hotkey
@ 2019-01-08 19:34 Sasha Levin
  2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 02/28] e1000e: allow non-monotonic SYSTIM readings Sasha Levin
                   ` (26 more replies)
  0 siblings, 27 replies; 28+ messages in thread
From: Sasha Levin @ 2019-01-08 19:34 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: João Paulo Rechi Vita, João Paulo Rechi Vita,
	Andy Shevchenko, Sasha Levin, acpi4asus-user, platform-driver-x86

From: João Paulo Rechi Vita <jprvita@gmail.com>

[ 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 <jprvita@endlessm.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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


^ permalink raw reply related	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2019-01-08 19:40 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-08 19:34 [PATCH AUTOSEL 4.4 01/28] platform/x86: asus-wmi: Tell the EC the OS will handle the display off hotkey Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 02/28] e1000e: allow non-monotonic SYSTIM readings Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 03/28] writeback: don't decrement wb->refcnt if !wb->bdi Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 04/28] MIPS: SiByte: Enable swiotlb for SWARM, LittleSur and BigSur Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 05/28] arm64: perf: set suppress_bind_attrs flag to true Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 06/28] USB: serial: ftdi_sio: use rounding when calculating baud rate divisors Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 07/28] drm/amdgpu: Correct get_crtc_scanoutpos behavior when vpos >= vtotal Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 08/28] jffs2: Fix use of uninitialized delayed_work, lockdep breakage Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 09/28] pstore/ram: Do not treat empty buffers as valid Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 10/28] powerpc/pseries/cpuidle: Fix preempt warning Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 11/28] media: firewire: Fix app_info parameter type in avc_ca{,_app}_info Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 12/28] net: call sk_dst_reset when set SO_DONTROUTE Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 13/28] scsi: target: use consistent left-aligned ASCII INQUIRY data Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 14/28] clk: imx6q: reset exclusive gates on init Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 15/28] kconfig: fix file name and line number of warn_ignored_character() Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 16/28] kconfig: fix memory leak when EOF is encountered in quotation Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 17/28] mmc: atmel-mci: do not assume idle after atmci_request_end Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 18/28] perf intel-pt: Fix error with config term "pt=0" Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 19/28] perf svghelper: Fix unchecked usage of strncpy() Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 20/28] perf parse-events: " Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 21/28] dm kcopyd: Fix bug causing workqueue stalls Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 22/28] dm snapshot: Fix excessive memory usage and " Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 23/28] ALSA: bebob: fix model-id of unit for Apogee Ensemble Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 24/28] sysfs: Disable lockdep for driver bind/unbind files Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 25/28] scsi: megaraid: fix out-of-bound array accesses Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 26/28] ocfs2: fix panic due to unrecovered local alloc Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 27/28] mm/page-writeback.c: don't break integrity writeback on ->writepage() error Sasha Levin
2019-01-08 19:34 ` [PATCH AUTOSEL 4.4 28/28] mm, proc: be more verbose about unstable VMA flags in /proc/<pid>/smaps Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).