linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@suse.de>
To: mjg@redhat.com
Cc: mzxreary@0pointer.de, rpurdie@linux.intel.com, jlee@novell.com,
	linux-kernel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org, greg@kroah.com,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 3/4] msi-laptop: Set rfkill init state when msi-laptop intiial
Date: Wed, 12 May 2010 09:58:09 -0700	[thread overview]
Message-ID: <1273683490-27090-3-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <20100512141149.GB20564@kroah.com>

From: Lee, Chun-Yi <jlee@novell.com>

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>
---
 drivers/platform/x86/msi-laptop.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index 45197d7..34bec2e 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -581,11 +581,31 @@ static void rfkill_cleanup(void)
 	}
 }
 
+static void msi_init_rfkill(struct work_struct *ignored)
+{
+	if (rfk_wlan) {
+		rfkill_set_sw_state(rfk_wlan, !wlan_s);
+		rfkill_wlan_set(NULL, !wlan_s);
+	}
+	if (rfk_bluetooth) {
+		rfkill_set_sw_state(rfk_bluetooth, !bluetooth_s);
+		rfkill_bluetooth_set(NULL, !bluetooth_s);
+	}
+	if (rfk_threeg) {
+		rfkill_set_sw_state(rfk_threeg, !threeg_s);
+		rfkill_threeg_set(NULL, !threeg_s);
+	}
+}
+static DECLARE_DELAYED_WORK(msi_rfkill_init, msi_init_rfkill);
+
 static int rfkill_init(struct platform_device *sdev)
 {
 	/* add rfkill */
 	int retval;
 
+	/* keep the hardware wireless state */
+	get_wireless_state_ec_standard();
+
 	rfk_bluetooth = rfkill_alloc("msi-bluetooth", &sdev->dev,
 				RFKILL_TYPE_BLUETOOTH,
 				&rfkill_bluetooth_ops, NULL);
@@ -619,6 +639,10 @@ static int rfkill_init(struct platform_device *sdev)
 			goto err_threeg;
 	}
 
+	/* schedule to run rfkill state initial */
+	schedule_delayed_work(&msi_rfkill_init,
+				round_jiffies_relative(1 * HZ));
+
 	return 0;
 
 err_threeg:
-- 
1.7.1


  parent reply	other threads:[~2010-05-12 16:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100512141149.GB20564@kroah.com>
2010-05-12 16:58 ` [PATCH 1/4] msi-laptop: Add N014 N051 dmi information to scm models table Greg Kroah-Hartman
2010-05-12 16:58 ` [PATCH 2/4] msi-laptop: Add MSI CR620 notebook " Greg Kroah-Hartman
2010-05-12 16:58 ` Greg Kroah-Hartman [this message]
2010-05-12 16:58 ` [PATCH 4/4] msi-laptop: Add i8042 filter to sync sw state with BIOS when function key pressed Greg Kroah-Hartman
2010-05-12 17:33   ` Dmitry Torokhov
2010-05-12 18:55     ` Greg KH
2010-05-12 18:56     ` Greg KH
2010-05-13  7:52       ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1273683490-27090-3-git-send-email-gregkh@suse.de \
    --to=gregkh@suse.de \
    --cc=greg@kroah.com \
    --cc=jlee@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg@redhat.com \
    --cc=mzxreary@0pointer.de \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rpurdie@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).