Add patches accepted for 2.6.25-rc1
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / releases / upstream / 2.6.25-rc1 / 0001-ACPI-thinkpad-acpi-document-keymap-gotcha-s-v2.patch
blob552f307c6b1d4aac8a7c46f53bb4130c3a1c49ae
1 From 0f089147e620e083f58a0e641f701bd4244b455b Mon Sep 17 00:00:00 2001
2 From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
3 Date: Tue, 8 Jan 2008 13:02:38 -0200
4 Subject: ACPI: thinkpad-acpi: document keymap gotcha's (v2)
6 Publish the requirements for keymap changes. This is a documentation
7 change, only.
9 Currently, people look at the thinkpad-acpi default keymaps, and think:
10 "modifying this is a trivial thing, it can't break systems, and there are
11 keys defined for foo and bar, but the driver has them as KEY_RESERVED.
12 Must have been an oversight, let me change it."
14 And since they never get to see the bug reports, because they are not
15 really a part of the Linux ThinkPad users community (linux-thinkpad
16 mailinglist, thinkwiki wiki, thinkpad forums) and laptop users are slow
17 to complain to distros about any breakages...
19 Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
20 Signed-off-by: Len Brown <len.brown@intel.com>
21 ---
22 drivers/misc/thinkpad_acpi.c | 68 ++++++++++++++++++++++++++++++++++++++---
23 1 files changed, 63 insertions(+), 5 deletions(-)
25 diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
26 index cf56647..7b1080f 100644
27 --- a/drivers/misc/thinkpad_acpi.c
28 +++ b/drivers/misc/thinkpad_acpi.c
29 @@ -954,26 +954,67 @@ static struct attribute *hotkey_mask_attributes[] __initdata = {
31 static int __init hotkey_init(struct ibm_init_struct *iibm)
34 + /* Requirements for changing the default keymaps:
35 + *
36 + * 1. Many of the keys are mapped to KEY_RESERVED for very
37 + * good reasons. Do not change them unless you have deep
38 + * knowledge on the IBM and Lenovo ThinkPad firmware for
39 + * the various ThinkPad models. The driver behaves
40 + * differently for KEY_RESERVED: such keys have their
41 + * hot key mask *unset* in mask_recommended, and also
42 + * in the initial hot key mask programmed into the
43 + * firmware at driver load time, which means the firm-
44 + * ware may react very differently if you change them to
45 + * something else;
46 + *
47 + * 2. You must be subscribed to the linux-thinkpad and
48 + * ibm-acpi-devel mailing lists, and you should read the
49 + * list archives since 2007 if you want to change the
50 + * keymaps. This requirement exists so that you will
51 + * know the past history of problems with the thinkpad-
52 + * acpi driver keymaps, and also that you will be
53 + * listening to any bug reports;
54 + *
55 + * 3. Do not send thinkpad-acpi specific patches directly to
56 + * for merging, *ever*. Send them to the linux-acpi
57 + * mailinglist for comments. Merging is to be done only
58 + * through acpi-test and the ACPI maintainer.
59 + *
60 + * If the above is too much to ask, don't change the keymap.
61 + * Ask the thinkpad-acpi maintainer to do it, instead.
62 + */
63 static u16 ibm_keycode_map[] __initdata = {
64 /* Scan Codes 0x00 to 0x0B: ACPI HKEY FN+F1..F12 */
65 KEY_FN_F1, KEY_FN_F2, KEY_COFFEE, KEY_SLEEP,
66 KEY_WLAN, KEY_FN_F6, KEY_SWITCHVIDEOMODE, KEY_FN_F8,
67 KEY_FN_F9, KEY_FN_F10, KEY_FN_F11, KEY_SUSPEND,
68 - /* Scan codes 0x0C to 0x0F: Other ACPI HKEY hot keys */
70 + /* Scan codes 0x0C to 0x1F: Other ACPI HKEY hot keys */
71 KEY_UNKNOWN, /* 0x0C: FN+BACKSPACE */
72 KEY_UNKNOWN, /* 0x0D: FN+INSERT */
73 KEY_UNKNOWN, /* 0x0E: FN+DELETE */
75 + /* brightness: firmware always reacts to them, unless
76 + * X.org did some tricks in the radeon BIOS scratch
77 + * registers of *some* models */
78 KEY_RESERVED, /* 0x0F: FN+HOME (brightness up) */
79 - /* Scan codes 0x10 to 0x1F: Extended ACPI HKEY hot keys */
80 KEY_RESERVED, /* 0x10: FN+END (brightness down) */
82 + /* Thinklight: firmware always react to it */
83 KEY_RESERVED, /* 0x11: FN+PGUP (thinklight toggle) */
85 KEY_UNKNOWN, /* 0x12: FN+PGDOWN */
86 KEY_ZOOM, /* 0x13: FN+SPACE (zoom) */
88 + /* Volume: firmware always react to it and reprograms
89 + * the built-in *extra* mixer. Never map it to control
90 + * another mixer by default. */
91 KEY_RESERVED, /* 0x14: VOLUME UP */
92 KEY_RESERVED, /* 0x15: VOLUME DOWN */
93 KEY_RESERVED, /* 0x16: MUTE */
95 KEY_VENDOR, /* 0x17: Thinkpad/AccessIBM/Lenovo */
97 /* (assignments unknown, please report if found) */
98 KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN,
99 KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN,
100 @@ -983,20 +1024,37 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
101 KEY_FN_F1, KEY_COFFEE, KEY_BATTERY, KEY_SLEEP,
102 KEY_WLAN, KEY_FN_F6, KEY_SWITCHVIDEOMODE, KEY_FN_F8,
103 KEY_FN_F9, KEY_FN_F10, KEY_FN_F11, KEY_SUSPEND,
104 - /* Scan codes 0x0C to 0x0F: Other ACPI HKEY hot keys */
106 + /* Scan codes 0x0C to 0x1F: Other ACPI HKEY hot keys */
107 KEY_UNKNOWN, /* 0x0C: FN+BACKSPACE */
108 KEY_UNKNOWN, /* 0x0D: FN+INSERT */
109 KEY_UNKNOWN, /* 0x0E: FN+DELETE */
111 KEY_RESERVED, /* 0x0F: FN+HOME (brightness up) */
112 - /* Scan codes 0x10 to 0x1F: Extended ACPI HKEY hot keys */
113 KEY_RESERVED, /* 0x10: FN+END (brightness down) */
115 KEY_RESERVED, /* 0x11: FN+PGUP (thinklight toggle) */
117 KEY_UNKNOWN, /* 0x12: FN+PGDOWN */
118 KEY_ZOOM, /* 0x13: FN+SPACE (zoom) */
120 + /* Volume: z60/z61, T60 (BIOS version?): firmware always
121 + * react to it and reprograms the built-in *extra* mixer.
122 + * Never map it to control another mixer by default.
124 + * T60?, T61, R60?, R61: firmware and EC tries to send
125 + * these over the regular keyboard, so these are no-ops,
126 + * but there are still weird bugs re. MUTE, so do not
127 + * change unless you get test reports from all Lenovo
128 + * models. May cause the BIOS to interfere with the
129 + * HDA mixer.
130 + */
131 KEY_RESERVED, /* 0x14: VOLUME UP */
132 KEY_RESERVED, /* 0x15: VOLUME DOWN */
133 KEY_RESERVED, /* 0x16: MUTE */
135 KEY_VENDOR, /* 0x17: Thinkpad/AccessIBM/Lenovo */
137 /* (assignments unknown, please report if found) */
138 KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN,
139 KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN,
141 1.5.3.8