aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2007-09-23 10:39:03 -0400
committerLen Brown <len.brown@intel.com>2007-09-23 22:38:14 -0400
commit1b6521dc84f372dd92a96381fbeeebb01173d050 (patch)
tree8b6e15396ee73916361a706541caf98a9281ea6a
parent8fef502e5a14df05f1e755edc9175e01c9814080 (diff)
ACPI: thinkpad-acpi: check version of hot key firmware
Check the HKEY firmware version (HKEY.MHKV handler), and refuse to load if it is unknown. Use this instead of the presence of HKEY.DHKV to detect hot key mask capability. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/misc/thinkpad_acpi.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 2155139793b1..9a611402ee9d 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -999,6 +999,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
999 999
1000 int res, i; 1000 int res, i;
1001 int status; 1001 int status;
1002 int hkeyv;
1002 1003
1003 vdbg_printk(TPACPI_DBG_INIT, "initializing hotkey subdriver\n"); 1004 vdbg_printk(TPACPI_DBG_INIT, "initializing hotkey subdriver\n");
1004 1005
@@ -1024,18 +1025,35 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
1024 return res; 1025 return res;
1025 1026
1026 /* mask not supported on 570, 600e/x, 770e, 770x, A21e, A2xm/p, 1027 /* mask not supported on 570, 600e/x, 770e, 770x, A21e, A2xm/p,
1027 A30, R30, R31, T20-22, X20-21, X22-24 */ 1028 A30, R30, R31, T20-22, X20-21, X22-24. Detected by checking
1028 tp_features.hotkey_mask = 1029 for HKEY interface version 0x100 */
1029 acpi_evalf(hkey_handle, NULL, "DHKN", "qv"); 1030 if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) {
1031 if ((hkeyv >> 8) != 1) {
1032 printk(IBM_ERR "unknown version of the "
1033 "HKEY interface: 0x%x\n", hkeyv);
1034 printk(IBM_ERR "please report this to %s\n",
1035 IBM_MAIL);
1036 } else {
1037 /*
1038 * MHKV 0x100 in A31, R40, R40e,
1039 * T4x, X31, and later
1040 * */
1041 tp_features.hotkey_mask = 1;
1042 }
1043 }
1030 1044
1031 vdbg_printk(TPACPI_DBG_INIT, "hotkey masks are %s\n", 1045 vdbg_printk(TPACPI_DBG_INIT, "hotkey masks are %s\n",
1032 str_supported(tp_features.hotkey_mask)); 1046 str_supported(tp_features.hotkey_mask));
1033 1047
1034 if (tp_features.hotkey_mask) { 1048 if (tp_features.hotkey_mask) {
1035 /* MHKA available in A31, R40, R40e, T4x, X31, and later */
1036 if (!acpi_evalf(hkey_handle, &hotkey_all_mask, 1049 if (!acpi_evalf(hkey_handle, &hotkey_all_mask,
1037 "MHKA", "qd")) 1050 "MHKA", "qd")) {
1051 printk(IBM_ERR
1052 "missing MHKA handler, "
1053 "please report this to %s\n",
1054 IBM_MAIL);
1038 hotkey_all_mask = 0x080cU; /* FN+F12, FN+F4, FN+F3 */ 1055 hotkey_all_mask = 0x080cU; /* FN+F12, FN+F4, FN+F3 */
1056 }
1039 } 1057 }
1040 1058
1041 res = hotkey_get(&hotkey_orig_status, &hotkey_orig_mask); 1059 res = hotkey_get(&hotkey_orig_status, &hotkey_orig_mask);