linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mario Limonciello <mario_limonciello@dell.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] Explicitly disable BT radio using rfkill interface on
Date: Wed, 01 Jul 2009 17:12:55 +0000	[thread overview]
Message-ID: <4A4B9917.1020900@dell.com> (raw)
In-Reply-To: <4A4A8B6D.3060509@dell.com>


[-- Attachment #1.1: Type: text/plain, Size: 492 bytes --]

Hi Marcel:

Marcel Holtmann wrote:
>
> you know that we re-wrote RFKILL completely. You can kill a Bluetooth
> device from within the kernel. And this looks like a hardkill of the
> Bluetooth interface.
>
>   
That's pretty similar to what I was trying to accomplish with the
original patch that started all of this discussion.  I'll attach that
original patch so you can see what I'm talking about.
-- 
Mario Limonciello
*Dell | Linux Engineering*
mario_limonciello@dell.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-Explicitly-disable-BT-radio-using-rfkill-interface-o.patch --]
[-- Type: text/x-patch; name="0001-Explicitly-disable-BT-radio-using-rfkill-interface-o.patch", Size: 1842 bytes --]

From ab8b8ad20dede82f9d13293e94e76b4dd360fcf4 Mon Sep 17 00:00:00 2001
From: Mario Limonciello <Mario_Limonciello@Dell.com>
Date: Mon, 18 May 2009 21:07:59 +0100
Subject: [PATCH] Explicitly disable BT radio using rfkill interface on suspend.
 Dell BT devices need to be removed from the bus and reinserted
 so that userspace udev rules can transition the devices into the
 proper mode after S3 or S4.

---
 drivers/platform/x86/dell-laptop.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index af9f430..90a3d7c 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -186,6 +186,24 @@ static int dell_rfkill_set(int radio, enum rfkill_state state)
 	return 0;
 }
 
+static int dell_rfkill_suspend(struct device *dev, pm_message_t state)
+{
+	struct rfkill *rfkill = to_rfkill(dev);
+
+	/* store state for the resume handler */
+	rfkill->state_for_resume = rfkill->state;
+
+	/* kill radio explicitly if it's on. it needs proper
+	 * reinitialization post suspend */
+	rfkill->toggle_radio(NULL,RFKILL_STATE_SOFT_BLOCKED);
+
+	/* mark class device as suspended */
+	if (dev->power.power_state.event != state.event)
+		dev->power.power_state = state;
+
+	return 0;
+}
+
 static int dell_wifi_set(void *data, enum rfkill_state state)
 {
 	return dell_rfkill_set(1, state);
@@ -266,6 +284,7 @@ static int dell_setup_rfkill(void)
 		bluetooth_rfkill->name = "dell-bluetooth";
 		bluetooth_rfkill->toggle_radio = dell_bluetooth_set;
 		bluetooth_rfkill->get_state = dell_bluetooth_get;
+		bluetooth_rfkill->dev.class->suspend = dell_rfkill_suspend;
 		ret = rfkill_register(bluetooth_rfkill);
 		if (ret)
 			goto err_bluetooth;
-- 
1.5.4.3


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  parent reply	other threads:[~2009-07-01 17:12 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-30 22:02 [PATCH] Explicitly disable BT radio using rfkill interface on Mario Limonciello
2009-06-30 22:26 ` Kay Sievers
2009-07-01  3:53 ` [PATCH] Explicitly disable BT radio using rfkill interface on suspend Mario_Limonciello
2009-07-01 12:06 ` [PATCH] Explicitly disable BT radio using rfkill interface on Marcel Holtmann
2009-07-01 13:13 ` [PATCH] Explicitly disable BT radio using rfkill interface on suspend Mario_Limonciello
2009-07-01 15:03 ` [PATCH] Explicitly disable BT radio using rfkill interface on Marcel Holtmann
2009-07-01 17:12 ` Mario Limonciello [this message]
2009-07-01 17:18 ` Matthew Garrett
2009-07-01 22:13 ` Marcel Holtmann
2009-07-01 22:16 ` Matthew Garrett
2009-07-01 22:23 ` Mario Limonciello
2009-07-01 22:49 ` Marcel Holtmann
2009-07-01 22:52 ` Matthew Garrett
2009-07-02 14:02 ` Alan Stern
2009-07-10 14:46 ` Alan Stern
2009-07-14 16:40 ` Mario Limonciello
2009-07-14 16:51 ` Alan Stern
2009-07-14 16:52 ` Kay Sievers
2009-07-14 17:32 ` Mario Limonciello
2009-07-14 18:46 ` Marcel Holtmann
2009-07-14 19:12 ` Kay Sievers
2009-07-14 21:00 ` Mario Limonciello
2009-07-14 21:20 ` Marcel Holtmann
2009-07-14 21:24 ` Kay Sievers
2009-07-14 22:45 ` Kay Sievers
2009-07-15  2:07 ` Alan Stern
2009-07-15  2:26 ` Kay Sievers
2009-07-15 22:15 ` Mario Limonciello
2009-07-15 22:24 ` Mario Limonciello
2009-07-15 23:27 ` Kay Sievers

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=4A4B9917.1020900@dell.com \
    --to=mario_limonciello@dell.com \
    --cc=linux-hotplug@vger.kernel.org \
    /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).