Add patches accepted for 2.6.27-rc1
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / releases / upstream / 2.6.27-rc1 / 0002-ACPI-thinkpad-acpi-consolidate-wlsw-notification-f.patch
blob0363bbefd729f8c18842749ee4b220599182f019
1 From 733e27c1cc86afae2d9481838693661b3d839950 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: consolidate wlsw notification function
6 Rename tpacpi_input_send_radiosw() to tpacpi_send_radiosw_update(), and
7 make it a central point to issue "radio switch changed state" notifications
8 by consolidating also the poll() notification in the same function.
10 Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
11 ---
12 drivers/misc/thinkpad_acpi.c | 39 +++++++++++++++++++--------------------
13 1 files changed, 19 insertions(+), 20 deletions(-)
15 diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
16 index c800855..9179f23 100644
17 --- a/drivers/misc/thinkpad_acpi.c
18 +++ b/drivers/misc/thinkpad_acpi.c
19 @@ -1285,21 +1285,6 @@ static int hotkey_status_set(int status)
20 return 0;
23 -static void tpacpi_input_send_radiosw(void)
25 - int wlsw;
27 - if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&wlsw)) {
28 - mutex_lock(&tpacpi_inputdev_send_mutex);
30 - input_report_switch(tpacpi_inputdev,
31 - SW_RFKILL_ALL, !!wlsw);
32 - input_sync(tpacpi_inputdev);
34 - mutex_unlock(&tpacpi_inputdev_send_mutex);
35 - }
38 static void tpacpi_input_send_tabletsw(void)
40 int state;
41 @@ -1921,6 +1906,22 @@ static struct attribute *hotkey_mask_attributes[] __initdata = {
42 &dev_attr_hotkey_wakeup_hotunplug_complete.attr,
45 +static void tpacpi_send_radiosw_update(void)
47 + int wlsw;
49 + if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&wlsw)) {
50 + mutex_lock(&tpacpi_inputdev_send_mutex);
52 + input_report_switch(tpacpi_inputdev,
53 + SW_RFKILL_ALL, !!wlsw);
54 + input_sync(tpacpi_inputdev);
56 + mutex_unlock(&tpacpi_inputdev_send_mutex);
57 + }
58 + hotkey_radio_sw_notify_change();
61 static void hotkey_exit(void)
63 #ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
64 @@ -2288,7 +2289,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
65 tpacpi_inputdev->close = &hotkey_inputdev_close;
67 hotkey_poll_setup_safe(1);
68 - tpacpi_input_send_radiosw();
69 + tpacpi_send_radiosw_update();
70 tpacpi_input_send_tabletsw();
72 return 0;
73 @@ -2420,8 +2421,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
74 case 7:
75 /* 0x7000-0x7FFF: misc */
76 if (tp_features.hotkey_wlsw && hkey == 0x7000) {
77 - tpacpi_input_send_radiosw();
78 - hotkey_radio_sw_notify_change();
79 + tpacpi_send_radiosw_update();
80 send_acpi_ev = 0;
81 break;
83 @@ -2464,8 +2464,7 @@ static void hotkey_resume(void)
84 printk(TPACPI_ERR
85 "error while trying to read hot key mask "
86 "from firmware\n");
87 - tpacpi_input_send_radiosw();
88 - hotkey_radio_sw_notify_change();
89 + tpacpi_send_radiosw_update();
90 hotkey_tablet_mode_notify_change();
91 hotkey_wakeup_reason_notify_change();
92 hotkey_wakeup_hotunplug_complete_notify_change();
93 --
94 1.5.6.2