From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mario Limonciello Date: Wed, 01 Jul 2009 17:12:55 +0000 Subject: Re: [PATCH] Explicitly disable BT radio using rfkill interface on Message-Id: <4A4B9917.1020900@dell.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------enig74D674F223C20B19E45E75CF" List-Id: References: <4A4A8B6D.3060509@dell.com> In-Reply-To: <4A4A8B6D.3060509@dell.com> To: linux-hotplug@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig74D674F223C20B19E45E75CF Content-Type: multipart/mixed; boundary="------------060501000104080802000309" This is a multi-part message in MIME format. --------------060501000104080802000309 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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. > > =20 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. --=20 Mario Limonciello *Dell | Linux Engineering* mario_limonciello@dell.com --------------060501000104080802000309 Content-Type: text/x-patch; name="0001-Explicitly-disable-BT-radio-using-rfkill-interface-o.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename*0="0001-Explicitly-disable-BT-radio-using-rfkill-interface-o.pa"; filename*1="tch" =46rom 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 su= spend. 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/de= ll-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_st= ate state) return 0; } =20 +static int dell_rfkill_suspend(struct device *dev, pm_message_t state) +{ + struct rfkill *rfkill =3D to_rfkill(dev); + + /* store state for the resume handler */ + rfkill->state_for_resume =3D 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 !=3D state.event) + dev->power.power_state =3D 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 =3D "dell-bluetooth"; bluetooth_rfkill->toggle_radio =3D dell_bluetooth_set; bluetooth_rfkill->get_state =3D dell_bluetooth_get; + bluetooth_rfkill->dev.class->suspend =3D dell_rfkill_suspend; ret =3D rfkill_register(bluetooth_rfkill); if (ret) goto err_bluetooth; --=20 1.5.4.3 --------------060501000104080802000309-- --------------enig74D674F223C20B19E45E75CF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkpLmRoACgkQ2CrZjkA73Yvt0ACfUchWw2zqRPQ8rpmXqyZG/pfj OHQAmQF4ZfFRe1afyP5KnYerVjkNXb1h =lLdg -----END PGP SIGNATURE----- --------------enig74D674F223C20B19E45E75CF--