aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc')
-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 743a4d6098e8..202d63e1b391 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -2588,6 +2588,10 @@ static int bluetooth_get_radiosw(void)
2588 if (!tp_features.bluetooth) 2588 if (!tp_features.bluetooth)
2589 return -ENODEV; 2589 return -ENODEV;
2590 2590
2591 /* WLSW overrides bluetooth in firmware/hardware, reflect that */
2592 if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status)
2593 return 0;
2594
2591 if (!acpi_evalf(hkey_handle, &status, "GBDC", "d")) 2595 if (!acpi_evalf(hkey_handle, &status, "GBDC", "d"))
2592 return -EIO; 2596 return -EIO;
2593 2597
@@ -2601,6 +2605,12 @@ static int bluetooth_set_radiosw(int radio_on)
2601 if (!tp_features.bluetooth) 2605 if (!tp_features.bluetooth)
2602 return -ENODEV; 2606 return -ENODEV;
2603 2607
2608 /* WLSW overrides bluetooth in firmware/hardware, but there is no
2609 * reason to risk weird behaviour. */
2610 if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status
2611 && radio_on)
2612 return -EPERM;
2613
2604 if (!acpi_evalf(hkey_handle, &status, "GBDC", "d")) 2614 if (!acpi_evalf(hkey_handle, &status, "GBDC", "d"))
2605 return -EIO; 2615 return -EIO;
2606 if (radio_on) 2616 if (radio_on)
@@ -2760,6 +2770,10 @@ static int wan_get_radiosw(void)
2760 if (!tp_features.wan) 2770 if (!tp_features.wan)
2761 return -ENODEV; 2771 return -ENODEV;
2762 2772
2773 /* WLSW overrides WWAN in firmware/hardware, reflect that */
2774 if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status)
2775 return 0;
2776
2763 if (!acpi_evalf(hkey_handle, &status, "GWAN", "d")) 2777 if (!acpi_evalf(hkey_handle, &status, "GWAN", "d"))
2764 return -EIO; 2778 return -EIO;
2765 2779
@@ -2773,6 +2787,12 @@ static int wan_set_radiosw(int radio_on)
2773 if (!tp_features.wan) 2787 if (!tp_features.wan)
2774 return -ENODEV; 2788 return -ENODEV;
2775 2789
2790 /* WLSW overrides bluetooth in firmware/hardware, but there is no
2791 * reason to risk weird behaviour. */
2792 if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status
2793 && radio_on)
2794 return -EPERM;
2795
2776 if (!acpi_evalf(hkey_handle, &status, "GWAN", "d")) 2796 if (!acpi_evalf(hkey_handle, &status, "GWAN", "d"))
2777 return -EIO; 2797 return -EIO;
2778 if (radio_on) 2798 if (radio_on)