aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorCorentin Chary <corentin.chary@gmail.com>2011-07-01 05:34:39 -0400
committerMatthew Garrett <mjg@redhat.com>2011-08-05 14:46:04 -0400
commitfddbfed595b307f9dddc7a86ddfbcbcb80141e28 (patch)
tree8107abe6a86fb4371744b9000520efc843359a5a /drivers/platform
parent3df5fdadf6400373a696bb14e27d4771e5f6afb3 (diff)
asus-wmi: add CWAP support and clarify the meaning of WAPF bits
ref: http://dev.iksaif.net/projects/3/wiki/Asus-laptop_WAPF Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/asus-laptop.c9
-rw-r--r--drivers/platform/x86/asus-nb-wmi.c27
-rw-r--r--drivers/platform/x86/asus-wmi.c6
-rw-r--r--drivers/platform/x86/asus-wmi.h1
-rw-r--r--drivers/platform/x86/eeepc-wmi.c1
5 files changed, 35 insertions, 9 deletions
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index d65df92e2acc..fa6d7ec68b26 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -70,11 +70,10 @@ MODULE_LICENSE("GPL");
70 * WAPF defines the behavior of the Fn+Fx wlan key 70 * WAPF defines the behavior of the Fn+Fx wlan key
71 * The significance of values is yet to be found, but 71 * The significance of values is yet to be found, but
72 * most of the time: 72 * most of the time:
73 * 0x0 will do nothing 73 * Bit | Bluetooth | WLAN
74 * 0x1 will allow to control the device with Fn+Fx key. 74 * 0 | Hardware | Hardware
75 * 0x4 will send an ACPI event (0x88) while pressing the Fn+Fx key 75 * 1 | Hardware | Software
76 * 0x5 like 0x1 or 0x4 76 * 4 | Software | Software
77 * So, if something doesn't work as you want, just try other values =)
78 */ 77 */
79static uint wapf = 1; 78static uint wapf = 1;
80module_param(wapf, uint, 0444); 79module_param(wapf, uint, 0444);
diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c
index 0580d99b0798..b0859d4183e8 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -38,6 +38,24 @@ MODULE_LICENSE("GPL");
38 38
39MODULE_ALIAS("wmi:"ASUS_NB_WMI_EVENT_GUID); 39MODULE_ALIAS("wmi:"ASUS_NB_WMI_EVENT_GUID);
40 40
41/*
42 * WAPF defines the behavior of the Fn+Fx wlan key
43 * The significance of values is yet to be found, but
44 * most of the time:
45 * Bit | Bluetooth | WLAN
46 * 0 | Hardware | Hardware
47 * 1 | Hardware | Software
48 * 4 | Software | Software
49 */
50static uint wapf;
51module_param(wapf, uint, 0444);
52MODULE_PARM_DESC(wapf, "WAPF value");
53
54static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)
55{
56 driver->wapf = wapf;
57}
58
41static const struct key_entry asus_nb_wmi_keymap[] = { 59static const struct key_entry asus_nb_wmi_keymap[] = {
42 { KE_KEY, 0x30, { KEY_VOLUMEUP } }, 60 { KE_KEY, 0x30, { KEY_VOLUMEUP } },
43 { KE_KEY, 0x31, { KEY_VOLUMEDOWN } }, 61 { KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
@@ -53,16 +71,16 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
53 { KE_KEY, 0x51, { KEY_WWW } }, 71 { KE_KEY, 0x51, { KEY_WWW } },
54 { KE_KEY, 0x55, { KEY_CALC } }, 72 { KE_KEY, 0x55, { KEY_CALC } },
55 { KE_KEY, 0x5C, { KEY_F15 } }, /* Power Gear key */ 73 { KE_KEY, 0x5C, { KEY_F15 } }, /* Power Gear key */
56 { KE_KEY, 0x5D, { KEY_WLAN } }, 74 { KE_KEY, 0x5D, { KEY_WLAN } }, /* Wireless console Toggle */
57 { KE_KEY, 0x5E, { KEY_WLAN } }, 75 { KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
58 { KE_KEY, 0x5F, { KEY_WLAN } }, 76 { KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */
59 { KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } }, 77 { KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
60 { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, 78 { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } },
61 { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, 79 { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } },
62 { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, 80 { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } },
63 { KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, 81 { KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
64 { KE_KEY, 0x7E, { KEY_BLUETOOTH } },
65 { KE_KEY, 0x7D, { KEY_BLUETOOTH } }, 82 { KE_KEY, 0x7D, { KEY_BLUETOOTH } },
83 { KE_KEY, 0x7E, { KEY_BLUETOOTH } },
66 { KE_KEY, 0x82, { KEY_CAMERA } }, 84 { KE_KEY, 0x82, { KEY_CAMERA } },
67 { KE_KEY, 0x88, { KEY_RFKILL } }, 85 { KE_KEY, 0x88, { KEY_RFKILL } },
68 { KE_KEY, 0x8A, { KEY_PROG1 } }, 86 { KE_KEY, 0x8A, { KEY_PROG1 } },
@@ -81,6 +99,7 @@ static struct asus_wmi_driver asus_nb_wmi_driver = {
81 .keymap = asus_nb_wmi_keymap, 99 .keymap = asus_nb_wmi_keymap,
82 .input_name = "Asus WMI hotkeys", 100 .input_name = "Asus WMI hotkeys",
83 .input_phys = ASUS_NB_WMI_FILE "/input0", 101 .input_phys = ASUS_NB_WMI_FILE "/input0",
102 .quirks = asus_nb_wmi_quirks,
84}; 103};
85 104
86 105
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 3b9fb91e25ff..8787dfacf11d 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1413,6 +1413,12 @@ static int asus_wmi_platform_init(struct asus_wmi *asus)
1413 return -ENODEV; 1413 return -ENODEV;
1414 } 1414 }
1415 1415
1416 /* CWAP allow to define the behavior of the Fn+F2 key,
1417 * this method doesn't seems to be present on Eee PCs */
1418 if (asus->driver->wapf >= 0)
1419 asus_wmi_set_devstate(ASUS_WMI_DEVID_CWAP,
1420 asus->driver->wapf, NULL);
1421
1416 return asus_wmi_sysfs_init(asus->platform_device); 1422 return asus_wmi_sysfs_init(asus->platform_device);
1417} 1423}
1418 1424
diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h
index 4da61033bcb9..8147c10161cc 100644
--- a/drivers/platform/x86/asus-wmi.h
+++ b/drivers/platform/x86/asus-wmi.h
@@ -37,6 +37,7 @@ struct asus_wmi;
37 37
38struct asus_wmi_driver { 38struct asus_wmi_driver {
39 bool hotplug_wireless; 39 bool hotplug_wireless;
40 int wapf;
40 41
41 const char *name; 42 const char *name;
42 struct module *owner; 43 struct module *owner;
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index f41a977efa94..9f6e64302b45 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -166,6 +166,7 @@ static void eeepc_dmi_check(struct asus_wmi_driver *driver)
166static void eeepc_wmi_quirks(struct asus_wmi_driver *driver) 166static void eeepc_wmi_quirks(struct asus_wmi_driver *driver)
167{ 167{
168 driver->hotplug_wireless = hotplug_wireless; 168 driver->hotplug_wireless = hotplug_wireless;
169 driver->wapf = -1;
169 eeepc_dmi_check(driver); 170 eeepc_dmi_check(driver);
170} 171}
171 172