1 From 133ec3bd3ae409895eacdce326cdc8d73c249e8a Mon Sep 17 00:00:00 2001
2 From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
3 Date: Mon, 21 Jul 2008 09:15:50 -0300
4 Subject: ACPI: thinkpad-acpi: WLSW overrides other rfkill switches
6 On ThinkPads where the WLSW switch exists, the firmware or the hardware
7 ANDs the WLSW state with the device-specific switches (WWAN, Bluetooth).
8 It is downright impossible to enable WWAN or Bluetooth when WLSW is
11 This reality does not necessarily carry over to the WWAN and Bluetooth
12 firmware interfaces, though... so the state thinkpad-acpi was reporting
15 Tie the three switches in the driver so that we keep their state sane.
16 When WLSL is off, force the other switches to off as well.
18 Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
20 drivers/misc/thinkpad_acpi.c | 20 ++++++++++++++++++++
21 1 files changed, 20 insertions(+), 0 deletions(-)
23 diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
24 index 743a4d6..202d63e 100644
25 --- a/drivers/misc/thinkpad_acpi.c
26 +++ b/drivers/misc/thinkpad_acpi.c
27 @@ -2588,6 +2588,10 @@ static int bluetooth_get_radiosw(void)
28 if (!tp_features.bluetooth)
31 + /* WLSW overrides bluetooth in firmware/hardware, reflect that */
32 + if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status)
35 if (!acpi_evalf(hkey_handle, &status, "GBDC", "d"))
38 @@ -2601,6 +2605,12 @@ static int bluetooth_set_radiosw(int radio_on)
39 if (!tp_features.bluetooth)
42 + /* WLSW overrides bluetooth in firmware/hardware, but there is no
43 + * reason to risk weird behaviour. */
44 + if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status
48 if (!acpi_evalf(hkey_handle, &status, "GBDC", "d"))
51 @@ -2760,6 +2770,10 @@ static int wan_get_radiosw(void)
55 + /* WLSW overrides WWAN in firmware/hardware, reflect that */
56 + if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status)
59 if (!acpi_evalf(hkey_handle, &status, "GWAN", "d"))
62 @@ -2773,6 +2787,12 @@ static int wan_set_radiosw(int radio_on)
66 + /* WLSW overrides bluetooth in firmware/hardware, but there is no
67 + * reason to risk weird behaviour. */
68 + if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status
72 if (!acpi_evalf(hkey_handle, &status, "GWAN", "d"))