ACPI: thinkpad-acpi: refactor hotkey_get and hotkey_set (v2)
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Tue, 8 Jan 2008 15:02:39 +0000 (13:02 -0200)
committerLen Brown <len.brown@intel.com>
Sat, 2 Feb 2008 03:26:06 +0000 (22:26 -0500)
commitb2c985e7eba858a1765db6d56bdd4df775f53633
tree938b712a2ae312a1876a04ff830c1411f7eeab4a
parent0f089147e620e083f58a0e641f701bd4244b455b
ACPI: thinkpad-acpi: refactor hotkey_get and hotkey_set (v2)

Refactor and organize the code a bit for the NVRAM polling support:

1. Split hotkey_get/set into hotkey_status_get/set and hotkey_mask_get/set;
2. Cache the status of hot key mask for later driver use;
3. Make sure the cache of hot key mask is refreshed when needed;
4. log a printk notice when the firmware doesn't set the hot key
   mask to exactly what we asked it to;
5. Add proper locking to the data structures.

Only (4) should be user-noticeable, but there is a chance (5) fixes
some unknown/unreported race conditions.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/misc/thinkpad_acpi.c
drivers/misc/thinkpad_acpi.h