diff options
author | Corentin Chary <corentin.chary@gmail.com> | 2012-03-20 04:53:10 -0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2012-03-26 15:05:44 -0400 |
commit | 6a2bcccdb3206950d28e343476d9050e23e79b7e (patch) | |
tree | 2ee2cdd1b1290875b4ef18322d6d81ff16d1ccd1 /drivers/platform | |
parent | 6e0044bedc1fc94a61cc32fa25dcab9a4e4a9218 (diff) |
asus-wmi: move WAPF variable into quirks_entry
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>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/asus-nb-wmi.c | 6 | ||||
-rw-r--r-- | drivers/platform/x86/asus-wmi.c | 4 | ||||
-rw-r--r-- | drivers/platform/x86/asus-wmi.h | 2 | ||||
-rw-r--r-- | drivers/platform/x86/eeepc-wmi.c | 2 |
4 files changed, 9 insertions, 5 deletions
diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c index 1aea6b8019be..b12038c492c7 100644 --- a/drivers/platform/x86/asus-nb-wmi.c +++ b/drivers/platform/x86/asus-nb-wmi.c | |||
@@ -51,9 +51,13 @@ static uint wapf; | |||
51 | module_param(wapf, uint, 0444); | 51 | module_param(wapf, uint, 0444); |
52 | MODULE_PARM_DESC(wapf, "WAPF value"); | 52 | MODULE_PARM_DESC(wapf, "WAPF value"); |
53 | 53 | ||
54 | static struct quirk_entry quirk_asus_unknown = { | ||
55 | }; | ||
56 | |||
54 | static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver) | 57 | static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver) |
55 | { | 58 | { |
56 | driver->wapf = wapf; | 59 | driver->quirks = &quirk_asus_unknown; |
60 | driver->quirks->wapf = wapf; | ||
57 | } | 61 | } |
58 | 62 | ||
59 | static const struct key_entry asus_nb_wmi_keymap[] = { | 63 | static const struct key_entry asus_nb_wmi_keymap[] = { |
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index c4ad76ee7b5f..ff9cfd83b09f 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c | |||
@@ -1471,9 +1471,9 @@ static int asus_wmi_platform_init(struct asus_wmi *asus) | |||
1471 | 1471 | ||
1472 | /* CWAP allow to define the behavior of the Fn+F2 key, | 1472 | /* CWAP allow to define the behavior of the Fn+F2 key, |
1473 | * this method doesn't seems to be present on Eee PCs */ | 1473 | * this method doesn't seems to be present on Eee PCs */ |
1474 | if (asus->driver->wapf >= 0) | 1474 | if (asus->driver->quirks->wapf >= 0) |
1475 | asus_wmi_set_devstate(ASUS_WMI_DEVID_CWAP, | 1475 | asus_wmi_set_devstate(ASUS_WMI_DEVID_CWAP, |
1476 | asus->driver->wapf, NULL); | 1476 | asus->driver->quirks->wapf, NULL); |
1477 | 1477 | ||
1478 | return asus_wmi_sysfs_init(asus->platform_device); | 1478 | return asus_wmi_sysfs_init(asus->platform_device); |
1479 | } | 1479 | } |
diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h index 35003e4f1316..d43b66742004 100644 --- a/drivers/platform/x86/asus-wmi.h +++ b/drivers/platform/x86/asus-wmi.h | |||
@@ -39,10 +39,10 @@ struct quirk_entry { | |||
39 | bool hotplug_wireless; | 39 | bool hotplug_wireless; |
40 | bool scalar_panel_brightness; | 40 | bool scalar_panel_brightness; |
41 | bool store_backlight_power; | 41 | bool store_backlight_power; |
42 | int wapf; | ||
42 | }; | 43 | }; |
43 | 44 | ||
44 | struct asus_wmi_driver { | 45 | struct asus_wmi_driver { |
45 | int wapf; | ||
46 | int brightness; | 46 | int brightness; |
47 | int panel_power; | 47 | int panel_power; |
48 | 48 | ||
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c index 9f8ccf9f590d..389ff888cb6c 100644 --- a/drivers/platform/x86/eeepc-wmi.c +++ b/drivers/platform/x86/eeepc-wmi.c | |||
@@ -209,10 +209,10 @@ static int eeepc_wmi_probe(struct platform_device *pdev) | |||
209 | 209 | ||
210 | static void eeepc_wmi_quirks(struct asus_wmi_driver *driver) | 210 | static void eeepc_wmi_quirks(struct asus_wmi_driver *driver) |
211 | { | 211 | { |
212 | driver->wapf = -1; | ||
213 | driver->panel_power = FB_BLANK_UNBLANK; | 212 | driver->panel_power = FB_BLANK_UNBLANK; |
214 | driver->quirks = &quirk_asus_unknown; | 213 | driver->quirks = &quirk_asus_unknown; |
215 | driver->quirks->hotplug_wireless = hotplug_wireless; | 214 | driver->quirks->hotplug_wireless = hotplug_wireless; |
215 | driver->quirks->wapf = -1; | ||
216 | dmi_check_system(asus_quirks); | 216 | dmi_check_system(asus_quirks); |
217 | driver->quirks = quirks; | 217 | driver->quirks = quirks; |
218 | } | 218 | } |