aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2008-01-08 10:02:38 -0500
committerLen Brown <len.brown@intel.com>2008-02-01 22:26:06 -0500
commit0f089147e620e083f58a0e641f701bd4244b455b (patch)
tree547620b980df4c0379292683ed2d2041bb00db6c /drivers/misc
parentaa6299926950c8dfe2fea638276cad6def092bc9 (diff)
ACPI: thinkpad-acpi: document keymap gotcha's (v2)
Publish the requirements for keymap changes. This is a documentation change, only. Currently, people look at the thinkpad-acpi default keymaps, and think: "modifying this is a trivial thing, it can't break systems, and there are keys defined for foo and bar, but the driver has them as KEY_RESERVED. Must have been an oversight, let me change it." And since they never get to see the bug reports, because they are not really a part of the Linux ThinkPad users community (linux-thinkpad mailinglist, thinkwiki wiki, thinkpad forums) and laptop users are slow to complain to distros about any breakages... 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.c68
1 files changed, 63 insertions, 5 deletions
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index cf56647a6ca4..7b1080f5843c 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -954,26 +954,67 @@ static struct attribute *hotkey_mask_attributes[] __initdata = {
954 954
955static int __init hotkey_init(struct ibm_init_struct *iibm) 955static int __init hotkey_init(struct ibm_init_struct *iibm)
956{ 956{
957 957 /* Requirements for changing the default keymaps:
958 *
959 * 1. Many of the keys are mapped to KEY_RESERVED for very
960 * good reasons. Do not change them unless you have deep
961 * knowledge on the IBM and Lenovo ThinkPad firmware for
962 * the various ThinkPad models. The driver behaves
963 * differently for KEY_RESERVED: such keys have their
964 * hot key mask *unset* in mask_recommended, and also
965 * in the initial hot key mask programmed into the
966 * firmware at driver load time, which means the firm-
967 * ware may react very differently if you change them to
968 * something else;
969 *
970 * 2. You must be subscribed to the linux-thinkpad and
971 * ibm-acpi-devel mailing lists, and you should read the
972 * list archives since 2007 if you want to change the
973 * keymaps. This requirement exists so that you will
974 * know the past history of problems with the thinkpad-
975 * acpi driver keymaps, and also that you will be
976 * listening to any bug reports;
977 *
978 * 3. Do not send thinkpad-acpi specific patches directly to
979 * for merging, *ever*. Send them to the linux-acpi
980 * mailinglist for comments. Merging is to be done only
981 * through acpi-test and the ACPI maintainer.
982 *
983 * If the above is too much to ask, don't change the keymap.
984 * Ask the thinkpad-acpi maintainer to do it, instead.
985 */
958 static u16 ibm_keycode_map[] __initdata = { 986 static u16 ibm_keycode_map[] __initdata = {
959 /* Scan Codes 0x00 to 0x0B: ACPI HKEY FN+F1..F12 */ 987 /* Scan Codes 0x00 to 0x0B: ACPI HKEY FN+F1..F12 */
960 KEY_FN_F1, KEY_FN_F2, KEY_COFFEE, KEY_SLEEP, 988 KEY_FN_F1, KEY_FN_F2, KEY_COFFEE, KEY_SLEEP,
961 KEY_WLAN, KEY_FN_F6, KEY_SWITCHVIDEOMODE, KEY_FN_F8, 989 KEY_WLAN, KEY_FN_F6, KEY_SWITCHVIDEOMODE, KEY_FN_F8,
962 KEY_FN_F9, KEY_FN_F10, KEY_FN_F11, KEY_SUSPEND, 990 KEY_FN_F9, KEY_FN_F10, KEY_FN_F11, KEY_SUSPEND,
963 /* Scan codes 0x0C to 0x0F: Other ACPI HKEY hot keys */ 991
992 /* Scan codes 0x0C to 0x1F: Other ACPI HKEY hot keys */
964 KEY_UNKNOWN, /* 0x0C: FN+BACKSPACE */ 993 KEY_UNKNOWN, /* 0x0C: FN+BACKSPACE */
965 KEY_UNKNOWN, /* 0x0D: FN+INSERT */ 994 KEY_UNKNOWN, /* 0x0D: FN+INSERT */
966 KEY_UNKNOWN, /* 0x0E: FN+DELETE */ 995 KEY_UNKNOWN, /* 0x0E: FN+DELETE */
996
997 /* brightness: firmware always reacts to them, unless
998 * X.org did some tricks in the radeon BIOS scratch
999 * registers of *some* models */
967 KEY_RESERVED, /* 0x0F: FN+HOME (brightness up) */ 1000 KEY_RESERVED, /* 0x0F: FN+HOME (brightness up) */
968 /* Scan codes 0x10 to 0x1F: Extended ACPI HKEY hot keys */
969 KEY_RESERVED, /* 0x10: FN+END (brightness down) */ 1001 KEY_RESERVED, /* 0x10: FN+END (brightness down) */
1002
1003 /* Thinklight: firmware always react to it */
970 KEY_RESERVED, /* 0x11: FN+PGUP (thinklight toggle) */ 1004 KEY_RESERVED, /* 0x11: FN+PGUP (thinklight toggle) */
1005
971 KEY_UNKNOWN, /* 0x12: FN+PGDOWN */ 1006 KEY_UNKNOWN, /* 0x12: FN+PGDOWN */
972 KEY_ZOOM, /* 0x13: FN+SPACE (zoom) */ 1007 KEY_ZOOM, /* 0x13: FN+SPACE (zoom) */
1008
1009 /* Volume: firmware always react to it and reprograms
1010 * the built-in *extra* mixer. Never map it to control
1011 * another mixer by default. */
973 KEY_RESERVED, /* 0x14: VOLUME UP */ 1012 KEY_RESERVED, /* 0x14: VOLUME UP */
974 KEY_RESERVED, /* 0x15: VOLUME DOWN */ 1013 KEY_RESERVED, /* 0x15: VOLUME DOWN */
975 KEY_RESERVED, /* 0x16: MUTE */ 1014 KEY_RESERVED, /* 0x16: MUTE */
1015
976 KEY_VENDOR, /* 0x17: Thinkpad/AccessIBM/Lenovo */ 1016 KEY_VENDOR, /* 0x17: Thinkpad/AccessIBM/Lenovo */
1017
977 /* (assignments unknown, please report if found) */ 1018 /* (assignments unknown, please report if found) */
978 KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, 1019 KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN,
979 KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, 1020 KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN,
@@ -983,20 +1024,37 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
983 KEY_FN_F1, KEY_COFFEE, KEY_BATTERY, KEY_SLEEP, 1024 KEY_FN_F1, KEY_COFFEE, KEY_BATTERY, KEY_SLEEP,
984 KEY_WLAN, KEY_FN_F6, KEY_SWITCHVIDEOMODE, KEY_FN_F8, 1025 KEY_WLAN, KEY_FN_F6, KEY_SWITCHVIDEOMODE, KEY_FN_F8,
985 KEY_FN_F9, KEY_FN_F10, KEY_FN_F11, KEY_SUSPEND, 1026 KEY_FN_F9, KEY_FN_F10, KEY_FN_F11, KEY_SUSPEND,
986 /* Scan codes 0x0C to 0x0F: Other ACPI HKEY hot keys */ 1027
1028 /* Scan codes 0x0C to 0x1F: Other ACPI HKEY hot keys */
987 KEY_UNKNOWN, /* 0x0C: FN+BACKSPACE */ 1029 KEY_UNKNOWN, /* 0x0C: FN+BACKSPACE */
988 KEY_UNKNOWN, /* 0x0D: FN+INSERT */ 1030 KEY_UNKNOWN, /* 0x0D: FN+INSERT */
989 KEY_UNKNOWN, /* 0x0E: FN+DELETE */ 1031 KEY_UNKNOWN, /* 0x0E: FN+DELETE */
1032
990 KEY_RESERVED, /* 0x0F: FN+HOME (brightness up) */ 1033 KEY_RESERVED, /* 0x0F: FN+HOME (brightness up) */
991 /* Scan codes 0x10 to 0x1F: Extended ACPI HKEY hot keys */
992 KEY_RESERVED, /* 0x10: FN+END (brightness down) */ 1034 KEY_RESERVED, /* 0x10: FN+END (brightness down) */
1035
993 KEY_RESERVED, /* 0x11: FN+PGUP (thinklight toggle) */ 1036 KEY_RESERVED, /* 0x11: FN+PGUP (thinklight toggle) */
1037
994 KEY_UNKNOWN, /* 0x12: FN+PGDOWN */ 1038 KEY_UNKNOWN, /* 0x12: FN+PGDOWN */
995 KEY_ZOOM, /* 0x13: FN+SPACE (zoom) */ 1039 KEY_ZOOM, /* 0x13: FN+SPACE (zoom) */
1040
1041 /* Volume: z60/z61, T60 (BIOS version?): firmware always
1042 * react to it and reprograms the built-in *extra* mixer.
1043 * Never map it to control another mixer by default.
1044 *
1045 * T60?, T61, R60?, R61: firmware and EC tries to send
1046 * these over the regular keyboard, so these are no-ops,
1047 * but there are still weird bugs re. MUTE, so do not
1048 * change unless you get test reports from all Lenovo
1049 * models. May cause the BIOS to interfere with the
1050 * HDA mixer.
1051 */
996 KEY_RESERVED, /* 0x14: VOLUME UP */ 1052 KEY_RESERVED, /* 0x14: VOLUME UP */
997 KEY_RESERVED, /* 0x15: VOLUME DOWN */ 1053 KEY_RESERVED, /* 0x15: VOLUME DOWN */
998 KEY_RESERVED, /* 0x16: MUTE */ 1054 KEY_RESERVED, /* 0x16: MUTE */
1055
999 KEY_VENDOR, /* 0x17: Thinkpad/AccessIBM/Lenovo */ 1056 KEY_VENDOR, /* 0x17: Thinkpad/AccessIBM/Lenovo */
1057
1000 /* (assignments unknown, please report if found) */ 1058 /* (assignments unknown, please report if found) */
1001 KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, 1059 KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN,
1002 KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, 1060 KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN,