]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
asus-wmi: add CWAP support and clarify the meaning of WAPF bits
authorCorentin Chary <corentin.chary@gmail.com>
Fri, 1 Jul 2011 09:34:39 +0000 (11:34 +0200)
committerMatthew Garrett <mjg@redhat.com>
Fri, 5 Aug 2011 18:46:04 +0000 (14:46 -0400)
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>
drivers/platform/x86/asus-laptop.c
drivers/platform/x86/asus-nb-wmi.c
drivers/platform/x86/asus-wmi.c
drivers/platform/x86/asus-wmi.h
drivers/platform/x86/eeepc-wmi.c

index d65df92e2acc63fb9eea85d82434c359ed8654fd..fa6d7ec68b269670b4de8ca24cb97b3d55160acc 100644 (file)
@@ -70,11 +70,10 @@ MODULE_LICENSE("GPL");
  * WAPF defines the behavior of the Fn+Fx wlan key
  * The significance of values is yet to be found, but
  * most of the time:
- * 0x0 will do nothing
- * 0x1 will allow to control the device with Fn+Fx key.
- * 0x4 will send an ACPI event (0x88) while pressing the Fn+Fx key
- * 0x5 like 0x1 or 0x4
- * So, if something doesn't work as you want, just try other values =)
+ * Bit | Bluetooth | WLAN
+ *  0  | Hardware  | Hardware
+ *  1  | Hardware  | Software
+ *  4  | Software  | Software
  */
 static uint wapf = 1;
 module_param(wapf, uint, 0444);
index 0580d99b0798e9bf68f03cd8877bf07a141dff94..b0859d4183e8307d27ef9c3979bf613d4548c603 100644 (file)
@@ -38,6 +38,24 @@ MODULE_LICENSE("GPL");
 
 MODULE_ALIAS("wmi:"ASUS_NB_WMI_EVENT_GUID);
 
+/*
+ * WAPF defines the behavior of the Fn+Fx wlan key
+ * The significance of values is yet to be found, but
+ * most of the time:
+ * Bit | Bluetooth | WLAN
+ *  0  | Hardware  | Hardware
+ *  1  | Hardware  | Software
+ *  4  | Software  | Software
+ */
+static uint wapf;
+module_param(wapf, uint, 0444);
+MODULE_PARM_DESC(wapf, "WAPF value");
+
+static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)
+{
+       driver->wapf = wapf;
+}
+
 static const struct key_entry asus_nb_wmi_keymap[] = {
        { KE_KEY, 0x30, { KEY_VOLUMEUP } },
        { KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
@@ -53,16 +71,16 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
        { KE_KEY, 0x51, { KEY_WWW } },
        { KE_KEY, 0x55, { KEY_CALC } },
        { KE_KEY, 0x5C, { KEY_F15 } },  /* Power Gear key */
-       { KE_KEY, 0x5D, { KEY_WLAN } },
-       { KE_KEY, 0x5E, { KEY_WLAN } },
-       { KE_KEY, 0x5F, { KEY_WLAN } },
+       { 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, 0x61, { KEY_SWITCHVIDEOMODE } },
        { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } },
        { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } },
        { KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
-       { KE_KEY, 0x7E, { KEY_BLUETOOTH } },
        { KE_KEY, 0x7D, { KEY_BLUETOOTH } },
+       { KE_KEY, 0x7E, { KEY_BLUETOOTH } },
        { KE_KEY, 0x82, { KEY_CAMERA } },
        { KE_KEY, 0x88, { KEY_RFKILL  } },
        { KE_KEY, 0x8A, { KEY_PROG1 } },
@@ -81,6 +99,7 @@ static struct asus_wmi_driver asus_nb_wmi_driver = {
        .keymap = asus_nb_wmi_keymap,
        .input_name = "Asus WMI hotkeys",
        .input_phys = ASUS_NB_WMI_FILE "/input0",
+       .quirks = asus_nb_wmi_quirks,
 };
 
 
index 3b9fb91e25ff55c4d2dadb7267cb812f06252805..8787dfacf11de88207f20920844b003bdef30666 100644 (file)
@@ -1413,6 +1413,12 @@ static int asus_wmi_platform_init(struct asus_wmi *asus)
                return -ENODEV;
        }
 
+       /* CWAP allow to define the behavior of the Fn+F2 key,
+        * this method doesn't seems to be present on Eee PCs */
+       if (asus->driver->wapf >= 0)
+               asus_wmi_set_devstate(ASUS_WMI_DEVID_CWAP,
+                                     asus->driver->wapf, NULL);
+
        return asus_wmi_sysfs_init(asus->platform_device);
 }
 
index 4da61033bcb93fc297159ab41be8b8633f6f8985..8147c10161cc590d729c2afcfc03c43df7df3e1f 100644 (file)
@@ -37,6 +37,7 @@ struct asus_wmi;
 
 struct asus_wmi_driver {
        bool                    hotplug_wireless;
+       int                     wapf;
 
        const char              *name;
        struct module           *owner;
index f41a977efa94358555171d82bacc9895684908fe..9f6e64302b457b04fb0871524e9ac906af34399f 100644 (file)
@@ -166,6 +166,7 @@ static void eeepc_dmi_check(struct asus_wmi_driver *driver)
 static void eeepc_wmi_quirks(struct asus_wmi_driver *driver)
 {
        driver->hotplug_wireless = hotplug_wireless;
+       driver->wapf = -1;
        eeepc_dmi_check(driver);
 }