aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorLee, Chun-Yi <jlee@novell.com>2010-05-12 12:58:09 -0400
committerMatthew Garrett <mjg@redhat.com>2010-05-20 09:30:20 -0400
commit3bb970214fce6495573843e4b7b786f8ea94cd70 (patch)
tree062c55b47cbd0c23a8930b5389ba3026986aab04 /drivers/platform
parent1f27e17bfa2ad34a2dbb61cd097d9ecf506639df (diff)
msi-laptop: Set rfkill init state when msi-laptop intiial
Setup Wlan/Bluetooth/3G rfkill initial state to sync with the hardware state from EC 0x2e address. Signed-off-by: Lee, Chun-Yi <jlee@novell.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/msi-laptop.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index 45197d75db91..34bec2e26843 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -581,11 +581,31 @@ static void rfkill_cleanup(void)
581 } 581 }
582} 582}
583 583
584static void msi_init_rfkill(struct work_struct *ignored)
585{
586 if (rfk_wlan) {
587 rfkill_set_sw_state(rfk_wlan, !wlan_s);
588 rfkill_wlan_set(NULL, !wlan_s);
589 }
590 if (rfk_bluetooth) {
591 rfkill_set_sw_state(rfk_bluetooth, !bluetooth_s);
592 rfkill_bluetooth_set(NULL, !bluetooth_s);
593 }
594 if (rfk_threeg) {
595 rfkill_set_sw_state(rfk_threeg, !threeg_s);
596 rfkill_threeg_set(NULL, !threeg_s);
597 }
598}
599static DECLARE_DELAYED_WORK(msi_rfkill_init, msi_init_rfkill);
600
584static int rfkill_init(struct platform_device *sdev) 601static int rfkill_init(struct platform_device *sdev)
585{ 602{
586 /* add rfkill */ 603 /* add rfkill */
587 int retval; 604 int retval;
588 605
606 /* keep the hardware wireless state */
607 get_wireless_state_ec_standard();
608
589 rfk_bluetooth = rfkill_alloc("msi-bluetooth", &sdev->dev, 609 rfk_bluetooth = rfkill_alloc("msi-bluetooth", &sdev->dev,
590 RFKILL_TYPE_BLUETOOTH, 610 RFKILL_TYPE_BLUETOOTH,
591 &rfkill_bluetooth_ops, NULL); 611 &rfkill_bluetooth_ops, NULL);
@@ -619,6 +639,10 @@ static int rfkill_init(struct platform_device *sdev)
619 goto err_threeg; 639 goto err_threeg;
620 } 640 }
621 641
642 /* schedule to run rfkill state initial */
643 schedule_delayed_work(&msi_rfkill_init,
644 round_jiffies_relative(1 * HZ));
645
622 return 0; 646 return 0;
623 647
624err_threeg: 648err_threeg: