aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/misc/thinkpad_acpi.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 743a4d6098e..202d63e1b39 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -2588,6 +2588,10 @@ static int bluetooth_get_radiosw(void)
if (!tp_features.bluetooth)
return -ENODEV;
+ /* WLSW overrides bluetooth in firmware/hardware, reflect that */
+ if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status)
+ return 0;
+
if (!acpi_evalf(hkey_handle, &status, "GBDC", "d"))
return -EIO;
@@ -2601,6 +2605,12 @@ static int bluetooth_set_radiosw(int radio_on)
if (!tp_features.bluetooth)
return -ENODEV;
+ /* WLSW overrides bluetooth in firmware/hardware, but there is no
+ * reason to risk weird behaviour. */
+ if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status
+ && radio_on)
+ return -EPERM;
+
if (!acpi_evalf(hkey_handle, &status, "GBDC", "d"))
return -EIO;
if (radio_on)
@@ -2760,6 +2770,10 @@ static int wan_get_radiosw(void)
if (!tp_features.wan)
return -ENODEV;
+ /* WLSW overrides WWAN in firmware/hardware, reflect that */
+ if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status)
+ return 0;
+
if (!acpi_evalf(hkey_handle, &status, "GWAN", "d"))
return -EIO;
@@ -2773,6 +2787,12 @@ static int wan_set_radiosw(int radio_on)
if (!tp_features.wan)
return -ENODEV;
+ /* WLSW overrides bluetooth in firmware/hardware, but there is no
+ * reason to risk weird behaviour. */
+ if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status
+ && radio_on)
+ return -EPERM;
+
if (!acpi_evalf(hkey_handle, &status, "GWAN", "d"))
return -EIO;
if (radio_on)