Skip to content

Commit

Permalink
ACPI: thinkpad-acpi: check version of hot key firmware
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Henrique de Moraes Holschuh authored and Len Brown committed Sep 24, 2007
1 parent 8fef502 commit 1b6521d
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions drivers/misc/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)

int res, i;
int status;
int hkeyv;

vdbg_printk(TPACPI_DBG_INIT, "initializing hotkey subdriver\n");

Expand All @@ -1024,18 +1025,35 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
return res;

/* mask not supported on 570, 600e/x, 770e, 770x, A21e, A2xm/p,
A30, R30, R31, T20-22, X20-21, X22-24 */
tp_features.hotkey_mask =
acpi_evalf(hkey_handle, NULL, "DHKN", "qv");
A30, R30, R31, T20-22, X20-21, X22-24. Detected by checking
for HKEY interface version 0x100 */
if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) {
if ((hkeyv >> 8) != 1) {
printk(IBM_ERR "unknown version of the "
"HKEY interface: 0x%x\n", hkeyv);
printk(IBM_ERR "please report this to %s\n",
IBM_MAIL);
} else {
/*
* MHKV 0x100 in A31, R40, R40e,
* T4x, X31, and later
* */
tp_features.hotkey_mask = 1;
}
}

vdbg_printk(TPACPI_DBG_INIT, "hotkey masks are %s\n",
str_supported(tp_features.hotkey_mask));

if (tp_features.hotkey_mask) {
/* MHKA available in A31, R40, R40e, T4x, X31, and later */
if (!acpi_evalf(hkey_handle, &hotkey_all_mask,
"MHKA", "qd"))
"MHKA", "qd")) {
printk(IBM_ERR
"missing MHKA handler, "
"please report this to %s\n",
IBM_MAIL);
hotkey_all_mask = 0x080cU; /* FN+F12, FN+F4, FN+F3 */
}
}

res = hotkey_get(&hotkey_orig_status, &hotkey_orig_mask);
Expand Down

0 comments on commit 1b6521d

Please sign in to comment.