public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Explicitly disable BT radio using rfkill interface on suspend
@ 2009-05-18 20:12 Mario Limonciello
  2009-05-18 21:02 ` Matthew Garrett
  0 siblings, 1 reply; 25+ messages in thread
From: Mario Limonciello @ 2009-05-18 20:12 UTC (permalink / raw)
  To: linux-acpi, linux-kernel; +Cc: Matthew Garrett


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

 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(-)


Attaching patch so Exchange doesn't mangle it.
-- 
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 --]

^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2009-05-20 18:33 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-18 20:12 [PATCH] Explicitly disable BT radio using rfkill interface on suspend Mario Limonciello
2009-05-18 21:02 ` Matthew Garrett
2009-05-18 21:36   ` Mario Limonciello
2009-05-19  5:03     ` Matthew Garrett
2009-05-19  5:14       ` Marcel Holtmann
2009-05-19  6:27         ` Oliver Neukum
2009-05-19  6:45           ` Marcel Holtmann
2009-05-19  7:36             ` Oliver Neukum
2009-05-19  9:06         ` Matthew Garrett
2009-05-19 12:47           ` Oliver Neukum
2009-05-19 12:58             ` Matthew Garrett
2009-05-19 16:30               ` Mario Limonciello
2009-05-19 16:33                 ` Matthew Garrett
2009-05-19 16:52                   ` Mario Limonciello
2009-05-19 19:58                     ` Oliver Neukum
2009-05-19 20:36                       ` Mario Limonciello
2009-05-19 21:26                         ` Oliver Neukum
2009-05-19 21:47                           ` Mario Limonciello
2009-05-19 22:16                             ` Oliver Neukum
2009-05-19 22:19                               ` Mario Limonciello
2009-05-20  2:17                               ` Alan Stern
2009-05-20 12:29                                 ` Oliver Neukum
2009-05-20 14:17                                   ` Alan Stern
2009-05-20 17:52                                     ` Mario Limonciello
2009-05-20 18:31                                       ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox