summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-11-17 14:00:27 +0100
committerMatthew Garrett <matthew.garrett@nebula.com>2013-11-21 00:50:49 +0100
commit2bd4ac139259bb605fc0325a7dda33e2fbb67ae3 (patch)
treee8ecf859c13cc21121ab0a669a76281c4402ebd6 /drivers/platform
parentdell-laptop: Add a force_rfkill module parameter (diff)
downloadlinux-2bd4ac139259bb605fc0325a7dda33e2fbb67ae3.tar.xz
linux-2bd4ac139259bb605fc0325a7dda33e2fbb67ae3.zip
dell-laptop: Only enable rfkill functionality on laptops with a hw killswitch
All my testing has been on laptops with a hw killswitch, so to be on the safe side disable rfkill functionality on models without a hw killswitch for now. Once we gather some feedback on laptops without a hw killswitch this decision maybe reconsidered. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/dell-laptop.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index bd67c893ba07..c608b1d33f4a 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -580,11 +580,18 @@ static int __init dell_setup_rfkill(void)
buffer->input[0] = 0x2;
dell_send_request(buffer, 17, 11);
hwswitch_state = buffer->output[1];
- /* If there is no hwswitch, then clear all hw-controlled bits */
- if (!(status & BIT(0)))
- hwswitch_state &= ~7;
release_buffer();
+ if (!(status & BIT(0))) {
+ if (force_rfkill) {
+ /* No hwsitch, clear all hw-controlled bits */
+ hwswitch_state &= ~7;
+ } else {
+ /* rfkill is only tested on laptops with a hwswitch */
+ return 0;
+ }
+ }
+
if ((status & (1<<2|1<<8)) == (1<<2|1<<8)) {
wifi_rfkill = rfkill_alloc("dell-wifi", &platform_device->dev,
RFKILL_TYPE_WLAN,