From patchwork Mon May 18 20:12:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 24624 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4IKE9k1017180 for ; Mon, 18 May 2009 20:14:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754314AbZERUMV (ORCPT ); Mon, 18 May 2009 16:12:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755050AbZERUMV (ORCPT ); Mon, 18 May 2009 16:12:21 -0400 Received: from ausc60ps301.us.dell.com ([143.166.148.206]:58861 "EHLO ausc60ps301.us.dell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754930AbZERUMS (ORCPT ); Mon, 18 May 2009 16:12:18 -0400 X-Loopcount0: from 10.9.160.254 Message-ID: <4A11C126.1000704@dell.com> Date: Mon, 18 May 2009 15:12:22 -0500 From: Mario Limonciello User-Agent: Thunderbird 2.0.0.21 (X11/20090409) MIME-Version: 1.0 To: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org CC: Matthew Garrett Subject: [PATCH] Explicitly disable BT radio using rfkill interface on suspend X-Enigmail-Version: 0.95.7 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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. From ab8b8ad20dede82f9d13293e94e76b4dd360fcf4 Mon Sep 17 00:00:00 2001 From: Mario Limonciello 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