ACPI4Asus and friends updates
Corentin Chary
maintainercover ACPI4Asus and friends updates
From: Corentin Chary <[email protected]>
Hi Matthew,
Some patches collected from AceLan and me for asus related drivers. Nothing big, mainly keymaps and quirks.
Thanks,
AceLan Kao (5):
asus-laptop: correct a touchpad hotkey mapping
asus-laptop: add all video switch keys
asus-nb-wmi: correct a touchpad hotkey mapping
asus-nb-wmi: add all video switch keys
asus-wmi: add display toggle quirk
Corentin Chary (3):
platform-drivers-x86: change my mail
asus-laptop: map some new keys
asus-{nb-wmi|laptop}.c: sync keymaps
MAINTAINERS | 4 +- drivers/platform/x86/asus-laptop.c | 61 ++++++++++++++++++++--------- drivers/platform/x86/asus-nb-wmi.c | 76 +++++++++++++++++++++++++++++------- drivers/platform/x86/asus-wmi.c | 33 ++++++++++++++-- drivers/platform/x86/asus-wmi.h | 7 +++ drivers/platform/x86/eeepc-wmi.c | 2 +- 6 files changed, 142 insertions(+), 41 deletions(-)
Signature · 1 line
1.7.8.6
Corentin Chary
maintainerPATCH 1/8 platform-drivers-x86: change my mail
--- MAINTAINERS | 4 ++-- drivers/platform/x86/asus-nb-wmi.c | 2 +- drivers/platform/x86/asus-wmi.c | 2 +- drivers/platform/x86/eeepc-wmi.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
MAINTAINERS +2 -2
@@ -1217,7 +1217,7 @@ F: Documentation/hwmon/asc7621 F: drivers/hwmon/asc7621.c ASUS NOTEBOOKS AND EEEPC ACPI/WMI EXTRAS DRIVERS -M: Corentin Chary <[email protected]> +M: Corentin Chary <[email protected]> L: [email protected] L: [email protected] W: http://acpi4asus.sf.net
@@ -5903,7 +5903,7 @@ F: drivers/media/video/*7146* F: include/media/*7146* SAMSUNG LAPTOP DRIVER -M: Corentin Chary <[email protected]> +M: Corentin Chary <[email protected]> L: [email protected] S: Maintained F: drivers/platform/x86/samsung-laptop.c
drivers/platform/x86/asus-nb-wmi.c +1 -1
@@ -32,7 +32,7 @@#define ASUS_NB_WMI_FILE "asus-nb-wmi" -MODULE_AUTHOR ("Corentin Chary <[email protected]>" ); +MODULE_AUTHOR ("Corentin Chary <[email protected]>" );MODULE_DESCRIPTION ("Asus Notebooks WMI Hotkey Driver" );MODULE_LICENSE ("GPL" );
drivers/platform/x86/asus-wmi.c +1 -1
@@ -51,7 +51,7 @@#include "asus-wmi.h" -MODULE_AUTHOR ("Corentin Chary <[email protected]>, " +MODULE_AUTHOR ("Corentin Chary <[email protected]>, " "Yong Wang <[email protected]>" );MODULE_DESCRIPTION ("Asus Generic WMI Driver" );MODULE_LICENSE ("GPL" );
drivers/platform/x86/eeepc-wmi.c +1 -1
@@ -39,7 +39,7 @@#define EEEPC_WMI_FILE "eeepc-wmi" -MODULE_AUTHOR ("Corentin Chary <[email protected]>" ); +MODULE_AUTHOR ("Corentin Chary <[email protected]>" );MODULE_DESCRIPTION ("Eee PC WMI Hotkey Driver" );MODULE_LICENSE ("GPL" );
Signature · 1 line
1.7.8.6
Corentin Chary
maintainerPATCH 2/8 asus-laptop: map some new keys
In reply to Corentin Chary--- drivers/platform/x86/asus-laptop.c | 3 +++ drivers/platform/x86/asus-nb-wmi.c | 1 + 2 files changed, 4 insertions(+), 0 deletions(-)
drivers/platform/x86/asus-laptop.c +3 -0
@@ -314,6 +314,8 @@ static const struct key_entry asus_keymap[] = { {KE_KEY, 0x50, { KEY_EMAIL } }, {KE_KEY, 0x51, { KEY_WWW } }, {KE_KEY, 0x55, { KEY_CALC } }, + {KE_IGNORE, 0x57, }, /* Battery mode */ + {KE_IGNORE, 0x58, }, /* AC mode */ {KE_KEY, 0x5C, { KEY_SCREENLOCK } }, /* Screenlock */ {KE_KEY, 0x5D, { KEY_WLAN } }, {KE_KEY, 0x5E, { KEY_WLAN } },
@@ -325,6 +327,7 @@ static const struct key_entry asus_keymap[] = { {KE_KEY, 0x6B, { KEY_F13 } }, /* Lock Touchpad */ {KE_KEY, 0x6C, { KEY_SLEEP } }, /* Suspend */ {KE_KEY, 0x6D, { KEY_SLEEP } }, /* Hibernate */ + {KE_IGNORE, 0x6E, }, /* Low Battery notification */ {KE_KEY, 0x7E, { KEY_BLUETOOTH } }, {KE_KEY, 0x7D, { KEY_BLUETOOTH } }, {KE_KEY, 0x82, { KEY_CAMERA } },
drivers/platform/x86/asus-nb-wmi.c +1 -0
@@ -185,6 +185,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, { KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, + { KE_IGNORE, 0x6E, }, /* Low Battery notification */ { KE_KEY, 0x7D, { KEY_BLUETOOTH } }, { KE_KEY, 0x7E, { KEY_BLUETOOTH } }, { KE_KEY, 0x82, { KEY_CAMERA } },
Signature · 1 line
1.7.8.6
Corentin Chary
maintainerPATCH 3/8 asus-{nb-wmi|laptop}.c: sync keymaps
In reply to Corentin CharyMaybe this should be shared in another module...
--- drivers/platform/x86/asus-laptop.c | 36 ++++++++++++++++++------------------ drivers/platform/x86/asus-nb-wmi.c | 24 ++++++++++++------------ 2 files changed, 30 insertions(+), 30 deletions(-)
drivers/platform/x86/asus-laptop.c +18 -18
@@ -304,40 +304,40 @@ static const struct key_entry asus_keymap[] = { {KE_KEY, 0x30, { KEY_VOLUMEUP } }, {KE_KEY, 0x31, { KEY_VOLUMEDOWN } }, {KE_KEY, 0x32, { KEY_MUTE } }, - {KE_KEY, 0x33, { KEY_SWITCHVIDEOMODE } }, - {KE_KEY, 0x34, { KEY_SWITCHVIDEOMODE } }, + {KE_KEY, 0x33, { KEY_DISPLAYTOGGLE } }, /* LCD on */ + {KE_KEY, 0x34, { KEY_DISPLAY_OFF } }, /* LCD off */ {KE_KEY, 0x40, { KEY_PREVIOUSSONG } }, {KE_KEY, 0x41, { KEY_NEXTSONG } }, - {KE_KEY, 0x43, { KEY_STOPCD } }, + {KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */ {KE_KEY, 0x45, { KEY_PLAYPAUSE } }, - {KE_KEY, 0x4c, { KEY_MEDIA } }, + {KE_KEY, 0x4c, { KEY_MEDIA } }, /* WMP Key */ {KE_KEY, 0x50, { KEY_EMAIL } }, {KE_KEY, 0x51, { KEY_WWW } }, {KE_KEY, 0x55, { KEY_CALC } }, {KE_IGNORE, 0x57, }, /* Battery mode */ {KE_IGNORE, 0x58, }, /* AC mode */ {KE_KEY, 0x5C, { KEY_SCREENLOCK } }, /* Screenlock */ - {KE_KEY, 0x5D, { KEY_WLAN } }, - {KE_KEY, 0x5E, { KEY_WLAN } }, - {KE_KEY, 0x5F, { KEY_WLAN } }, + {KE_KEY, 0x5D, { KEY_WLAN } }, /* WLAN Toggle */ + {KE_KEY, 0x5E, { KEY_WLAN } }, /* WLAN Enable */ + {KE_KEY, 0x5F, { KEY_WLAN } }, /* WLAN Disable */ {KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } }, - {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, - {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, - {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, - {KE_KEY, 0x6B, { KEY_F13 } }, /* Lock Touchpad */ + {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */ + {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */ + {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */ + {KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, /* Lock Touchpad */ {KE_KEY, 0x6C, { KEY_SLEEP } }, /* Suspend */ {KE_KEY, 0x6D, { KEY_SLEEP } }, /* Hibernate */ {KE_IGNORE, 0x6E, }, /* Low Battery notification */ - {KE_KEY, 0x7E, { KEY_BLUETOOTH } }, - {KE_KEY, 0x7D, { KEY_BLUETOOTH } }, + {KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */ + {KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */ {KE_KEY, 0x82, { KEY_CAMERA } }, - {KE_KEY, 0x88, { KEY_WLAN } }, - {KE_KEY, 0x8A, { KEY_PROG1 } }, + {KE_KEY, 0x88, { KEY_RFKILL } }, /* Radio Toggle Key */ + {KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */ {KE_KEY, 0x95, { KEY_MEDIA } }, {KE_KEY, 0x99, { KEY_PHONE } }, - {KE_KEY, 0xc4, { KEY_KBDILLUMUP } }, - {KE_KEY, 0xc5, { KEY_KBDILLUMDOWN } }, - {KE_KEY, 0xb5, { KEY_CALC } }, + {KE_KEY, 0xB5, { KEY_CALC } }, + {KE_KEY, 0xC4, { KEY_KBDILLUMUP } }, + {KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } }, {KE_END, 0}, };
drivers/platform/x86/asus-nb-wmi.c +12 -12
@@ -168,9 +168,9 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_KEY, 0x34, { KEY_DISPLAY_OFF } }, /* LCD off */ { KE_KEY, 0x40, { KEY_PREVIOUSSONG } }, { KE_KEY, 0x41, { KEY_NEXTSONG } }, - { KE_KEY, 0x43, { KEY_STOPCD } }, + { KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */ { KE_KEY, 0x45, { KEY_PLAYPAUSE } }, - { KE_KEY, 0x4c, { KEY_MEDIA } }, + { KE_KEY, 0x4c, { KEY_MEDIA } }, /* WMP Key */ { KE_KEY, 0x50, { KEY_EMAIL } }, { KE_KEY, 0x51, { KEY_WWW } }, { KE_KEY, 0x55, { KEY_CALC } },
@@ -181,25 +181,25 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */ { KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */ { KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } }, - { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, - { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, - { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, + { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */ + { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */ + { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */ { KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, { KE_IGNORE, 0x6E, }, /* Low Battery notification */ - { KE_KEY, 0x7D, { KEY_BLUETOOTH } }, - { KE_KEY, 0x7E, { KEY_BLUETOOTH } }, + { KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */ + { KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */ { KE_KEY, 0x82, { KEY_CAMERA } }, - { KE_KEY, 0x88, { KEY_RFKILL } }, - { KE_KEY, 0x8A, { KEY_PROG1 } }, + { KE_KEY, 0x88, { KEY_RFKILL } }, /* Radio Toggle Key */ + { KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */ { KE_KEY, 0x95, { KEY_MEDIA } }, { KE_KEY, 0x99, { KEY_PHONE } }, { KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */ { KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */ { KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */ { KE_KEY, 0xA3, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + HDMI */ - { KE_KEY, 0xb5, { KEY_CALC } }, - { KE_KEY, 0xc4, { KEY_KBDILLUMUP } }, - { KE_KEY, 0xc5, { KEY_KBDILLUMDOWN } }, + { KE_KEY, 0xB5, { KEY_CALC } }, + { KE_KEY, 0xC4, { KEY_KBDILLUMUP } }, + { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } }, { KE_END, 0}, };
Signature · 1 line
1.7.8.6
Corentin Chary
maintainerPATCH 4/8 asus-laptop: correct a touchpad hotkey mapping
In reply to Corentin CharyFrom: AceLan Kao <[email protected]>
0x60 is touchpad enable key, but is misdefined in the keymap.
--- drivers/platform/x86/asus-laptop.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/platform/x86/asus-laptop.c +1 -1
@@ -320,7 +320,7 @@ static const struct key_entry asus_keymap[] = { {KE_KEY, 0x5D, { KEY_WLAN } }, /* WLAN Toggle */ {KE_KEY, 0x5E, { KEY_WLAN } }, /* WLAN Enable */ {KE_KEY, 0x5F, { KEY_WLAN } }, /* WLAN Disable */ - {KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } }, + {KE_KEY, 0x60, { KEY_TOUCHPAD_ON } }, {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */ {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */ {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
Signature · 1 line
1.7.8.6
Corentin Chary
maintainerPATCH 5/8 asus-laptop: add all video switch keys
In reply to Corentin CharyFrom: AceLan Kao <[email protected]>
Fill up all the video switch keys in the map.
--- drivers/platform/x86/asus-laptop.c | 26 +++++++++++++++++++++++--- 1 files changed, 23 insertions(+), 3 deletions(-)
drivers/platform/x86/asus-laptop.c +23 -3
@@ -321,9 +321,13 @@ static const struct key_entry asus_keymap[] = { {KE_KEY, 0x5E, { KEY_WLAN } }, /* WLAN Enable */ {KE_KEY, 0x5F, { KEY_WLAN } }, /* WLAN Disable */ {KE_KEY, 0x60, { KEY_TOUCHPAD_ON } }, - {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */ - {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */ - {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */ + {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD only */ + {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT only */ + {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT */ + {KE_KEY, 0x64, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV */ + {KE_KEY, 0x65, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV */ + {KE_KEY, 0x66, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV */ + {KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */ {KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, /* Lock Touchpad */ {KE_KEY, 0x6C, { KEY_SLEEP } }, /* Suspend */ {KE_KEY, 0x6D, { KEY_SLEEP } }, /* Hibernate */
@@ -333,8 +337,24 @@ static const struct key_entry asus_keymap[] = { {KE_KEY, 0x82, { KEY_CAMERA } }, {KE_KEY, 0x88, { KEY_RFKILL } }, /* Radio Toggle Key */ {KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */ + {KE_KEY, 0x8C, { KEY_SWITCHVIDEOMODE } }, /* SDSP DVI only */ + {KE_KEY, 0x8D, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + DVI */ + {KE_KEY, 0x8E, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + DVI */ + {KE_KEY, 0x8F, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + DVI */ + {KE_KEY, 0x90, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + DVI */ + {KE_KEY, 0x91, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + DVI */ + {KE_KEY, 0x92, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + DVI */ + {KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI */ {KE_KEY, 0x95, { KEY_MEDIA } }, {KE_KEY, 0x99, { KEY_PHONE } }, + {KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */ + {KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */ + {KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */ + {KE_KEY, 0xA3, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + HDMI */ + {KE_KEY, 0xA4, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + HDMI */ + {KE_KEY, 0xA5, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + HDMI */ + {KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */ + {KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + HDMI */ {KE_KEY, 0xB5, { KEY_CALC } }, {KE_KEY, 0xC4, { KEY_KBDILLUMUP } }, {KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
Signature · 1 line
1.7.8.6
Corentin Chary
maintainerPATCH 6/8 asus-nb-wmi: correct a touchpad hotkey mapping
In reply to Corentin CharyFrom: AceLan Kao <[email protected]>
0x60 is touchpad enable key, but is misdefined in the keymap.
--- drivers/platform/x86/asus-nb-wmi.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/platform/x86/asus-nb-wmi.c +1 -1
@@ -180,7 +180,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_KEY, 0x5D, { KEY_WLAN } }, /* Wireless console Toggle */ { KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */ { KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */ - { KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } }, + { KE_KEY, 0x60, { KEY_TOUCHPAD_ON } }, { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */ { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */ { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
Signature · 1 line
1.7.8.6
Corentin Chary
maintainerPATCH 7/8 asus-nb-wmi: add all video switch keys
In reply to Corentin CharyFrom: AceLan Kao <[email protected]>
Fill up all the video switch keys in the map.
--- drivers/platform/x86/asus-nb-wmi.c | 22 +++++++++++++++++++--- 1 files changed, 19 insertions(+), 3 deletions(-)
drivers/platform/x86/asus-nb-wmi.c +19 -3
@@ -181,9 +181,13 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */ { KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */ { KE_KEY, 0x60, { KEY_TOUCHPAD_ON } }, - { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */ - { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */ - { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */ + { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD only */ + { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT only */ + { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT */ + { KE_KEY, 0x64, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV */ + { KE_KEY, 0x65, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV */ + { KE_KEY, 0x66, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV */ + { KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */ { KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, { KE_IGNORE, 0x6E, }, /* Low Battery notification */ { KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
@@ -191,12 +195,24 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_KEY, 0x82, { KEY_CAMERA } }, { KE_KEY, 0x88, { KEY_RFKILL } }, /* Radio Toggle Key */ { KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */ + { KE_KEY, 0x8C, { KEY_SWITCHVIDEOMODE } }, /* SDSP DVI only */ + { KE_KEY, 0x8D, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + DVI */ + { KE_KEY, 0x8E, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + DVI */ + { KE_KEY, 0x8F, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + DVI */ + { KE_KEY, 0x90, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + DVI */ + { KE_KEY, 0x91, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + DVI */ + { KE_KEY, 0x92, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + DVI */ + { KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI */ { KE_KEY, 0x95, { KEY_MEDIA } }, { KE_KEY, 0x99, { KEY_PHONE } }, { KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */ { KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */ { KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */ { KE_KEY, 0xA3, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + HDMI */ + { KE_KEY, 0xA4, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + HDMI */ + { KE_KEY, 0xA5, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + HDMI */ + { KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */ + { KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + HDMI */ { KE_KEY, 0xB5, { KEY_CALC } }, { KE_KEY, 0xC4, { KEY_KBDILLUMUP } }, { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
Signature · 1 line
1.7.8.6
Corentin Chary
maintainerPATCH 8/8 asus-wmi: add display toggle quirk
In reply to Corentin CharyFrom: AceLan Kao <[email protected]>
For machines with AMD graphic chips, it will send out WMI event and ACPI interrupt at the same time while hitting the hotkey. BIOS will notify the system the next display output mode throught WMI event code, so that windows' application can show an OSD to tell the user which mode will be taken effect. User can hit the display toggle key many times within 2 seconds to choose the mode they want. After 2 seconds, WMI dirver should send a WMIMethod(SDSP) command to tell the BIOS which mode the user chose. And then BIOS will raise another ACPI interrupt to tell the system to really switch the display mode.
In Linux desktop, we don't have this kind of OSD to let users to choose the mode they want, so we don't need to call WMIMethod(SDSP) to have another ACPI interrupt. To simplify the problem, we just have to ignore the WMI event, and let the first ACPI interrupt to send out the key event.
For the need, here comes another quirk to add machines with this kind of behavior. When the WMI driver receives the display toggle WMI event, and found the machin is in the list, it will do nothing and let ACPI video driver to report the key event.
--- drivers/platform/x86/asus-nb-wmi.c | 31 ++++++++++++++++++++++++++++++- drivers/platform/x86/asus-wmi.c | 31 ++++++++++++++++++++++++++++--- drivers/platform/x86/asus-wmi.h | 7 +++++++ 3 files changed, 65 insertions(+), 4 deletions(-)
drivers/platform/x86/asus-nb-wmi.c +30 -1
@@ -59,6 +59,17 @@ static struct quirk_entry quirk_asus_unknown = { .wapf = 0, }; +/* +* For those machines that need software to control bt/wifi status +* and can't adjust brightness through ACPI interface +* and have duplicate events(ACPI and WMI) for display toggle +*/ +static struct quirk_entry quirk_asus_x55u = { + .wapf =4 , + .wmi_backlight_power = true, + .no_display_toggle = true, +}; +static struct quirk_entry quirk_asus_x401u = { .wapf =4 , };
@@ -77,6 +88,15 @@ static struct dmi_system_id asus_quirks[] = {DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), DMI_MATCH(DMI_PRODUCT_NAME, "X401U"), }, + .driver_data = &quirk_asus_x55u, + }, + { + .callback = dmi_matched, + .ident = "ASUSTeK COMPUTER INC. X401A", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), + DMI_MATCH(DMI_PRODUCT_NAME, "X401A"), + }, .driver_data = &quirk_asus_x401u, }, {
@@ -95,6 +115,15 @@ static struct dmi_system_id asus_quirks[] = {DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), DMI_MATCH(DMI_PRODUCT_NAME, "X501U"), }, + .driver_data = &quirk_asus_x55u, + }, + { + .callback = dmi_matched, + .ident = "ASUSTeK COMPUTER INC. X501A", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), + DMI_MATCH(DMI_PRODUCT_NAME, "X501A"), + }, .driver_data = &quirk_asus_x401u, }, {
@@ -131,7 +160,7 @@ static struct dmi_system_id asus_quirks[] = {DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), DMI_MATCH(DMI_PRODUCT_NAME, "X55U"), }, - .driver_data = &quirk_asus_x401u, + .driver_data = &quirk_asus_x55u, }, { .callback = dmi_matched,
drivers/platform/x86/asus-wmi.c +28 -3
@@ -1341,6 +1341,23 @@ static void asus_wmi_backlight_exit(struct asus_wmi *asus) asus->backlight_device =NULL ; } +static int is_display_toggle (int code) +{ +/* display toggle keys */ +if ((code >=0x61 && code <=0x67 ) || + (code >=0x8c && code <=0x93 ) || + (code >=0xa0 && code <=0xa7 ) || + (code >=0xd0 && code <=0xd5 )) +return 1 ; + +return 0 ; +} + +static void do_nothing (void ) +{ +return ; +} +static void asus_wmi_notify (u32 value,void *context) {struct asus_wmi *asus = context;
@@ -1380,10 +1397,18 @@ static void asus_wmi_notify(u32 value, void *context) code =NOTIFY_BRNDOWN_MIN ;if (code ==NOTIFY_BRNUP_MIN || code ==NOTIFY_BRNDOWN_MIN ) { -if (!acpi_video_backlight_support ()) +if (!acpi_video_backlight_support ()) {asus_wmi_backlight_notify (asus, orig_code); - }else if (!sparse_keymap_report_event (asus->inputdev, code, - key_value, autorelease)) + } + goto exit; + } + +if (is_display_toggle (code) && + asus->driver->quirks->no_display_toggle) { + goto exit; + +if (!sparse_keymap_report_event (asus->inputdev, code, + key_value, autorelease))pr_info ("Unknown key %x pressed\n" , code); exit:
drivers/platform/x86/asus-wmi.h +7 -0
@@ -41,6 +41,13 @@ struct quirk_entry {bool store_backlight_power;bool wmi_backlight_power;int wapf; +/* +* For machines with AMD graphic chips, it will send out WMI event +* and ACPI interrupt at the same time while hitting the hotkey. +* To simplify the problem, we just have to ignore the WMI event, +* and let the ACPI interrupt to send out the key event. +*/ +int no_display_toggle; };struct asus_wmi_driver {
Signature · 1 line
1.7.8.6