diff options
-rw-r--r-- | drivers/platform/x86/dell-laptop.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c index 06f281bf7790..7f47396846d1 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c | |||
@@ -425,10 +425,15 @@ out: | |||
425 | return ret; | 425 | return ret; |
426 | } | 426 | } |
427 | 427 | ||
428 | static void dell_rfkill_update(struct rfkill *rfkill, int radio, int status) | 428 | static void dell_rfkill_update_sw_state(struct rfkill *rfkill, int radio, |
429 | int status) | ||
429 | { | 430 | { |
430 | rfkill_set_sw_state(rfkill, !!(status & BIT(radio + 16))); | 431 | rfkill_set_sw_state(rfkill, !!(status & BIT(radio + 16))); |
432 | } | ||
431 | 433 | ||
434 | static void dell_rfkill_update_hw_state(struct rfkill *rfkill, int radio, | ||
435 | int status) | ||
436 | { | ||
432 | if (hwswitch_state & (BIT(radio - 1))) | 437 | if (hwswitch_state & (BIT(radio - 1))) |
433 | rfkill_set_hw_state(rfkill, !(status & BIT(16))); | 438 | rfkill_set_hw_state(rfkill, !(status & BIT(16))); |
434 | } | 439 | } |
@@ -442,7 +447,7 @@ static void dell_rfkill_query(struct rfkill *rfkill, void *data) | |||
442 | status = buffer->output[1]; | 447 | status = buffer->output[1]; |
443 | release_buffer(); | 448 | release_buffer(); |
444 | 449 | ||
445 | dell_rfkill_update(rfkill, (unsigned long)data, status); | 450 | dell_rfkill_update_hw_state(rfkill, (unsigned long)data, status); |
446 | } | 451 | } |
447 | 452 | ||
448 | static const struct rfkill_ops dell_rfkill_ops = { | 453 | static const struct rfkill_ops dell_rfkill_ops = { |
@@ -528,12 +533,18 @@ static void dell_update_rfkill(struct work_struct *ignored) | |||
528 | status = buffer->output[1]; | 533 | status = buffer->output[1]; |
529 | release_buffer(); | 534 | release_buffer(); |
530 | 535 | ||
531 | if (wifi_rfkill) | 536 | if (wifi_rfkill) { |
532 | dell_rfkill_update(wifi_rfkill, 1, status); | 537 | dell_rfkill_update_hw_state(wifi_rfkill, 1, status); |
533 | if (bluetooth_rfkill) | 538 | dell_rfkill_update_sw_state(wifi_rfkill, 1, status); |
534 | dell_rfkill_update(bluetooth_rfkill, 2, status); | 539 | } |
535 | if (wwan_rfkill) | 540 | if (bluetooth_rfkill) { |
536 | dell_rfkill_update(wwan_rfkill, 3, status); | 541 | dell_rfkill_update_hw_state(bluetooth_rfkill, 2, status); |
542 | dell_rfkill_update_sw_state(bluetooth_rfkill, 2, status); | ||
543 | } | ||
544 | if (wwan_rfkill) { | ||
545 | dell_rfkill_update_hw_state(wwan_rfkill, 3, status); | ||
546 | dell_rfkill_update_sw_state(wwan_rfkill, 3, status); | ||
547 | } | ||
537 | } | 548 | } |
538 | static DECLARE_DELAYED_WORK(dell_rfkill_work, dell_update_rfkill); | 549 | static DECLARE_DELAYED_WORK(dell_rfkill_work, dell_update_rfkill); |
539 | 550 | ||