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