Add a patch accepted in 2.6.24-rc1 that was forgotten
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / releases / upstream / 2.6.24-rc1 / 0009-ACPI-thinkpad-acpi-check-version-of-hot-key-firmwa.patch
blobc6bf586977e40dcf35ee561943578c8062f1bf53
1 From 1b6521dc84f372dd92a96381fbeeebb01173d050 Mon Sep 17 00:00:00 2001
2 From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
3 Date: Sun, 23 Sep 2007 11:39:03 -0300
4 Subject: [PATCH 08/23] ACPI: thinkpad-acpi: check version of hot key firmware
6 Check the HKEY firmware version (HKEY.MHKV handler), and refuse to load if
7 it is unknown. Use this instead of the presence of HKEY.DHKV to detect hot
8 key mask capability.
10 Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
11 Signed-off-by: Len Brown <len.brown@intel.com>
12 ---
13 drivers/misc/thinkpad_acpi.c | 28 +++++++++++++++++++++++-----
14 1 files changed, 23 insertions(+), 5 deletions(-)
16 diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
17 index 2155139..9a61140 100644
18 --- a/drivers/misc/thinkpad_acpi.c
19 +++ b/drivers/misc/thinkpad_acpi.c
20 @@ -999,6 +999,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
22 int res, i;
23 int status;
24 + int hkeyv;
26 vdbg_printk(TPACPI_DBG_INIT, "initializing hotkey subdriver\n");
28 @@ -1024,18 +1025,35 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
29 return res;
31 /* mask not supported on 570, 600e/x, 770e, 770x, A21e, A2xm/p,
32 - A30, R30, R31, T20-22, X20-21, X22-24 */
33 - tp_features.hotkey_mask =
34 - acpi_evalf(hkey_handle, NULL, "DHKN", "qv");
35 + A30, R30, R31, T20-22, X20-21, X22-24. Detected by checking
36 + for HKEY interface version 0x100 */
37 + if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) {
38 + if ((hkeyv >> 8) != 1) {
39 + printk(IBM_ERR "unknown version of the "
40 + "HKEY interface: 0x%x\n", hkeyv);
41 + printk(IBM_ERR "please report this to %s\n",
42 + IBM_MAIL);
43 + } else {
44 + /*
45 + * MHKV 0x100 in A31, R40, R40e,
46 + * T4x, X31, and later
47 + * */
48 + tp_features.hotkey_mask = 1;
49 + }
50 + }
52 vdbg_printk(TPACPI_DBG_INIT, "hotkey masks are %s\n",
53 str_supported(tp_features.hotkey_mask));
55 if (tp_features.hotkey_mask) {
56 - /* MHKA available in A31, R40, R40e, T4x, X31, and later */
57 if (!acpi_evalf(hkey_handle, &hotkey_all_mask,
58 - "MHKA", "qd"))
59 + "MHKA", "qd")) {
60 + printk(IBM_ERR
61 + "missing MHKA handler, "
62 + "please report this to %s\n",
63 + IBM_MAIL);
64 hotkey_all_mask = 0x080cU; /* FN+F12, FN+F4, FN+F3 */
65 + }
68 res = hotkey_get(&hotkey_orig_status, &hotkey_orig_mask);
69 --
70 1.5.3.4