toshiba_acpi: Add support for bluetooth toggling through rfkill (v6)
PATCH 1/1 toshiba_acpi: Add support for bluetooth toggling through rfkill (v6)
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.
--- Kconfig | 1 toshiba_acpi.c | 263 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
drivers/acpi/Kconfig +1 -0
@@ -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
drivers/acpi/toshiba_acpi.c +255 -8
352 lines not on this page · raw message
Hi,
drivers/acpi/toshiba_acpi.c static acpi_status hci_read1(u32 reg, u32 * out1, u32 * result) · line 377
Quoted 8 lines
drivers/acpi/toshiba_acpi.c +8
-0+if (unlikely (state_changed)) { +rfkill_force_state (dev->rfk_dev, + new_rfk_state ? +RFKILL_STATE_SOFT_BLOCKED : +RFKILL_STATE_HARD_BLOCKED ); +input_report_switch (poll_dev->input,SW_RFKILL_ALL , new_rfk_state); + } +}
This looks very nice, but is the switch really toggling between soft and hard blocked only? ;)
I mean shouldn't there be some unblock signal at some point?
Ivo
Quoted 5 lines · Ivo van Doorn
This looks very nice, but is the switch really toggling between soft and hard blocked only? ;)
I mean shouldn't there be some unblock signal at some point?
Nope :-)
There is no hardware mechanism to actually turn the bluetooth adapter on; that's
why driver support has been so important for poor toshiba users; without it the
adapter is completely useless. On windows, toshiba provide a special program to
do this as well. It's all very odd.
--phil
Signature · 4 lines
"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
Quoted 2 lines
User-Agent: Thunderbird 2.0.0.16 (X11/20080707)
uh-oh.
Quoted 31 lines · On Tue, 19 Aug 2008 20:01:22 -0700 Philip Langdale <[email protected]> wrote:
There's been a patch floating around for
toshiba_acpithat 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 <[email protected]>--- Kconfig | 1 toshiba_acpi.c | 263 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--drivers/acpi/Kconfig +1
-0@@ -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 settingsdrivers/acpi/toshiba_acpi.c +0
-0
drivers/acpi/toshiba_acpi.c line 6
Quoted 4 lines
drivers/acpi/toshiba_acpi.c +1
-0@@ -3,6 +3,7 @@* * * Copyright (C) 2002-2004 John Belmonte +* Copyright (C) 2008 Philip Langdale
your email client is performing space-stuffing. Please see Documentation/email-clients.txt.
Please pass the patch through scripts/checkpatch.pl. It finds a large number of errors.
Please consistently put a single blank line between end-of-locals and start-of-code. Avoid randomness like:
drivers/acpi/toshiba_acpi.c static acpi_status hci_read1(u32 reg, u32 * out1, u32 * result) · line 359
Quoted 11 lines
drivers/acpi/toshiba_acpi.c +10
-0+static void bt_poll_rfkill (struct input_polled_dev *poll_dev) +{ +bool state_changed; +bool new_rfk_state; +bool value; +u32 hci_result; + +struct toshiba_acpi_dev *dev = poll_dev->private; + + hci_result =hci_get_radio_state (&value);
The code uses new-style bool' but it also adds at least one usage of the old-style FALSE'.
Re: [PATCH 1/1] toshiba_acpi: Add support for bluetooth togglingthrough rfkill (v6)
Quoted 3 lines · Andrew Morton
your email client is performing space-stuffing. Please see
Documentation/email-clients.txt.
Hrmf. I beat thunderbird into submission previously so I'm not sure why did decided
to crap out on me now. I've resent the diff using a more cooperative client and updated
it to reflect your comments.
Thanks,
--phil