diff options
-rw-r--r-- | drivers/platform/x86/eeepc-laptop.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 749e2102b2be..d379e74a05d0 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c | |||
@@ -150,6 +150,8 @@ struct eeepc_hotk { | |||
150 | /* The actual device the driver binds to */ | 150 | /* The actual device the driver binds to */ |
151 | static struct eeepc_hotk *ehotk; | 151 | static struct eeepc_hotk *ehotk; |
152 | 152 | ||
153 | static void eeepc_rfkill_hotplug(bool real); | ||
154 | |||
153 | /* Platform device/driver */ | 155 | /* Platform device/driver */ |
154 | static int eeepc_hotk_thaw(struct device *device); | 156 | static int eeepc_hotk_thaw(struct device *device); |
155 | static int eeepc_hotk_restore(struct device *device); | 157 | static int eeepc_hotk_restore(struct device *device); |
@@ -343,14 +345,23 @@ static bool eeepc_wlan_rfkill_blocked(void) | |||
343 | static int eeepc_rfkill_set(void *data, bool blocked) | 345 | static int eeepc_rfkill_set(void *data, bool blocked) |
344 | { | 346 | { |
345 | unsigned long asl = (unsigned long)data; | 347 | unsigned long asl = (unsigned long)data; |
346 | return set_acpi(asl, !blocked); | 348 | int ret; |
349 | |||
350 | if (asl != CM_ASL_WLAN) | ||
351 | return set_acpi(asl, !blocked); | ||
352 | |||
353 | /* hack to avoid panic with rt2860sta */ | ||
354 | if (blocked) | ||
355 | eeepc_rfkill_hotplug(false); | ||
356 | ret = set_acpi(asl, !blocked); | ||
357 | return ret; | ||
347 | } | 358 | } |
348 | 359 | ||
349 | static const struct rfkill_ops eeepc_rfkill_ops = { | 360 | static const struct rfkill_ops eeepc_rfkill_ops = { |
350 | .set_block = eeepc_rfkill_set, | 361 | .set_block = eeepc_rfkill_set, |
351 | }; | 362 | }; |
352 | 363 | ||
353 | static void __init eeepc_enable_camera(void) | 364 | static void __devinit eeepc_enable_camera(void) |
354 | { | 365 | { |
355 | /* | 366 | /* |
356 | * If the following call to set_acpi() fails, it's because there's no | 367 | * If the following call to set_acpi() fails, it's because there's no |
@@ -643,13 +654,13 @@ static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot, | |||
643 | return 0; | 654 | return 0; |
644 | } | 655 | } |
645 | 656 | ||
646 | static void eeepc_rfkill_hotplug(void) | 657 | static void eeepc_rfkill_hotplug(bool real) |
647 | { | 658 | { |
648 | struct pci_dev *dev; | 659 | struct pci_dev *dev; |
649 | struct pci_bus *bus; | 660 | struct pci_bus *bus; |
650 | bool blocked = eeepc_wlan_rfkill_blocked(); | 661 | bool blocked = real ? eeepc_wlan_rfkill_blocked() : true; |
651 | 662 | ||
652 | if (ehotk->wlan_rfkill) | 663 | if (real && ehotk->wlan_rfkill) |
653 | rfkill_set_sw_state(ehotk->wlan_rfkill, blocked); | 664 | rfkill_set_sw_state(ehotk->wlan_rfkill, blocked); |
654 | 665 | ||
655 | mutex_lock(&ehotk->hotplug_lock); | 666 | mutex_lock(&ehotk->hotplug_lock); |
@@ -692,7 +703,7 @@ static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data) | |||
692 | if (event != ACPI_NOTIFY_BUS_CHECK) | 703 | if (event != ACPI_NOTIFY_BUS_CHECK) |
693 | return; | 704 | return; |
694 | 705 | ||
695 | eeepc_rfkill_hotplug(); | 706 | eeepc_rfkill_hotplug(true); |
696 | } | 707 | } |
697 | 708 | ||
698 | static void eeepc_hotk_notify(struct acpi_device *device, u32 event) | 709 | static void eeepc_hotk_notify(struct acpi_device *device, u32 event) |
@@ -850,7 +861,7 @@ static int eeepc_hotk_restore(struct device *device) | |||
850 | { | 861 | { |
851 | /* Refresh both wlan rfkill state and pci hotplug */ | 862 | /* Refresh both wlan rfkill state and pci hotplug */ |
852 | if (ehotk->wlan_rfkill) | 863 | if (ehotk->wlan_rfkill) |
853 | eeepc_rfkill_hotplug(); | 864 | eeepc_rfkill_hotplug(true); |
854 | 865 | ||
855 | if (ehotk->bluetooth_rfkill) | 866 | if (ehotk->bluetooth_rfkill) |
856 | rfkill_set_sw_state(ehotk->bluetooth_rfkill, | 867 | rfkill_set_sw_state(ehotk->bluetooth_rfkill, |
@@ -993,7 +1004,7 @@ static void eeepc_rfkill_exit(void) | |||
993 | * Refresh pci hotplug in case the rfkill state was changed after | 1004 | * Refresh pci hotplug in case the rfkill state was changed after |
994 | * eeepc_unregister_rfkill_notifier() | 1005 | * eeepc_unregister_rfkill_notifier() |
995 | */ | 1006 | */ |
996 | eeepc_rfkill_hotplug(); | 1007 | eeepc_rfkill_hotplug(true); |
997 | if (ehotk->hotplug_slot) | 1008 | if (ehotk->hotplug_slot) |
998 | pci_hp_deregister(ehotk->hotplug_slot); | 1009 | pci_hp_deregister(ehotk->hotplug_slot); |
999 | 1010 | ||
@@ -1109,7 +1120,7 @@ static int eeepc_rfkill_init(struct device *dev) | |||
1109 | * Refresh pci hotplug in case the rfkill state was changed during | 1120 | * Refresh pci hotplug in case the rfkill state was changed during |
1110 | * setup. | 1121 | * setup. |
1111 | */ | 1122 | */ |
1112 | eeepc_rfkill_hotplug(); | 1123 | eeepc_rfkill_hotplug(true); |
1113 | 1124 | ||
1114 | exit: | 1125 | exit: |
1115 | if (result && result != -ENODEV) | 1126 | if (result && result != -ENODEV) |
@@ -1189,7 +1200,7 @@ static int eeepc_input_init(struct device *dev) | |||
1189 | return 0; | 1200 | return 0; |
1190 | } | 1201 | } |
1191 | 1202 | ||
1192 | static int eeepc_hotk_add(struct acpi_device *device) | 1203 | static int __devinit eeepc_hotk_add(struct acpi_device *device) |
1193 | { | 1204 | { |
1194 | struct device *dev; | 1205 | struct device *dev; |
1195 | int result; | 1206 | int result; |