Add patches accepted for 2.6.30-rc4
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / releases / upstream / 2.6.27-rc1 / 0001-ACPI-thinkpad-acpi-minor-refactor-on-radio-switch.patch
bloba5f2277dc5229f6921e0feb38c7a42b7e610a79d
1 From 3a87208028ef59215a88a143c723ac0b83c11df0 Mon Sep 17 00:00:00 2001
2 From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
3 Date: Mon, 21 Jul 2008 09:15:49 -0300
4 Subject: ACPI: thinkpad-acpi: minor refactor on radio switch init
6 Change the code of hotkey_init, wan_init and bluetooth_init a bit to make it
7 much easier to add some Kconfig-selected debugging code later.
9 Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
10 ---
11 drivers/misc/thinkpad_acpi.c | 49 ++++++++++++++++++++++-------------------
12 1 files changed, 26 insertions(+), 23 deletions(-)
14 diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
15 index b596929..c800855 100644
16 --- a/drivers/misc/thinkpad_acpi.c
17 +++ b/drivers/misc/thinkpad_acpi.c
18 @@ -2167,9 +2167,10 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
19 printk(TPACPI_INFO
20 "radio switch found; radios are %s\n",
21 enabled(status, 0));
22 + }
23 + if (tp_features.hotkey_wlsw)
24 res = add_to_attr_set(hotkey_dev_attributes,
25 &dev_attr_hotkey_radio_sw.attr);
26 - }
28 /* For X41t, X60t, X61t Tablets... */
29 if (!res && acpi_evalf(hkey_handle, &status, "MHKG", "qd")) {
30 @@ -2646,18 +2647,19 @@ static int __init bluetooth_init(struct ibm_init_struct *iibm)
31 str_supported(tp_features.bluetooth),
32 status);
34 + if (tp_features.bluetooth &&
35 + !(status & TP_ACPI_BLUETOOTH_HWPRESENT)) {
36 + /* no bluetooth hardware present in system */
37 + tp_features.bluetooth = 0;
38 + dbg_printk(TPACPI_DBG_INIT,
39 + "bluetooth hardware not installed\n");
40 + }
42 if (tp_features.bluetooth) {
43 - if (!(status & TP_ACPI_BLUETOOTH_HWPRESENT)) {
44 - /* no bluetooth hardware present in system */
45 - tp_features.bluetooth = 0;
46 - dbg_printk(TPACPI_DBG_INIT,
47 - "bluetooth hardware not installed\n");
48 - } else {
49 - res = sysfs_create_group(&tpacpi_pdev->dev.kobj,
50 - &bluetooth_attr_group);
51 - if (res)
52 - return res;
53 - }
54 + res = sysfs_create_group(&tpacpi_pdev->dev.kobj,
55 + &bluetooth_attr_group);
56 + if (res)
57 + return res;
60 return (tp_features.bluetooth)? 0 : 1;
61 @@ -2818,18 +2820,19 @@ static int __init wan_init(struct ibm_init_struct *iibm)
62 str_supported(tp_features.wan),
63 status);
65 + if (tp_features.wan &&
66 + !(status & TP_ACPI_WANCARD_HWPRESENT)) {
67 + /* no wan hardware present in system */
68 + tp_features.wan = 0;
69 + dbg_printk(TPACPI_DBG_INIT,
70 + "wan hardware not installed\n");
71 + }
73 if (tp_features.wan) {
74 - if (!(status & TP_ACPI_WANCARD_HWPRESENT)) {
75 - /* no wan hardware present in system */
76 - tp_features.wan = 0;
77 - dbg_printk(TPACPI_DBG_INIT,
78 - "wan hardware not installed\n");
79 - } else {
80 - res = sysfs_create_group(&tpacpi_pdev->dev.kobj,
81 - &wan_attr_group);
82 - if (res)
83 - return res;
84 - }
85 + res = sysfs_create_group(&tpacpi_pdev->dev.kobj,
86 + &wan_attr_group);
87 + if (res)
88 + return res;
91 return (tp_features.wan)? 0 : 1;
92 --
93 1.5.6.2