linux_dsm_epyc7002/drivers/platform/x86
João Paulo Rechi Vita 78f3ac76d9 platform/x86: asus-wmi: Tell the EC the OS will handle the display off hotkey
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>
2018-11-07 15:56:42 +02:00
..
acer-wireless.c
acer-wmi.c platform/x86: acer-wmi: Silence "unsupported" message a bit 2018-08-22 13:40:24 +03:00
acerhdf.c platform/x86: acerhdf: restructure to allow large BIOS table be __initconst 2018-09-27 12:18:08 +03:00
alienware-wmi.c platform/x86: alienware-wmi: Correct a memory leak 2018-09-10 13:45:43 -07:00
amilo-rfkill.c
apple-gmux.c platform/x86: apple-gmux: fix gmux_get_client_id()'s return type 2018-04-24 19:55:33 +03:00
asus-laptop.c platform/x86: Simplify getting .drvdata 2018-04-23 08:52:59 -07:00
asus-nb-wmi.c platform/x86: asus-nb-wmi: Add keymap entry for lid flip action on UX360 2018-08-15 13:17:48 +03:00
asus-wireless.c platform/x86: asus-wireless: Fix uninitialized symbol usage 2018-07-02 16:48:22 +03:00
asus-wmi.c platform/x86: asus-wmi: Tell the EC the OS will handle the display off hotkey 2018-11-07 15:56:42 +02:00
asus-wmi.h
classmate-laptop.c
compal-laptop.c
dcdbas.c firmware: dcdbas: include linux/io.h 2018-10-03 11:27:22 +03:00
dcdbas.h firmware: dcdbas: Move dcdbas to drivers/platform/x86 2018-09-27 12:18:15 +03:00
dell_rbu.c firmware: dell_rbu: Move dell_rbu to drivers/platform/x86 2018-09-27 12:18:15 +03:00
dell-laptop.c platform/x86: dell-laptop: Fix backlight detection 2018-07-31 17:40:36 +03:00
dell-rbtn.c
dell-rbtn.h
dell-smbios-base.c platform/x86: dell-smbios-base: Support systems without tokens 2018-06-26 15:01:52 -07:00
dell-smbios-smm.c firmware: dcdbas: Move dcdbas to drivers/platform/x86 2018-09-27 12:18:15 +03:00
dell-smbios-wmi.c platform/x86: dell-smbios-wmi: Correct a memory leak 2018-09-10 13:45:43 -07:00
dell-smbios.h
dell-smo8800.c
dell-wmi-aio.c
dell-wmi-descriptor.c
dell-wmi-descriptor.h
dell-wmi-led.c
dell-wmi.c platform/x86: dell-wmi: Ignore new rfkill and fn-lock events 2018-06-04 12:20:22 +03:00
eeepc-laptop.c PCI: hotplug: Embed hotplug_slot 2018-09-18 17:52:15 -05:00
eeepc-wmi.c
fujitsu-laptop.c platform/x86: fujitsu-laptop: Simplify soft key handling 2018-04-19 16:25:54 -07:00
fujitsu-tablet.c
gpd-pocket-fan.c
hdaps.c
hp_accel.c
hp-wireless.c
hp-wmi.c
i2c-multi-instantiate.c platform/x86: Add ACPI i2c-multi-instantiate pseudo driver 2018-08-09 13:58:21 +02:00
ibm_rtl.c
ideapad-laptop.c platform/x86: ideapad: Add Y530-15ICH to no_hw_rfkill 2018-10-31 16:11:39 +02:00
intel_atomisp2_pm.c platform/x86: Add Intel AtomISP2 dummy / power-management driver 2018-10-29 14:02:14 +02:00
intel_bxtwc_tmu.c platform/x86: intel_bxtwc_tmu: Convert to use SPDX identifier 2018-09-27 12:18:16 +03:00
intel_cht_int33fe.c platform-drivers-x86 for v4.20-1 2018-11-01 08:42:21 -07:00
intel_chtdc_ti_pwrbtn.c platform/x86: intel_chtdc_ti_pwrbtn: Add SPDX identifier 2018-09-27 12:18:16 +03:00
intel_int0002_vgpio.c platform-drivers-x86 for v4.20-1 2018-11-01 08:42:21 -07:00
intel_ips.c platform/x86: intel-ips: Convert to use SPDX identifier 2018-09-27 12:18:16 +03:00
intel_ips.h platform/x86: intel-ips: Convert to use SPDX identifier 2018-09-27 12:18:16 +03:00
intel_menlow.c platform/x86: intel_menlow: Convert to use SPDX identifier 2018-09-27 12:18:17 +03:00
intel_mid_powerbtn.c platform-drivers-x86 for v4.20-1 2018-11-01 08:42:21 -07:00
intel_mid_thermal.c platform/x86: intel_mid_thermal: Convert to use SPDX identifier 2018-09-27 12:18:17 +03:00
intel_oaktrail.c platform/x86: intel_oaktrail: Convert to use SPDX identifier 2018-09-27 12:18:18 +03:00
intel_pmc_core.c platform/x86: intel_pmc: Convert to use SPDX identifier 2018-09-27 12:18:18 +03:00
intel_pmc_core.h platform/x86: intel_pmc: Convert to use SPDX identifier 2018-09-27 12:18:18 +03:00
intel_pmc_ipc.c platform/x86: intel_pmc: Convert to use SPDX identifier 2018-09-27 12:18:18 +03:00
intel_punit_ipc.c platform/x86: intel_punit_ipc: Convert to use SPDX identifier 2018-09-27 12:18:18 +03:00
intel_scu_ipc.c platform/x86: intel_scu_ipc: Convert to use SPDX identifier 2018-09-27 12:18:19 +03:00
intel_scu_ipcutil.c platform/x86: intel_scu_ipc: Convert to use SPDX identifier 2018-09-27 12:18:19 +03:00
intel_telemetry_core.c platform/x86: intel_telemetry: Convert to use SPDX identifier 2018-09-27 12:18:20 +03:00
intel_telemetry_debugfs.c platform-drivers-x86 for v4.20-1 2018-11-01 08:42:21 -07:00
intel_telemetry_pltdrv.c platform-drivers-x86 for v4.20-1 2018-11-01 08:42:21 -07:00
intel_turbo_max_3.c platform/x86: intel_turbo_max_3: Convert to use SPDX identifier 2018-09-27 12:18:20 +03:00
intel-hid.c platform/x86: intel-hid: Convert to use SPDX identifier 2018-09-27 12:18:16 +03:00
intel-rst.c platform/x86: intel-rst: Convert to use SPDX identifier 2018-09-27 12:18:19 +03:00
intel-smartconnect.c platform/x86: intel-smartconnect: Convert to use SPDX identifier 2018-09-27 12:18:19 +03:00
intel-vbtn.c platform/x86: intel-vbtn: Add support for dock mode detection 2018-07-02 16:48:22 +03:00
intel-wmi-thunderbolt.c platform/x86: intel-wmi-thunderbolt: Add dynamic debugging 2018-09-27 12:18:20 +03:00
Kconfig platform-drivers-x86 for v4.20-1 2018-11-01 08:42:21 -07:00
lg-laptop.c platform/x86: Add LG Gram laptop special features driver 2018-10-19 19:21:57 +03:00
Makefile platform/x86: Add Intel AtomISP2 dummy / power-management driver 2018-10-29 14:02:14 +02:00
mlx-platform.c platform/x86: mlx-platform: Properly use mlxplat_mlxcpld_msn201x_items 2018-10-08 17:47:43 +03:00
msi-laptop.c
msi-wmi.c
mxm-wmi.c
panasonic-laptop.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
peaq-wmi.c
pmc_atom.c
pvpanic.c
samsung-laptop.c platform/x86: Simplify getting .drvdata 2018-04-23 08:52:59 -07:00
samsung-q10.c
sony-laptop.c
surface3_button.c
surface3-wmi.c
surfacepro3_button.c
tc1100-wmi.c
thinkpad_acpi.c platform/x86: thinkpad_acpi: Change the keymap for Favorites hotkey 2018-11-07 15:56:42 +02:00
topstar-laptop.c
toshiba_acpi.c platform/x86: toshiba_acpi: Fix defined but not used build warnings 2018-07-21 09:26:45 -07:00
toshiba_bluetooth.c
toshiba_haps.c
toshiba-wmi.c
touchscreen_dmi.c platform/x86: touchscreen_dmi: Add min-x and min-y settings for various models 2018-10-29 12:21:57 +02:00
wmi-bmof.c
wmi.c platform/x86: wmi: declare device_type structure as constant 2018-10-31 16:11:39 +02:00
xo1-rfkill.c
xo15-ebook.c