Re: [PATCH 1/1] toshiba_acpi: Add support for bluetooth toggling through rfkill (v7)

Previous thread: [PATCH 4/4] x86: Add sysfs entries for UV by Russ Anderson on Friday, August 22, 2008 - 2:55 pm. (2 messages)

Next thread: Patch: Correct Sierra Wireless USB EVDO Modem Device ID by Tony Murray on Friday, August 22, 2008 - 3:30 pm. (1 message)
From: philipl
Date: Friday, August 22, 2008 - 3:23 pm

There's been a patch floating around for toshiba_acpi that exports an ad-hoc
/proc interface to toggle the bluetooth adapter in a large number of Toshiba
laptops. I'm not sure if it's still relevant for the latest models, but it is
still required for older models such as my Tecra M3.

This change pulls in the low level Toshiba-specific code from the old patch and
sets up an rfkill device and a polled input device to track the state of the
hardware kill-switch.

Signed-off-by: Philip Langdale <philipl@overt.org>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
---
 Kconfig        |    1
 toshiba_acpi.c |  261 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 254 insertions(+), 8 deletions(-)

diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 735f5ea..047829c 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -260,6 +260,7 @@ config ACPI_ASUS
 config ACPI_TOSHIBA
 	tristate "Toshiba Laptop Extras"
 	depends on X86
+	select INPUT_POLLDEV
 	select BACKLIGHT_CLASS_DEVICE
 	---help---
 	  This driver adds support for access to certain system settings
diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
index 0a43c8e..8a649f4 100644
--- a/drivers/acpi/toshiba_acpi.c
+++ b/drivers/acpi/toshiba_acpi.c
@@ -3,6 +3,7 @@
  *
  *
  *  Copyright (C) 2002-2004 John Belmonte
+ *  Copyright (C) 2008 Philip Langdale
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -33,7 +34,7 @@
  *
  */

-#define TOSHIBA_ACPI_VERSION	"0.18"
+#define TOSHIBA_ACPI_VERSION	"0.19"
 #define PROC_INTERFACE_VERSION	1

 #include <linux/kernel.h>
@@ -42,6 +43,9 @@
 #include <linux/types.h>
 #include <linux/proc_fs.h>
 #include <linux/backlight.h>
+#include <linux/platform_device.h>
+#include <linux/rfkill.h>
+#include <linux/input-polldev.h>

 #include <asm/uaccess.h>

@@ -90,6 +94,7 @@ MODULE_LICENSE("GPL");
 ...
From: Andrew Morton
Date: Friday, August 29, 2008 - 2:12 pm

On Fri, 22 Aug 2008 18:23:45 -0400 (EDT)

ERROR: "rfkill_force_state" [drivers/acpi/toshiba_acpi.ko] undefined!
ERROR: "rfkill_free" [drivers/acpi/toshiba_acpi.ko] undefined!
ERROR: "rfkill_register" [drivers/acpi/toshiba_acpi.ko] undefined!
ERROR: "rfkill_allocate" [drivers/acpi/toshiba_acpi.ko] undefined!
ERROR: "rfkill_unregister" [drivers/acpi/toshiba_acpi.ko] undefined!

I'll stick a `select RFKILL' in there, but it'll probably blow up
in other ways.  select usually does.
--

From: Philip Langdale
Date: Friday, August 29, 2008 - 2:26 pm

On Fri, 29 Aug 2008 14:12:16 -0700, Andrew Morton

Sorry, thanks for catching that. thinkpad_acpi also just does 'select
RFKILL',
so hopefully it'll be ok.

--phil

--

From: Henrique de Moraes Holschuh
Date: Friday, August 29, 2008 - 2:32 pm

select NET
select RFKILL

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
--

Previous thread: [PATCH 4/4] x86: Add sysfs entries for UV by Russ Anderson on Friday, August 22, 2008 - 2:55 pm. (2 messages)

Next thread: Patch: Correct Sierra Wireless USB EVDO Modem Device ID by Tony Murray on Friday, August 22, 2008 - 3:30 pm. (1 message)