]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.32.12/thinkpad-acpi-log-initial-state-of-rfkill-switches.patch
Fixes for 5.10
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.12 / thinkpad-acpi-log-initial-state-of-rfkill-switches.patch
CommitLineData
9659d8ac
GKH
1From 5451a923bbdcff6ae665947e120af7238b21a9d2 Mon Sep 17 00:00:00 2001
2From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
3Date: Tue, 15 Dec 2009 21:51:07 -0200
4Subject: thinkpad-acpi: log initial state of rfkill switches
5
6From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
7
8commit 5451a923bbdcff6ae665947e120af7238b21a9d2 upstream.
9
10We already log the initial state of the hardware rfkill switch (WLSW),
11might as well log the state of the softswitches as well.
12
13Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
14Cc: Josip Rodin <joy+kernel@entuzijast.net>
15Signed-off-by: Len Brown <len.brown@intel.com>
16Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17
18---
19 drivers/platform/x86/thinkpad_acpi.c | 7 ++++++-
20 1 file changed, 6 insertions(+), 1 deletion(-)
21
22--- a/drivers/platform/x86/thinkpad_acpi.c
23+++ b/drivers/platform/x86/thinkpad_acpi.c
24@@ -1264,6 +1264,7 @@ static int __init tpacpi_new_rfkill(cons
25 struct tpacpi_rfk *atp_rfk;
26 int res;
27 bool sw_state = false;
28+ bool hw_state;
29 int sw_status;
30
31 BUG_ON(id >= TPACPI_RFK_SW_MAX || tpacpi_rfkill_switches[id]);
32@@ -1298,7 +1299,8 @@ static int __init tpacpi_new_rfkill(cons
33 rfkill_init_sw_state(atp_rfk->rfkill, sw_state);
34 }
35 }
36- rfkill_set_hw_state(atp_rfk->rfkill, tpacpi_rfk_check_hwblock_state());
37+ hw_state = tpacpi_rfk_check_hwblock_state();
38+ rfkill_set_hw_state(atp_rfk->rfkill, hw_state);
39
40 res = rfkill_register(atp_rfk->rfkill);
41 if (res < 0) {
42@@ -1311,6 +1313,9 @@ static int __init tpacpi_new_rfkill(cons
43 }
44
45 tpacpi_rfkill_switches[id] = atp_rfk;
46+
47+ printk(TPACPI_INFO "rfkill switch %s: radio is %sblocked\n",
48+ name, (sw_state || hw_state) ? "" : "un");
49 return 0;
50 }
51