Add patches accepted for 2.6.23-rc1
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / releases / upstream / 2.6.23-rc1 / 0014-ACPI-thinkpad-acpi-export-EV_SW-SW_RADIO-events.patch
blob0e0059ed1b1c86a2a8b9b90bd2f5b840729169fb
1 From 5c29d58f471099401513e2e567f6c28001bb0f13 Mon Sep 17 00:00:00 2001
2 From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
3 Date: Wed, 18 Jul 2007 23:45:38 -0300
4 Subject: ACPI: thinkpad-acpi: export EV_SW SW_RADIO events
6 The expected user case for the radio slider switch on a ThinkPad includes
7 interfacing to applications, so that the user gets an offer to find and
8 associate with a wireless network when the switch is changed from disabled
9 to enabled (ThinkVantage suite).
11 Export the information about the switch state, and switch change events as
12 an EV_SW SW_RADIO event over the input layer.
14 Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
15 Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
16 Cc: Ivo van Doorn <ivdoorn@gmail.com>
17 Cc: Richard Hughes <hughsient@gmail.com>
18 Signed-off-by: Len Brown <len.brown@intel.com>
19 ---
20 drivers/misc/thinkpad_acpi.c | 28 ++++++++++++++++++++++++++++
21 1 files changed, 28 insertions(+), 0 deletions(-)
23 diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
24 index 78914bf..cfef218 100644
25 --- a/drivers/misc/thinkpad_acpi.c
26 +++ b/drivers/misc/thinkpad_acpi.c
27 @@ -1014,6 +1014,11 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
31 + if (tp_features.hotkey_wlsw) {
32 + set_bit(EV_SW, tpacpi_inputdev->evbit);
33 + set_bit(SW_RADIO, tpacpi_inputdev->swbit);
34 + }
36 #ifdef CONFIG_THINKPAD_ACPI_INPUT_ENABLED
37 dbg_printk(TPACPI_DBG_INIT,
38 "enabling hot key handling\n");
39 @@ -1062,6 +1067,15 @@ static void tpacpi_input_send_key(unsigned int scancode,
43 +static void tpacpi_input_send_radiosw(void)
45 + int wlsw;
47 + if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&wlsw))
48 + input_report_switch(tpacpi_inputdev,
49 + SW_RADIO, !!wlsw);
52 static void hotkey_notify(struct ibm_struct *ibm, u32 event)
54 u32 hkey;
55 @@ -1096,6 +1110,14 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
56 hkey);
58 break;
59 + case 7:
60 + /* 0x7000-0x7FFF: misc */
61 + if (tp_features.hotkey_wlsw && hkey == 0x7000) {
62 + tpacpi_input_send_radiosw();
63 + sendacpi = 0;
64 + break;
65 + }
66 + /* fallthrough to default */
67 default:
68 /* case 2: dock-related */
69 /* 0x2305 - T43 waking up due to bay lever eject while aslept */
70 @@ -1113,6 +1135,11 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
74 +static void hotkey_resume(void)
76 + tpacpi_input_send_radiosw();
80 * Call with hotkey_mutex held
82 @@ -1240,6 +1267,7 @@ static struct ibm_struct hotkey_driver_data = {
83 .read = hotkey_read,
84 .write = hotkey_write,
85 .exit = hotkey_exit,
86 + .resume = hotkey_resume,
87 .acpi = &ibm_hotkey_acpidriver,
90 --
91 1.5.2.1