aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/thinkpad-acpi.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/thinkpad-acpi.txt')
-rw-r--r--Documentation/thinkpad-acpi.txt353
1 files changed, 276 insertions, 77 deletions
diff --git a/Documentation/thinkpad-acpi.txt b/Documentation/thinkpad-acpi.txt
index 9e6b94face4b..6711fbcf4080 100644
--- a/Documentation/thinkpad-acpi.txt
+++ b/Documentation/thinkpad-acpi.txt
@@ -1,11 +1,11 @@
1 ThinkPad ACPI Extras Driver 1 ThinkPad ACPI Extras Driver
2 2
3 Version 0.14 3 Version 0.15
4 April 21st, 2007 4 July 1st, 2007
5 5
6 Borislav Deianov <borislav@users.sf.net> 6 Borislav Deianov <borislav@users.sf.net>
7 Henrique de Moraes Holschuh <hmh@hmh.eng.br> 7 Henrique de Moraes Holschuh <hmh@hmh.eng.br>
8 http://ibm-acpi.sf.net/ 8 http://ibm-acpi.sf.net/
9 9
10 10
11This is a Linux driver for the IBM and Lenovo ThinkPad laptops. It 11This is a Linux driver for the IBM and Lenovo ThinkPad laptops. It
@@ -134,54 +134,68 @@ end of this document. Changes to the sysfs interface done by the kernel
134subsystems are not documented here, nor are they tracked by this 134subsystems are not documented here, nor are they tracked by this
135attribute. 135attribute.
136 136
137Changes to the thinkpad-acpi sysfs interface are only considered
138non-experimental when they are submitted to Linux mainline, at which
139point the changes in this interface are documented and interface_version
140may be updated. If you are using any thinkpad-acpi features not yet
141sent to mainline for merging, you do so on your own risk: these features
142may disappear, or be implemented in a different and incompatible way by
143the time they are merged in Linux mainline.
144
145Changes that are backwards-compatible by nature (e.g. the addition of
146attributes that do not change the way the other attributes work) do not
147always warrant an update of interface_version. Therefore, one must
148expect that an attribute might not be there, and deal with it properly
149(an attribute not being there *is* a valid way to make it clear that a
150feature is not available in sysfs).
151
137Hot keys 152Hot keys
138-------- 153--------
139 154
140procfs: /proc/acpi/ibm/hotkey 155procfs: /proc/acpi/ibm/hotkey
141sysfs device attribute: hotkey_* 156sysfs device attribute: hotkey_*
142 157
143Without this driver, only the Fn-F4 key (sleep button) generates an 158In a ThinkPad, the ACPI HKEY handler is responsible for comunicating
144ACPI event. With the driver loaded, the hotkey feature enabled and the 159some important events and also keyboard hot key presses to the operating
145mask set (see below), the various hot keys generate ACPI events in the 160system. Enabling the hotkey functionality of thinkpad-acpi signals the
161firmware that such a driver is present, and modifies how the ThinkPad
162firmware will behave in many situations.
163
164When the hotkey feature is enabled and the hot key mask is set (see
165below), the various hot keys either generate ACPI events in the
146following format: 166following format:
147 167
148 ibm/hotkey HKEY 00000080 0000xxxx 168 ibm/hotkey HKEY 00000080 0000xxxx
149 169
150The last four digits vary depending on the key combination pressed. 170or events over the input layer. The input layer support accepts the
151All labeled Fn-Fx key combinations generate distinct events. In 171standard IOCTLs to remap the keycodes assigned to each hotkey.
152addition, the lid microswitch and some docking station buttons may 172
153also generate such events. 173When the input device is open, the driver will suppress any ACPI hot key
154 174events that get translated into a meaningful input layer event, in order
155The bit mask allows some control over which hot keys generate ACPI 175to avoid sending duplicate events to userspace. Hot keys that are
156events. Not all bits in the mask can be modified. Not all bits that 176mapped to KEY_RESERVED in the keymap are not translated, and will always
157can be modified do anything. Not all hot keys can be individually 177generate an ACPI ibm/hotkey HKEY event, and no input layer events.
158controlled by the mask. Most recent ThinkPad models honor the 178
159following bits (assuming the hot keys feature has been enabled): 179The hot key bit mask allows some control over which hot keys generate
160 180events. If a key is "masked" (bit set to 0 in the mask), the firmware
161 key bit behavior when set behavior when unset 181will handle it. If it is "unmasked", it signals the firmware that
162 182thinkpad-acpi would prefer to handle it, if the firmware would be so
163 Fn-F3 always generates ACPI event 183kind to allow it (and it often doesn't!).
164 Fn-F4 always generates ACPI event 184
165 Fn-F5 0010 generate ACPI event enable/disable Bluetooth 185Not all bits in the mask can be modified. Not all bits that can be
166 Fn-F7 0040 generate ACPI event switch LCD and external display 186modified do anything. Not all hot keys can be individually controlled
167 Fn-F8 0080 generate ACPI event expand screen or none 187by the mask. Some models do not support the mask at all, and in those
168 Fn-F9 0100 generate ACPI event none 188models, hot keys cannot be controlled individually. The behaviour of
169 Fn-F12 always generates ACPI event 189the mask is, therefore, higly dependent on the ThinkPad model.
170 190
171Some models do not support all of the above. For example, the T30 does 191Note that unmasking some keys prevents their default behavior. For
172not support Fn-F5 and Fn-F9. Other models do not support the mask at 192example, if Fn+F5 is unmasked, that key will no longer enable/disable
173all. On those models, hot keys cannot be controlled individually. 193Bluetooth by itself.
174 194
175Note that enabling ACPI events for some keys prevents their default 195Note also that not all Fn key combinations are supported through ACPI.
176behavior. For example, if events for Fn-F5 are enabled, that key will 196For example, on the X40, the brightness, volume and "Access IBM" buttons
177no longer enable/disable Bluetooth by itself. This can still be done 197do not generate ACPI events even with this driver. They *can* be used
178from an acpid handler for the ibm/hotkey event. 198through the "ThinkPad Buttons" utility, see http://www.nongnu.org/tpb/
179
180Note also that not all Fn key combinations are supported through
181ACPI. For example, on the X40, the brightness, volume and "Access IBM"
182buttons do not generate ACPI events even with this driver. They *can*
183be used through the "ThinkPad Buttons" utility, see
184http://www.nongnu.org/tpb/
185 199
186procfs notes: 200procfs notes:
187 201
@@ -189,9 +203,9 @@ The following commands can be written to the /proc/acpi/ibm/hotkey file:
189 203
190 echo enable > /proc/acpi/ibm/hotkey -- enable the hot keys feature 204 echo enable > /proc/acpi/ibm/hotkey -- enable the hot keys feature
191 echo disable > /proc/acpi/ibm/hotkey -- disable the hot keys feature 205 echo disable > /proc/acpi/ibm/hotkey -- disable the hot keys feature
192 echo 0xffff > /proc/acpi/ibm/hotkey -- enable all possible hot keys 206 echo 0xffffffff > /proc/acpi/ibm/hotkey -- enable all hot keys
193 echo 0x0000 > /proc/acpi/ibm/hotkey -- disable all possible hot keys 207 echo 0 > /proc/acpi/ibm/hotkey -- disable all possible hot keys
194 ... any other 4-hex-digit mask ... 208 ... any other 8-hex-digit mask ...
195 echo reset > /proc/acpi/ibm/hotkey -- restore the original mask 209 echo reset > /proc/acpi/ibm/hotkey -- restore the original mask
196 210
197sysfs notes: 211sysfs notes:
@@ -202,7 +216,7 @@ sysfs notes:
202 key feature status will be restored to this value. 216 key feature status will be restored to this value.
203 217
204 0: hot keys were disabled 218 0: hot keys were disabled
205 1: hot keys were enabled 219 1: hot keys were enabled (unusual)
206 220
207 hotkey_bios_mask: 221 hotkey_bios_mask:
208 Returns the hot keys mask when thinkpad-acpi was loaded. 222 Returns the hot keys mask when thinkpad-acpi was loaded.
@@ -217,9 +231,182 @@ sysfs notes:
217 1: enables the hot keys feature / feature enabled 231 1: enables the hot keys feature / feature enabled
218 232
219 hotkey_mask: 233 hotkey_mask:
220 bit mask to enable ACPI event generation for each hot 234 bit mask to enable driver-handling and ACPI event
221 key (see above). Returns the current status of the hot 235 generation for each hot key (see above). Returns the
222 keys mask, and allows one to modify it. 236 current status of the hot keys mask, and allows one to
237 modify it.
238
239 hotkey_all_mask:
240 bit mask that should enable event reporting for all
241 supported hot keys, when echoed to hotkey_mask above.
242 Unless you know which events need to be handled
243 passively (because the firmware *will* handle them
244 anyway), do *not* use hotkey_all_mask. Use
245 hotkey_recommended_mask, instead. You have been warned.
246
247 hotkey_recommended_mask:
248 bit mask that should enable event reporting for all
249 supported hot keys, except those which are always
250 handled by the firmware anyway. Echo it to
251 hotkey_mask above, to use.
252
253 hotkey_radio_sw:
254 if the ThinkPad has a hardware radio switch, this
255 attribute will read 0 if the switch is in the "radios
256 disabled" postition, and 1 if the switch is in the
257 "radios enabled" position.
258
259input layer notes:
260
261A Hot key is mapped to a single input layer EV_KEY event, possibly
262followed by an EV_MSC MSC_SCAN event that shall contain that key's scan
263code. An EV_SYN event will always be generated to mark the end of the
264event block.
265
266Do not use the EV_MSC MSC_SCAN events to process keys. They are to be
267used as a helper to remap keys, only. They are particularly useful when
268remapping KEY_UNKNOWN keys.
269
270The events are available in an input device, with the following id:
271
272 Bus: BUS_HOST
273 vendor: 0x1014 (PCI_VENDOR_ID_IBM) or
274 0x17aa (PCI_VENDOR_ID_LENOVO)
275 product: 0x5054 ("TP")
276 version: 0x4101
277
278The version will have its LSB incremented if the keymap changes in a
279backwards-compatible way. The MSB shall always be 0x41 for this input
280device. If the MSB is not 0x41, do not use the device as described in
281this section, as it is either something else (e.g. another input device
282exported by a thinkpad driver, such as HDAPS) or its functionality has
283been changed in a non-backwards compatible way.
284
285Adding other event types for other functionalities shall be considered a
286backwards-compatible change for this input device.
287
288Thinkpad-acpi Hot Key event map (version 0x4101):
289
290ACPI Scan
291event code Key Notes
292
2930x1001 0x00 FN+F1 -
2940x1002 0x01 FN+F2 IBM: battery (rare)
295 Lenovo: Screen lock
296
2970x1003 0x02 FN+F3 Many IBM models always report
298 this hot key, even with hot keys
299 disabled or with Fn+F3 masked
300 off
301 IBM: screen lock
302 Lenovo: battery
303
3040x1004 0x03 FN+F4 Sleep button (ACPI sleep button
305 semanthics, i.e. sleep-to-RAM).
306 It is always generate some kind
307 of event, either the hot key
308 event or a ACPI sleep button
309 event. The firmware may
310 refuse to generate further FN+F4
311 key presses until a S3 or S4 ACPI
312 sleep cycle is performed or some
313 time passes.
314
3150x1005 0x04 FN+F5 Radio. Enables/disables
316 the internal BlueTooth hardware
317 and W-WAN card if left in control
318 of the firmware. Does not affect
319 the WLAN card.
320 Should be used to turn on/off all
321 radios (bluetooth+W-WAN+WLAN),
322 really.
323
3240x1006 0x05 FN+F6 -
325
3260x1007 0x06 FN+F7 Video output cycle.
327 Do you feel lucky today?
328
3290x1008 0x07 FN+F8 IBM: toggle screen expand
330 Lenovo: configure ultranav
331
3320x1009 0x08 FN+F9 -
333 .. .. ..
3340x100B 0x0A FN+F11 -
335
3360x100C 0x0B FN+F12 Sleep to disk. You are always
337 supposed to handle it yourself,
338 either through the ACPI event,
339 or through a hotkey event.
340 The firmware may refuse to
341 generate further FN+F4 key
342 press events until a S3 or S4
343 ACPI sleep cycle is performed,
344 or some time passes.
345
3460x100D 0x0C FN+BACKSPACE -
3470x100E 0x0D FN+INSERT -
3480x100F 0x0E FN+DELETE -
349
3500x1010 0x0F FN+HOME Brightness up. This key is
351 always handled by the firmware
352 in IBM ThinkPads, even when
353 unmasked. Just leave it alone.
354 For Lenovo ThinkPads with a new
355 BIOS, it has to be handled either
356 by the ACPI OSI, or by userspace.
3570x1011 0x10 FN+END Brightness down. See brightness
358 up for details.
359
3600x1012 0x11 FN+PGUP Thinklight toggle. This key is
361 always handled by the firmware,
362 even when unmasked.
363
3640x1013 0x12 FN+PGDOWN -
365
3660x1014 0x13 FN+SPACE Zoom key
367
3680x1015 0x14 VOLUME UP Internal mixer volume up. This
369 key is always handled by the
370 firmware, even when unmasked.
371 NOTE: Lenovo seems to be changing
372 this.
3730x1016 0x15 VOLUME DOWN Internal mixer volume up. This
374 key is always handled by the
375 firmware, even when unmasked.
376 NOTE: Lenovo seems to be changing
377 this.
3780x1017 0x16 MUTE Mute internal mixer. This
379 key is always handled by the
380 firmware, even when unmasked.
381
3820x1018 0x17 THINKPAD Thinkpad/Access IBM/Lenovo key
383
3840x1019 0x18 unknown
385.. .. ..
3860x1020 0x1F unknown
387
388The ThinkPad firmware does not allow one to differentiate when most hot
389keys are pressed or released (either that, or we don't know how to, yet).
390For these keys, the driver generates a set of events for a key press and
391immediately issues the same set of events for a key release. It is
392unknown by the driver if the ThinkPad firmware triggered these events on
393hot key press or release, but the firmware will do it for either one, not
394both.
395
396If a key is mapped to KEY_RESERVED, it generates no input events at all,
397and it may generate a legacy thinkpad-acpi ACPI hotkey event.
398
399If a key is mapped to KEY_UNKNOWN, it generates an input event that
400includes an scan code, and it may also generate a legacy thinkpad-acpi
401ACPI hotkey event.
402
403If a key is mapped to anything else, it will only generate legacy
404thinkpad-acpi ACPI hotkey events if nobody has opened the input device.
405
406Non hot-key ACPI HKEY event map:
4070x5001 Lid closed
4080x5002 Lid opened
4090x7000 Radio Switch may have changed state
223 410
224 411
225Bluetooth 412Bluetooth
@@ -437,27 +624,34 @@ CMOS control
437procfs: /proc/acpi/ibm/cmos 624procfs: /proc/acpi/ibm/cmos
438sysfs device attribute: cmos_command 625sysfs device attribute: cmos_command
439 626
440This feature is used internally by the ACPI firmware to control the 627This feature is mostly used internally by the ACPI firmware to keep the legacy
441ThinkLight on most newer ThinkPad models. It may also control LCD 628CMOS NVRAM bits in sync with the current machine state, and to record this
442brightness, sounds volume and more, but only on some models. 629state so that the ThinkPad will retain such settings across reboots.
630
631Some of these commands actually perform actions in some ThinkPad models, but
632this is expected to disappear more and more in newer models. As an example, in
633a T43 and in a X40, commands 12 and 13 still control the ThinkLight state for
634real, but commands 0 to 2 don't control the mixer anymore (they have been
635phased out) and just update the NVRAM.
443 636
444The range of valid cmos command numbers is 0 to 21, but not all have an 637The range of valid cmos command numbers is 0 to 21, but not all have an
445effect and the behavior varies from model to model. Here is the behavior 638effect and the behavior varies from model to model. Here is the behavior
446on the X40 (tpb is the ThinkPad Buttons utility): 639on the X40 (tpb is the ThinkPad Buttons utility):
447 640
448 0 - no effect but tpb reports "Volume down" 641 0 - Related to "Volume down" key press
449 1 - no effect but tpb reports "Volume up" 642 1 - Related to "Volume up" key press
450 2 - no effect but tpb reports "Mute on" 643 2 - Related to "Mute on" key press
451 3 - simulate pressing the "Access IBM" button 644 3 - Related to "Access IBM" key press
452 4 - LCD brightness up 645 4 - Related to "LCD brightness up" key pess
453 5 - LCD brightness down 646 5 - Related to "LCD brightness down" key press
454 11 - toggle screen expansion 647 11 - Related to "toggle screen expansion" key press/function
455 12 - ThinkLight on 648 12 - Related to "ThinkLight on"
456 13 - ThinkLight off 649 13 - Related to "ThinkLight off"
457 14 - no effect but tpb reports ThinkLight status change 650 14 - Related to "ThinkLight" key press (toggle thinklight)
458 651
459The cmos command interface is prone to firmware split-brain problems, as 652The cmos command interface is prone to firmware split-brain problems, as
460in newer ThinkPads it is just a compatibility layer. 653in newer ThinkPads it is just a compatibility layer. Do not use it, it is
654exported just as a debug tool.
461 655
462LED control -- /proc/acpi/ibm/led 656LED control -- /proc/acpi/ibm/led
463--------------------------------- 657---------------------------------
@@ -516,23 +710,15 @@ Temperature sensors
516procfs: /proc/acpi/ibm/thermal 710procfs: /proc/acpi/ibm/thermal
517sysfs device attributes: (hwmon) temp*_input 711sysfs device attributes: (hwmon) temp*_input
518 712
519Most ThinkPads include six or more separate temperature sensors but 713Most ThinkPads include six or more separate temperature sensors but only
520only expose the CPU temperature through the standard ACPI methods. 714expose the CPU temperature through the standard ACPI methods. This
521This feature shows readings from up to eight different sensors on older 715feature shows readings from up to eight different sensors on older
522ThinkPads, and it has experimental support for up to sixteen different 716ThinkPads, and up to sixteen different sensors on newer ThinkPads.
523sensors on newer ThinkPads.
524
525EXPERIMENTAL: The 16-sensors feature is marked EXPERIMENTAL because the
526implementation directly accesses hardware registers and may not work as
527expected. USE WITH CAUTION! To use this feature, you need to supply the
528experimental=1 parameter when loading the module. When EXPERIMENTAL
529mode is enabled, reading the first 8 sensors on newer ThinkPads will
530also use an new experimental thermal sensor access mode.
531 717
532For example, on the X40, a typical output may be: 718For example, on the X40, a typical output may be:
533temperatures: 42 42 45 41 36 -128 33 -128 719temperatures: 42 42 45 41 36 -128 33 -128
534 720
535EXPERIMENTAL: On the T43/p, a typical output may be: 721On the T43/p, a typical output may be:
536temperatures: 48 48 36 52 38 -128 31 -128 48 52 48 -128 -128 -128 -128 -128 722temperatures: 48 48 36 52 38 -128 31 -128 48 52 48 -128 -128 -128 -128 -128
537 723
538The mapping of thermal sensors to physical locations varies depending on 724The mapping of thermal sensors to physical locations varies depending on
@@ -562,7 +748,8 @@ http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_T43.2C_T43p
5622: System board, left side (near PCMCIA slot), reported as HDAPS temp 7482: System board, left side (near PCMCIA slot), reported as HDAPS temp
5633: PCMCIA slot 7493: PCMCIA slot
5649: MCH (northbridge) to DRAM Bus 7509: MCH (northbridge) to DRAM Bus
56510: ICH (southbridge), under Mini-PCI card, under touchpad 75110: Clock-generator, mini-pci card and ICH (southbridge), under Mini-PCI
752 card, under touchpad
56611: Power regulator, underside of system board, below F2 key 75311: Power regulator, underside of system board, below F2 key
567 754
568The A31 has a very atypical layout for the thermal sensors 755The A31 has a very atypical layout for the thermal sensors
@@ -681,6 +868,12 @@ cannot be controlled.
681The backlight control has eight levels, ranging from 0 to 7. Some of the 868The backlight control has eight levels, ranging from 0 to 7. Some of the
682levels may not be distinct. 869levels may not be distinct.
683 870
871There are two interfaces to the firmware for brightness control, EC and CMOS.
872To select which one should be used, use the brightness_mode module parameter:
873brightness_mode=1 selects EC mode, brightness_mode=2 selects CMOS mode,
874brightness_mode=3 selects both EC and CMOS. The driver tries to autodetect
875which interface to use.
876
684Procfs notes: 877Procfs notes:
685 878
686 The available commands are: 879 The available commands are:
@@ -976,3 +1169,9 @@ Sysfs interface changelog:
976 1169
9770x000100: Initial sysfs support, as a single platform driver and 11700x000100: Initial sysfs support, as a single platform driver and
978 device. 1171 device.
11720x000200: Hot key support for 32 hot keys, and radio slider switch
1173 support.
11740x010000: Hot keys are now handled by default over the input
1175 layer, the radio switch generates input event EV_RADIO,
1176 and the driver enables hot key handling by default in
1177 the firmware.