aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLee, Chun-Yi <joeyli.kernel@gmail.com>2011-03-28 06:34:13 -0400
committerMatthew Garrett <mjg@redhat.com>2011-03-28 06:46:14 -0400
commit70a9b9047aebd53ac38837a1046da52a2f8d9636 (patch)
treeab330fa52aa8f3a9dda1e7ce27b923913e0c1d90 /drivers
parent8215af019040ce9182728afee9642d8fdeb17f59 (diff)
acer-wmi: does not poll device status when WMI event is available
Acer WMI hotkey event's result include current device status, just need sync the status to killswitch after acer-wmi driver receive hotkey event but not always poll device status. This is good for performance. But, if use EC raw mode, Acer BIOS will not emit wmi event and leave EC to control device status. So, still startup polling job when doesn't detect WMI event GUID or user choice to use ec_raw_mode. Tested on Acer TravelMate 8572 notebook. Cc: Carlos Corbacho <carlos@strangeworlds.co.uk> Cc: Matthew Garrett <mjg@redhat.com> Cc: Dmitry Torokhov <dtor@mail.ru> Cc: Corentin Chary <corentincj@iksaif.net> Cc: Thomas Renninger <trenn@suse.de> Signed-off-by: Lee, Chun-Yi <jlee@novell.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/platform/x86/acer-wmi.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 652a84ec36cf..5ea6c3477d17 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -1234,14 +1234,17 @@ static int acer_rfkill_init(struct device *dev)
1234 1234
1235 rfkill_inited = true; 1235 rfkill_inited = true;
1236 1236
1237 schedule_delayed_work(&acer_rfkill_work, round_jiffies_relative(HZ)); 1237 if (ec_raw_mode || !wmi_has_guid(ACERWMID_EVENT_GUID))
1238 schedule_delayed_work(&acer_rfkill_work,
1239 round_jiffies_relative(HZ));
1238 1240
1239 return 0; 1241 return 0;
1240} 1242}
1241 1243
1242static void acer_rfkill_exit(void) 1244static void acer_rfkill_exit(void)
1243{ 1245{
1244 cancel_delayed_work_sync(&acer_rfkill_work); 1246 if (ec_raw_mode || !wmi_has_guid(ACERWMID_EVENT_GUID))
1247 cancel_delayed_work_sync(&acer_rfkill_work);
1245 1248
1246 rfkill_unregister(wireless_rfkill); 1249 rfkill_unregister(wireless_rfkill);
1247 rfkill_destroy(wireless_rfkill); 1250 rfkill_destroy(wireless_rfkill);
@@ -1338,6 +1341,19 @@ static void acer_wmi_notify(u32 value, void *context)
1338 1341
1339 switch (return_value.function) { 1342 switch (return_value.function) {
1340 case WMID_HOTKEY_EVENT: 1343 case WMID_HOTKEY_EVENT:
1344 if (return_value.device_state) {
1345 u16 device_state = return_value.device_state;
1346 pr_debug("deivces states: 0x%x\n", device_state);
1347 if (has_cap(ACER_CAP_WIRELESS))
1348 rfkill_set_sw_state(wireless_rfkill,
1349 !(device_state & ACER_WMID3_GDS_WIRELESS));
1350 if (has_cap(ACER_CAP_BLUETOOTH))
1351 rfkill_set_sw_state(bluetooth_rfkill,
1352 !(device_state & ACER_WMID3_GDS_BLUETOOTH));
1353 if (has_cap(ACER_CAP_THREEG))
1354 rfkill_set_sw_state(threeg_rfkill,
1355 !(device_state & ACER_WMID3_GDS_THREEG));
1356 }
1341 if (!sparse_keymap_report_event(acer_wmi_input_dev, 1357 if (!sparse_keymap_report_event(acer_wmi_input_dev,
1342 return_value.key_num, 1, true)) 1358 return_value.key_num, 1, true))
1343 pr_warning("Unknown key number - 0x%x\n", 1359 pr_warning("Unknown key number - 0x%x\n",