public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dell-laptop: Add hwswitch_only module parameter
@ 2010-10-07  3:30 Keng-Yu Lin
  2010-10-07 11:15 ` Matthew Garrett
  0 siblings, 1 reply; 20+ messages in thread
From: Keng-Yu Lin @ 2010-10-07  3:30 UTC (permalink / raw)
  To: mjg59, len.brown, alan-jenkins, superm1, platform-driver-x86,
	linux-kernel
  Cc: Keng-Yu Lin

Some BIOS does not report the correct state of the wireless killswitch
in the return value of SMI Class 17, Select 11.

This causes the killswitch to always stay as soft-blocked once the rfkill
hotkey is pressed.

This patch adds a module parameter to work around this by disregarding
the software rfkill and using only Bit 16 in the return value of
SMI Class 17, Select 11 as the hardware killswitch.

Signed-off-by: Keng-Yu Lin <keng-yu.lin@canonical.com>
---
 drivers/platform/x86/dell-laptop.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

 This patch is intended to work around the buggy BIOS.

diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 4413975..a105d7e 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -74,6 +74,8 @@ static struct rfkill *wifi_rfkill;
 static struct rfkill *bluetooth_rfkill;
 static struct rfkill *wwan_rfkill;
 
+static bool hwswitch_only;
+
 static const struct dmi_system_id __initdata dell_device_table[] = {
 	{
 		.ident = "Dell laptop",
@@ -314,7 +316,8 @@ static void dell_rfkill_query(struct rfkill *rfkill, void *data)
 	status = buffer->output[1];
 	release_buffer();
 
-	rfkill_set_sw_state(rfkill, !!(status & BIT(bit)));
+	if (!hwswitch_only)
+		rfkill_set_sw_state(rfkill, !!(status & BIT(bit)));
 
 	if (hwswitch_state & (BIT(hwswitch_bit)))
 		rfkill_set_hw_state(rfkill, !(status & BIT(16)));
@@ -630,6 +633,9 @@ static void __exit dell_exit(void)
 module_init(dell_init);
 module_exit(dell_exit);
 
+module_param(hwswitch_only, bool, 0644);
+MODULE_PARM_DESC(hwswitch_only, "Use the hardware rfkill only");
+
 MODULE_AUTHOR("Matthew Garrett <mjg@redhat.com>");
 MODULE_DESCRIPTION("Dell laptop driver");
 MODULE_LICENSE("GPL");
-- 
1.7.1


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

end of thread, other threads:[~2010-10-07 21:59 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-07  3:30 [PATCH] dell-laptop: Add hwswitch_only module parameter Keng-Yu Lin
2010-10-07 11:15 ` Matthew Garrett
     [not found]   ` <AANLkTinus8SxbXt14qabXgpbFXF4U+uNoKA-=eDuOjmp@mail.gmail.com>
2010-10-07 13:35     ` Matthew Garrett
2010-10-07 20:49       ` Mario Limonciello
2010-10-07 20:50         ` Matthew Garrett
2010-10-07 20:53           ` Mario Limonciello
2010-10-07 21:24             ` Matthew Garrett
2010-10-07 21:30             ` Dmitry Torokhov
2010-10-07 21:33               ` Mario Limonciello
2010-10-07 21:37               ` Matthew Garrett
2010-10-07 21:41                 ` Mario Limonciello
2010-10-07 21:42                   ` Matthew Garrett
2010-10-07 21:45                     ` Mario Limonciello
2010-10-07 21:49                       ` Matthew Garrett
2010-10-07 21:52                         ` Mario Limonciello
2010-10-07 21:46                 ` Dmitry Torokhov
2010-10-07 21:49                   ` Mario Limonciello
2010-10-07 21:50                   ` Matthew Garrett
2010-10-07 21:57                     ` Mario Limonciello
2010-10-07 21:58                     ` Dmitry Torokhov

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