diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2008-04-26 00:02:18 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-29 09:47:00 -0400 |
commit | 92889022250d736e135ca92fbffd1ab0ea4780d1 (patch) | |
tree | 156815ba61d29b9e70a593a795077e3eff119fc1 /drivers/misc | |
parent | b59727965d7f286489206c292e2788d4835a8a23 (diff) |
ACPI: thinkpad-acpi: warn once about weird hotkey masks
thinkpad-acpi knows for a while now how to best program the hotkeys by
default, and always enable them by default. Unfortunately, this
information has not filtered down everywhere it needs to, yet. Notably,
old ibm-acpi documentation and most "thinkpad setup guides" will have wrong
information on this area.
Warn the local admin once whenever any of the following patterns are met:
1. Attempts to set hotkey mask to 0xffff (artifact from docs and config
for the old ibm-acpi driver and behaviour). This mask makes no
real-world sense;
2. Attempts to set hotkey mask to 0xffffffff, which means the user is
trying to just have "everything work" without even reading the
documentation, or that we need to get a bug report, because there
is a new thinkpad out there with new exciting hot keys :-)
3. Attempts to set hotkey mask to 0xffffff, which is almost never the
correct way to set up volume and brightness event reporting (and with
the current state-of-the-art, it is known to never be right way to do
it).
The driver will perform any and all requested operations, though,
regardless of any warnings. I hope these warnings can be removed one or
two years from now.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/thinkpad_acpi.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index 2c85a2e10a25..cd263c518e06 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c | |||
@@ -237,6 +237,10 @@ static struct { | |||
237 | u32 hotkey_poll_active:1; | 237 | u32 hotkey_poll_active:1; |
238 | } tp_features; | 238 | } tp_features; |
239 | 239 | ||
240 | static struct { | ||
241 | u16 hotkey_mask_ff:1; | ||
242 | } tp_warned; | ||
243 | |||
240 | struct thinkpad_id_data { | 244 | struct thinkpad_id_data { |
241 | unsigned int vendor; /* ThinkPad vendor: | 245 | unsigned int vendor; /* ThinkPad vendor: |
242 | * PCI_VENDOR_ID_IBM/PCI_VENDOR_ID_LENOVO */ | 246 | * PCI_VENDOR_ID_IBM/PCI_VENDOR_ID_LENOVO */ |
@@ -1182,6 +1186,19 @@ static int hotkey_mask_set(u32 mask) | |||
1182 | int rc = 0; | 1186 | int rc = 0; |
1183 | 1187 | ||
1184 | if (tp_features.hotkey_mask) { | 1188 | if (tp_features.hotkey_mask) { |
1189 | if (!tp_warned.hotkey_mask_ff && | ||
1190 | (mask == 0xffff || mask == 0xffffff || | ||
1191 | mask == 0xffffffff)) { | ||
1192 | tp_warned.hotkey_mask_ff = 1; | ||
1193 | printk(TPACPI_NOTICE | ||
1194 | "setting the hotkey mask to 0x%08x is likely " | ||
1195 | "not the best way to go about it\n", mask); | ||
1196 | printk(TPACPI_NOTICE | ||
1197 | "please consider using the driver defaults, " | ||
1198 | "and refer to up-to-date thinkpad-acpi " | ||
1199 | "documentation\n"); | ||
1200 | } | ||
1201 | |||
1185 | HOTKEY_CONFIG_CRITICAL_START | 1202 | HOTKEY_CONFIG_CRITICAL_START |
1186 | for (i = 0; i < 32; i++) { | 1203 | for (i = 0; i < 32; i++) { |
1187 | u32 m = 1 << i; | 1204 | u32 m = 1 << i; |