asus-wmi: move WAPF variable into quirks_entry
authorCorentin Chary <corentin.chary@gmail.com>
Tue, 20 Mar 2012 08:53:10 +0000 (09:53 +0100)
committerMatthew Garrett <mjg@redhat.com>
Mon, 26 Mar 2012 19:05:44 +0000 (15:05 -0400)
Some models work better with different values of wapf, so move the
variable into quriks_entry to make it more easy to give a specific
value to different models.

Based on original patch from AceLan Kao <acelan.kao@canonical.com>

Cc: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
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 1aea6b8019be515b6590968082447eb1262e05aa..b12038c492c7ef604fc36a70cd4f4e9759b6e172 100644 (file)
@@ -51,9 +51,13 @@ static uint wapf;
 module_param(wapf, uint, 0444);
 MODULE_PARM_DESC(wapf, "WAPF value");
 
+static struct quirk_entry quirk_asus_unknown = {
+};
+
 static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)
 {
-       driver->wapf = wapf;
+       driver->quirks = &quirk_asus_unknown;
+       driver->quirks->wapf = wapf;
 }
 
 static const struct key_entry asus_nb_wmi_keymap[] = {
index c4ad76ee7b5fde942441a4ad94f50a3ec6b0cf60..ff9cfd83b09f0d0800154d01450bdddf900c7353 100644 (file)
@@ -1471,9 +1471,9 @@ static int asus_wmi_platform_init(struct asus_wmi *asus)
 
        /* 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)
+       if (asus->driver->quirks->wapf >= 0)
                asus_wmi_set_devstate(ASUS_WMI_DEVID_CWAP,
-                                     asus->driver->wapf, NULL);
+                                     asus->driver->quirks->wapf, NULL);
 
        return asus_wmi_sysfs_init(asus->platform_device);
 }
index 35003e4f131671db2d7989e8fbc20211f8b104d3..d43b66742004bae8cc0a819ca082a5e1065ef51f 100644 (file)
@@ -39,10 +39,10 @@ struct quirk_entry {
        bool hotplug_wireless;
        bool scalar_panel_brightness;
        bool store_backlight_power;
+       int wapf;
 };
 
 struct asus_wmi_driver {
-       int                     wapf;
        int                     brightness;
        int                     panel_power;
 
index 9f8ccf9f590d96b106e8c8bb83be08246a471c16..389ff888cb6c5a78c4b775c76a884137f56d8d7c 100644 (file)
@@ -209,10 +209,10 @@ static int eeepc_wmi_probe(struct platform_device *pdev)
 
 static void eeepc_wmi_quirks(struct asus_wmi_driver *driver)
 {
-       driver->wapf = -1;
        driver->panel_power = FB_BLANK_UNBLANK;
        driver->quirks = &quirk_asus_unknown;
        driver->quirks->hotplug_wireless = hotplug_wireless;
+       driver->quirks->wapf = -1;
        dmi_check_system(asus_quirks);
        driver->quirks = quirks;
 }