blob: 333b8eb97f963ea98ee289767ba1b7ce8593bdf6 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001 IBM ThinkPad ACPI Extras Driver
2
Borislav Deianov78f81cc2005-08-17 00:00:00 -04003 Version 0.12
4 17 August 2005
Linus Torvalds1da177e2005-04-16 15:20:36 -07005
6 Borislav Deianov <borislav@users.sf.net>
7 http://ibm-acpi.sf.net/
8
9
Borislav Deianov78f81cc2005-08-17 00:00:00 -040010This is a Linux ACPI driver for the IBM ThinkPad laptops. It supports
11various features of these laptops which are accessible through the
12ACPI framework but not otherwise supported by the generic Linux ACPI
13drivers.
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
15
16Status
17------
18
19The features currently supported are the following (see below for
20detailed description):
21
22 - Fn key combinations
23 - Bluetooth enable and disable
24 - video output switching, expansion control
25 - ThinkLight on and off
26 - limited docking and undocking
27 - UltraBay eject
Borislav Deianov78f81cc2005-08-17 00:00:00 -040028 - CMOS control
29 - LED control
30 - ACPI sounds
31 - temperature sensors
32 - Experimental: embedded controller register dump
Stefan Schmidt24f7ff02006-09-22 12:19:15 +020033 - LCD brightness control
34 - Volume control
Borislav Deianov78f81cc2005-08-17 00:00:00 -040035 - Experimental: fan speed, fan enable/disable
Stefan Schmidt28b779d2006-09-22 12:19:16 +020036 - Experimental: WAN enable and disable
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
38A compatibility table by model and feature is maintained on the web
39site, http://ibm-acpi.sf.net/. I appreciate any success or failure
40reports, especially if they add to or correct the compatibility table.
41Please include the following information in your report:
42
43 - ThinkPad model name
44 - a copy of your DSDT, from /proc/acpi/dsdt
45 - which driver features work and which don't
46 - the observed behavior of non-working features
47
48Any other comments or patches are also more than welcome.
49
50
51Installation
52------------
53
54If you are compiling this driver as included in the Linux kernel
55sources, simply enable the CONFIG_ACPI_IBM option (Power Management /
Pavel Machek2fe6dff2006-08-31 14:15:54 +020056ACPI / IBM ThinkPad Laptop Extras).
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
58Features
59--------
60
61The driver creates the /proc/acpi/ibm directory. There is a file under
62that directory for each feature described below. Note that while the
63driver is still in the alpha stage, the exact proc file format and
64commands supported by the various features is guaranteed to change
65frequently.
66
Borislav Deianov78f81cc2005-08-17 00:00:00 -040067Driver version -- /proc/acpi/ibm/driver
68---------------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -070069
70The driver name and version. No commands can be written to this file.
71
Borislav Deianov78f81cc2005-08-17 00:00:00 -040072Hot keys -- /proc/acpi/ibm/hotkey
Linus Torvalds1da177e2005-04-16 15:20:36 -070073---------------------------------
74
75Without this driver, only the Fn-F4 key (sleep button) generates an
76ACPI event. With the driver loaded, the hotkey feature enabled and the
77mask set (see below), the various hot keys generate ACPI events in the
78following format:
79
80 ibm/hotkey HKEY 00000080 0000xxxx
81
82The last four digits vary depending on the key combination pressed.
83All labeled Fn-Fx key combinations generate distinct events. In
84addition, the lid microswitch and some docking station buttons may
85also generate such events.
86
87The following commands can be written to this file:
88
89 echo enable > /proc/acpi/ibm/hotkey -- enable the hot keys feature
90 echo disable > /proc/acpi/ibm/hotkey -- disable the hot keys feature
91 echo 0xffff > /proc/acpi/ibm/hotkey -- enable all possible hot keys
92 echo 0x0000 > /proc/acpi/ibm/hotkey -- disable all possible hot keys
93 ... any other 4-hex-digit mask ...
94 echo reset > /proc/acpi/ibm/hotkey -- restore the original mask
95
96The bit mask allows some control over which hot keys generate ACPI
97events. Not all bits in the mask can be modified. Not all bits that
98can be modified do anything. Not all hot keys can be individually
99controlled by the mask. Most recent ThinkPad models honor the
100following bits (assuming the hot keys feature has been enabled):
101
102 key bit behavior when set behavior when unset
103
104 Fn-F3 always generates ACPI event
105 Fn-F4 always generates ACPI event
106 Fn-F5 0010 generate ACPI event enable/disable Bluetooth
107 Fn-F7 0040 generate ACPI event switch LCD and external display
108 Fn-F8 0080 generate ACPI event expand screen or none
109 Fn-F9 0100 generate ACPI event none
110 Fn-F12 always generates ACPI event
111
112Some models do not support all of the above. For example, the T30 does
113not support Fn-F5 and Fn-F9. Other models do not support the mask at
114all. On those models, hot keys cannot be controlled individually.
115
116Note that enabling ACPI events for some keys prevents their default
117behavior. For example, if events for Fn-F5 are enabled, that key will
118no longer enable/disable Bluetooth by itself. This can still be done
119from an acpid handler for the ibm/hotkey event.
120
121Note also that not all Fn key combinations are supported through
122ACPI. For example, on the X40, the brightness, volume and "Access IBM"
123buttons do not generate ACPI events even with this driver. They *can*
124be used through the "ThinkPad Buttons" utility, see
125http://www.nongnu.org/tpb/
126
127Bluetooth -- /proc/acpi/ibm/bluetooth
128-------------------------------------
129
130This feature shows the presence and current state of a Bluetooth
131device. If Bluetooth is installed, the following commands can be used:
132
133 echo enable > /proc/acpi/ibm/bluetooth
134 echo disable > /proc/acpi/ibm/bluetooth
135
136Video output control -- /proc/acpi/ibm/video
137--------------------------------------------
138
139This feature allows control over the devices used for video output -
140LCD, CRT or DVI (if available). The following commands are available:
141
142 echo lcd_enable > /proc/acpi/ibm/video
143 echo lcd_disable > /proc/acpi/ibm/video
144 echo crt_enable > /proc/acpi/ibm/video
145 echo crt_disable > /proc/acpi/ibm/video
146 echo dvi_enable > /proc/acpi/ibm/video
147 echo dvi_disable > /proc/acpi/ibm/video
148 echo auto_enable > /proc/acpi/ibm/video
149 echo auto_disable > /proc/acpi/ibm/video
150 echo expand_toggle > /proc/acpi/ibm/video
151 echo video_switch > /proc/acpi/ibm/video
152
153Each video output device can be enabled or disabled individually.
154Reading /proc/acpi/ibm/video shows the status of each device.
155
156Automatic video switching can be enabled or disabled. When automatic
157video switching is enabled, certain events (e.g. opening the lid,
158docking or undocking) cause the video output device to change
159automatically. While this can be useful, it also causes flickering
160and, on the X40, video corruption. By disabling automatic switching,
161the flickering or video corruption can be avoided.
162
163The video_switch command cycles through the available video outputs
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400164(it simulates the behavior of Fn-F7).
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165
166Video expansion can be toggled through this feature. This controls
167whether the display is expanded to fill the entire LCD screen when a
168mode with less than full resolution is used. Note that the current
169video expansion status cannot be determined through this feature.
170
171Note that on many models (particularly those using Radeon graphics
172chips) the X driver configures the video card in a way which prevents
173Fn-F7 from working. This also disables the video output switching
174features of this driver, as it uses the same ACPI methods as
175Fn-F7. Video switching on the console should still work.
176
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400177UPDATE: There's now a patch for the X.org Radeon driver which
178addresses this issue. Some people are reporting success with the patch
179while others are still having problems. For more information:
180
181https://bugs.freedesktop.org/show_bug.cgi?id=2000
182
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183ThinkLight control -- /proc/acpi/ibm/light
184------------------------------------------
185
186The current status of the ThinkLight can be found in this file. A few
187models which do not make the status available will show it as
188"unknown". The available commands are:
189
190 echo on > /proc/acpi/ibm/light
191 echo off > /proc/acpi/ibm/light
192
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400193Docking / undocking -- /proc/acpi/ibm/dock
Linus Torvalds1da177e2005-04-16 15:20:36 -0700194------------------------------------------
195
196Docking and undocking (e.g. with the X4 UltraBase) requires some
197actions to be taken by the operating system to safely make or break
198the electrical connections with the dock.
199
200The docking feature of this driver generates the following ACPI events:
201
202 ibm/dock GDCK 00000003 00000001 -- eject request
203 ibm/dock GDCK 00000003 00000002 -- undocked
204 ibm/dock GDCK 00000000 00000003 -- docked
205
206NOTE: These events will only be generated if the laptop was docked
207when originally booted. This is due to the current lack of support for
208hot plugging of devices in the Linux ACPI framework. If the laptop was
209booted while not in the dock, the following message is shown in the
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400210logs:
211
212 Mar 17 01:42:34 aero kernel: ibm_acpi: dock device not present
213
214In this case, no dock-related events are generated but the dock and
215undock commands described below still work. They can be executed
216manually or triggered by Fn key combinations (see the example acpid
217configuration files included in the driver tarball package available
218on the web site).
Linus Torvalds1da177e2005-04-16 15:20:36 -0700219
220When the eject request button on the dock is pressed, the first event
221above is generated. The handler for this event should issue the
222following command:
223
224 echo undock > /proc/acpi/ibm/dock
225
226After the LED on the dock goes off, it is safe to eject the laptop.
227Note: if you pressed this key by mistake, go ahead and eject the
228laptop, then dock it back in. Otherwise, the dock may not function as
229expected.
230
231When the laptop is docked, the third event above is generated. The
232handler for this event should issue the following command to fully
233enable the dock:
234
235 echo dock > /proc/acpi/ibm/dock
236
237The contents of the /proc/acpi/ibm/dock file shows the current status
238of the dock, as provided by the ACPI framework.
239
240The docking support in this driver does not take care of enabling or
241disabling any other devices you may have attached to the dock. For
242example, a CD drive plugged into the UltraBase needs to be disabled or
243enabled separately. See the provided example acpid configuration files
244for how this can be accomplished.
245
246There is no support yet for PCI devices that may be attached to a
247docking station, e.g. in the ThinkPad Dock II. The driver currently
248does not recognize, enable or disable such devices. This means that
249the only docking stations currently supported are the X-series
250UltraBase docks and "dumb" port replicators like the Mini Dock (the
251latter don't need any ACPI support, actually).
252
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400253UltraBay eject -- /proc/acpi/ibm/bay
Linus Torvalds1da177e2005-04-16 15:20:36 -0700254------------------------------------
255
256Inserting or ejecting an UltraBay device requires some actions to be
257taken by the operating system to safely make or break the electrical
258connections with the device.
259
260This feature generates the following ACPI events:
261
262 ibm/bay MSTR 00000003 00000000 -- eject request
263 ibm/bay MSTR 00000001 00000000 -- eject lever inserted
264
265NOTE: These events will only be generated if the UltraBay was present
266when the laptop was originally booted (on the X series, the UltraBay
267is in the dock, so it may not be present if the laptop was undocked).
268This is due to the current lack of support for hot plugging of devices
269in the Linux ACPI framework. If the laptop was booted without the
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400270UltraBay, the following message is shown in the logs:
271
272 Mar 17 01:42:34 aero kernel: ibm_acpi: bay device not present
273
274In this case, no bay-related events are generated but the eject
Linus Torvalds1da177e2005-04-16 15:20:36 -0700275command described below still works. It can be executed manually or
276triggered by a hot key combination.
277
278Sliding the eject lever generates the first event shown above. The
279handler for this event should take whatever actions are necessary to
280shut down the device in the UltraBay (e.g. call idectl), then issue
281the following command:
282
283 echo eject > /proc/acpi/ibm/bay
284
285After the LED on the UltraBay goes off, it is safe to pull out the
286device.
287
288When the eject lever is inserted, the second event above is
289generated. The handler for this event should take whatever actions are
290necessary to enable the UltraBay device (e.g. call idectl).
291
292The contents of the /proc/acpi/ibm/bay file shows the current status
293of the UltraBay, as provided by the ACPI framework.
294
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400295EXPERIMENTAL warm eject support on the 600e/x, A22p and A3x (To use
296this feature, you need to supply the experimental=1 parameter when
297loading the module):
Linus Torvalds1da177e2005-04-16 15:20:36 -0700298
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400299These models do not have a button near the UltraBay device to request
300a hot eject but rather require the laptop to be put to sleep
301(suspend-to-ram) before the bay device is ejected or inserted).
302The sequence of steps to eject the device is as follows:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700303
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400304 echo eject > /proc/acpi/ibm/bay
305 put the ThinkPad to sleep
306 remove the drive
307 resume from sleep
308 cat /proc/acpi/ibm/bay should show that the drive was removed
309
310On the A3x, both the UltraBay 2000 and UltraBay Plus devices are
311supported. Use "eject2" instead of "eject" for the second bay.
312
313Note: the UltraBay eject support on the 600e/x, A22p and A3x is
314EXPERIMENTAL and may not work as expected. USE WITH CAUTION!
315
316CMOS control -- /proc/acpi/ibm/cmos
317-----------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -0700318
319This feature is used internally by the ACPI firmware to control the
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400320ThinkLight on most newer ThinkPad models. It may also control LCD
321brightness, sounds volume and more, but only on some models.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700322
323The commands are non-negative integer numbers:
324
325 echo 0 >/proc/acpi/ibm/cmos
326 echo 1 >/proc/acpi/ibm/cmos
327 echo 2 >/proc/acpi/ibm/cmos
328 ...
329
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400330The range of valid numbers is 0 to 21, but not all have an effect and
331the behavior varies from model to model. Here is the behavior on the
332X40 (tpb is the ThinkPad Buttons utility):
Linus Torvalds1da177e2005-04-16 15:20:36 -0700333
334 0 - no effect but tpb reports "Volume down"
335 1 - no effect but tpb reports "Volume up"
336 2 - no effect but tpb reports "Mute on"
337 3 - simulate pressing the "Access IBM" button
338 4 - LCD brightness up
339 5 - LCD brightness down
340 11 - toggle screen expansion
341 12 - ThinkLight on
342 13 - ThinkLight off
343 14 - no effect but tpb reports ThinkLight status change
344
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400345LED control -- /proc/acpi/ibm/led
346---------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -0700347
348Some of the LED indicators can be controlled through this feature. The
349available commands are:
350
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400351 echo '<led number> on' >/proc/acpi/ibm/led
352 echo '<led number> off' >/proc/acpi/ibm/led
353 echo '<led number> blink' >/proc/acpi/ibm/led
Linus Torvalds1da177e2005-04-16 15:20:36 -0700354
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400355The <led number> range is 0 to 7. The set of LEDs that can be
356controlled varies from model to model. Here is the mapping on the X40:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700357
358 0 - power
359 1 - battery (orange)
360 2 - battery (green)
361 3 - UltraBase
362 4 - UltraBay
363 7 - standby
364
365All of the above can be turned on and off and can be made to blink.
366
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400367ACPI sounds -- /proc/acpi/ibm/beep
368----------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -0700369
370The BEEP method is used internally by the ACPI firmware to provide
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400371audible alerts in various situations. This feature allows the same
Linus Torvalds1da177e2005-04-16 15:20:36 -0700372sounds to be triggered manually.
373
374The commands are non-negative integer numbers:
375
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400376 echo <number> >/proc/acpi/ibm/beep
Linus Torvalds1da177e2005-04-16 15:20:36 -0700377
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400378The valid <number> range is 0 to 17. Not all numbers trigger sounds
379and the sounds vary from model to model. Here is the behavior on the
380X40:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700381
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400382 0 - stop a sound in progress (but use 17 to stop 16)
383 2 - two beeps, pause, third beep ("low battery")
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384 3 - single beep
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400385 4 - high, followed by low-pitched beep ("unable")
Linus Torvalds1da177e2005-04-16 15:20:36 -0700386 5 - single beep
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400387 6 - very high, followed by high-pitched beep ("AC/DC")
Linus Torvalds1da177e2005-04-16 15:20:36 -0700388 7 - high-pitched beep
389 9 - three short beeps
390 10 - very long beep
391 12 - low-pitched beep
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400392 15 - three high-pitched beeps repeating constantly, stop with 0
393 16 - one medium-pitched beep repeating constantly, stop with 17
394 17 - stop 16
Linus Torvalds1da177e2005-04-16 15:20:36 -0700395
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400396Temperature sensors -- /proc/acpi/ibm/thermal
397---------------------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -0700398
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400399Most ThinkPads include six or more separate temperature sensors but
400only expose the CPU temperature through the standard ACPI methods.
Henrique de Moraes Holschuh60eb0b32006-11-24 11:47:08 -0200401This feature shows readings from up to eight different sensors on older
402ThinkPads, and it has experimental support for up to sixteen different
403sensors on newer ThinkPads. Readings from sensors that are not available
404return -128.
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400405
406No commands can be written to this file.
407
Henrique de Moraes Holschuh60eb0b32006-11-24 11:47:08 -0200408EXPERIMENTAL: The 16-sensors feature is marked EXPERIMENTAL because the
409implementation directly accesses hardware registers and may not work as
410expected. USE WITH CAUTION! To use this feature, you need to supply the
411experimental=1 parameter when loading the module. When EXPERIMENTAL
412mode is enabled, reading the first 8 sensors on newer ThinkPads will
413also use an new experimental thermal sensor access mode.
414
415For example, on the X40, a typical output may be:
416temperatures: 42 42 45 41 36 -128 33 -128
417
418EXPERIMENTAL: On the T43/p, a typical output may be:
419temperatures: 48 48 36 52 38 -128 31 -128 48 52 48 -128 -128 -128 -128 -128
420
421The mapping of thermal sensors to physical locations varies depending on
422system-board model (and thus, on ThinkPad model).
423
424http://thinkwiki.org/wiki/Thermal_Sensors is a public wiki page that
425tries to track down these locations for various models.
426
427Most (newer?) models seem to follow this pattern:
428
4291: CPU
4302: (depends on model)
4313: (depends on model)
4324: GPU
4335: Main battery: main sensor
4346: Bay battery: main sensor
4357: Main battery: secondary sensor
4368: Bay battery: secondary sensor
4379-15: (depends on model)
438
439For the R51 (source: Thomas Gruber):
4402: Mini-PCI
4413: Internal HDD
442
443For the T43, T43/p (source: Shmidoax/Thinkwiki.org)
444http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_T43.2C_T43p
4452: System board, left side (near PCMCIA slot), reported as HDAPS temp
4463: PCMCIA slot
4479: MCH (northbridge) to DRAM Bus
44810: ICH (southbridge), under Mini-PCI card, under touchpad
44911: Power regulator, underside of system board, below F2 key
450
Henrique de Moraes Holschuh88679a12006-11-24 11:47:09 -0200451The A31 has a very atypical layout for the thermal sensors
452(source: Milos Popovic, http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_A31)
4531: CPU
4542: Main Battery: main sensor
4553: Power Converter
4564: Bay Battery: main sensor
4575: MCH (northbridge)
4586: PCMCIA/ambient
4597: Main Battery: secondary sensor
4608: Bay Battery: secondary sensor
461
Henrique de Moraes Holschuh60eb0b32006-11-24 11:47:08 -0200462
Matt LaPlanted6bc8ac2006-10-03 22:54:15 +0200463EXPERIMENTAL: Embedded controller register dump -- /proc/acpi/ibm/ecdump
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400464------------------------------------------------------------------------
465
466This feature is marked EXPERIMENTAL because the implementation
467directly accesses hardware registers and may not work as expected. USE
468WITH CAUTION! To use this feature, you need to supply the
469experimental=1 parameter when loading the module.
470
471This feature dumps the values of 256 embedded controller
472registers. Values which have changed since the last time the registers
473were dumped are marked with a star:
474
475[root@x40 ibm-acpi]# cat /proc/acpi/ibm/ecdump
476EC +00 +01 +02 +03 +04 +05 +06 +07 +08 +09 +0a +0b +0c +0d +0e +0f
477EC 0x00: a7 47 87 01 fe 96 00 08 01 00 cb 00 00 00 40 00
478EC 0x10: 00 00 ff ff f4 3c 87 09 01 ff 42 01 ff ff 0d 00
479EC 0x20: 00 00 00 00 00 00 00 00 00 00 00 03 43 00 00 80
480EC 0x30: 01 07 1a 00 30 04 00 00 *85 00 00 10 00 50 00 00
481EC 0x40: 00 00 00 00 00 00 14 01 00 04 00 00 00 00 00 00
482EC 0x50: 00 c0 02 0d 00 01 01 02 02 03 03 03 03 *bc *02 *bc
483EC 0x60: *02 *bc *02 00 00 00 00 00 00 00 00 00 00 00 00 00
484EC 0x70: 00 00 00 00 00 12 30 40 *24 *26 *2c *27 *20 80 *1f 80
485EC 0x80: 00 00 00 06 *37 *0e 03 00 00 00 0e 07 00 00 00 00
486EC 0x90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
487EC 0xa0: *ff 09 ff 09 ff ff *64 00 *00 *00 *a2 41 *ff *ff *e0 00
488EC 0xb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
489EC 0xc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
490EC 0xd0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
491EC 0xe0: 00 00 00 00 00 00 00 00 11 20 49 04 24 06 55 03
492EC 0xf0: 31 55 48 54 35 38 57 57 08 2f 45 73 07 65 6c 1a
493
494This feature can be used to determine the register holding the fan
495speed on some models. To do that, do the following:
496
497 - make sure the battery is fully charged
498 - make sure the fan is running
499 - run 'cat /proc/acpi/ibm/ecdump' several times, once per second or so
500
501The first step makes sure various charging-related values don't
502vary. The second ensures that the fan-related values do vary, since
503the fan speed fluctuates a bit. The third will (hopefully) mark the
504fan register with a star:
505
506[root@x40 ibm-acpi]# cat /proc/acpi/ibm/ecdump
507EC +00 +01 +02 +03 +04 +05 +06 +07 +08 +09 +0a +0b +0c +0d +0e +0f
508EC 0x00: a7 47 87 01 fe 96 00 08 01 00 cb 00 00 00 40 00
509EC 0x10: 00 00 ff ff f4 3c 87 09 01 ff 42 01 ff ff 0d 00
510EC 0x20: 00 00 00 00 00 00 00 00 00 00 00 03 43 00 00 80
511EC 0x30: 01 07 1a 00 30 04 00 00 85 00 00 10 00 50 00 00
512EC 0x40: 00 00 00 00 00 00 14 01 00 04 00 00 00 00 00 00
513EC 0x50: 00 c0 02 0d 00 01 01 02 02 03 03 03 03 bc 02 bc
514EC 0x60: 02 bc 02 00 00 00 00 00 00 00 00 00 00 00 00 00
515EC 0x70: 00 00 00 00 00 12 30 40 24 27 2c 27 21 80 1f 80
516EC 0x80: 00 00 00 06 *be 0d 03 00 00 00 0e 07 00 00 00 00
517EC 0x90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
518EC 0xa0: ff 09 ff 09 ff ff 64 00 00 00 a2 41 ff ff e0 00
519EC 0xb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
520EC 0xc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
521EC 0xd0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
522EC 0xe0: 00 00 00 00 00 00 00 00 11 20 49 04 24 06 55 03
523EC 0xf0: 31 55 48 54 35 38 57 57 08 2f 45 73 07 65 6c 1a
524
525Another set of values that varies often is the temperature
526readings. Since temperatures don't change vary fast, you can take
527several quick dumps to eliminate them.
528
529You can use a similar method to figure out the meaning of other
530embedded controller registers - e.g. make sure nothing else changes
531except the charging or discharging battery to determine which
532registers contain the current battery capacity, etc. If you experiment
533with this, do send me your results (including some complete dumps with
534a description of the conditions when they were taken.)
535
Stefan Schmidt24f7ff02006-09-22 12:19:15 +0200536LCD brightness control -- /proc/acpi/ibm/brightness
537---------------------------------------------------
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400538
539This feature allows software control of the LCD brightness on ThinkPad
540models which don't have a hardware brightness slider. The available
541commands are:
542
543 echo up >/proc/acpi/ibm/brightness
544 echo down >/proc/acpi/ibm/brightness
545 echo 'level <level>' >/proc/acpi/ibm/brightness
546
547The <level> number range is 0 to 7, although not all of them may be
548distinct. The current brightness level is shown in the file.
549
Stefan Schmidt24f7ff02006-09-22 12:19:15 +0200550Volume control -- /proc/acpi/ibm/volume
551---------------------------------------
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400552
553This feature allows volume control on ThinkPad models which don't have
554a hardware volume knob. The available commands are:
555
556 echo up >/proc/acpi/ibm/volume
557 echo down >/proc/acpi/ibm/volume
558 echo mute >/proc/acpi/ibm/volume
559 echo 'level <level>' >/proc/acpi/ibm/volume
560
561The <level> number range is 0 to 15 although not all of them may be
562distinct. The unmute the volume after the mute command, use either the
563up or down command (the level command will not unmute the volume).
564The current volume level and mute state is shown in the file.
565
566EXPERIMENTAL: fan speed, fan enable/disable -- /proc/acpi/ibm/fan
567-----------------------------------------------------------------
568
569This feature is marked EXPERIMENTAL because the implementation
570directly accesses hardware registers and may not work as expected. USE
571WITH CAUTION! To use this feature, you need to supply the
572experimental=1 parameter when loading the module.
573
574This feature attempts to show the current fan speed. The speed is read
575directly from the hardware registers of the embedded controller. This
576is known to work on later R, T and X series ThinkPads but may show a
577bogus value on other models.
578
579The fan may be enabled or disabled with the following commands:
580
581 echo enable >/proc/acpi/ibm/fan
582 echo disable >/proc/acpi/ibm/fan
583
584WARNING WARNING WARNING: do not leave the fan disabled unless you are
585monitoring the temperature sensor readings and you are ready to enable
586it if necessary to avoid overheating.
587
588The fan only runs if it's enabled *and* the various temperature
589sensors which control it read high enough. On the X40, this seems to
590depend on the CPU and HDD temperatures. Specifically, the fan is
591turned on when either the CPU temperature climbs to 56 degrees or the
592HDD temperature climbs to 46 degrees. The fan is turned off when the
593CPU temperature drops to 49 degrees and the HDD temperature drops to
59441 degrees. These thresholds cannot currently be controlled.
595
596On the X31 and X40 (and ONLY on those models), the fan speed can be
597controlled to a certain degree. Once the fan is running, it can be
598forced to run faster or slower with the following command:
599
600 echo 'speed <speed>' > /proc/acpi/ibm/thermal
601
602The sustainable range of fan speeds on the X40 appears to be from
603about 3700 to about 7350. Values outside this range either do not have
604any effect or the fan speed eventually settles somewhere in that
605range. The fan cannot be stopped or started with this command.
606
607On the 570, temperature readings are not available through this
608feature and the fan control works a little differently. The fan speed
609is reported in levels from 0 (off) to 7 (max) and can be controlled
610with the following command:
611
612 echo 'level <level>' > /proc/acpi/ibm/thermal
Linus Torvalds1da177e2005-04-16 15:20:36 -0700613
Stefan Schmidt28b779d2006-09-22 12:19:16 +0200614EXPERIMENTAL: WAN -- /proc/acpi/ibm/wan
615---------------------------------------
616
617This feature is marked EXPERIMENTAL because the implementation
618directly accesses hardware registers and may not work as expected. USE
619WITH CAUTION! To use this feature, you need to supply the
620experimental=1 parameter when loading the module.
621
622This feature shows the presence and current state of a WAN (Sierra
623Wireless EV-DO) device. If WAN is installed, the following commands can
624be used:
625
626 echo enable > /proc/acpi/ibm/wan
627 echo disable > /proc/acpi/ibm/wan
628
629It was tested on a Lenovo Thinkpad X60. It should probably work on other
630Thinkpad models which come with this module installed.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700631
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400632Multiple Commands, Module Parameters
633------------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -0700634
635Multiple commands can be written to the proc files in one shot by
636separating them with commas, for example:
637
638 echo enable,0xffff > /proc/acpi/ibm/hotkey
639 echo lcd_disable,crt_enable > /proc/acpi/ibm/video
640
641Commands can also be specified when loading the ibm_acpi module, for
642example:
643
644 modprobe ibm_acpi hotkey=enable,0xffff video=auto_disable
645
646
647Example Configuration
648---------------------
649
650The ACPI support in the kernel is intended to be used in conjunction
651with a user-space daemon, acpid. The configuration files for this
652daemon control what actions are taken in response to various ACPI
653events. An example set of configuration files are included in the
654config/ directory of the tarball package available on the web
655site. Note that these are provided for illustration purposes only and
656may need to be adapted to your particular setup.
657
658The following utility scripts are used by the example action
659scripts (included with ibm-acpi for completeness):
660
661 /usr/local/sbin/idectl -- from the hdparm source distribution,
662 see http://www.ibiblio.org/pub/Linux/system/hardware
663 /usr/local/sbin/laptop_mode -- from the Linux kernel source
664 distribution, see Documentation/laptop-mode.txt
665 /sbin/service -- comes with Redhat/Fedora distributions
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400666 /usr/sbin/hibernate -- from the Software Suspend 2 distribution,
667 see http://softwaresuspend.berlios.de/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700668
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400669Toan T Nguyen <ntt@physics.ucla.edu> notes that Suse uses the
670powersave program to suspend ('powersave --suspend-to-ram') or
671hibernate ('powersave --suspend-to-disk'). This means that the
672hibernate script is not needed on that distribution.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700673
674Henrik Brix Andersen <brix@gentoo.org> has written a Gentoo ACPI event
675handler script for the X31. You can get the latest version from
676http://dev.gentoo.org/~brix/files/x31.sh
677
678David Schweikert <dws@ee.eth.ch> has written an alternative blank.sh
Borislav Deianov78f81cc2005-08-17 00:00:00 -0400679script which works on Debian systems. This scripts has now been
680extended to also work on Fedora systems and included as the default
681blank.sh in the distribution.