thinkpad-acpi.txt 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015
  1. ThinkPad ACPI Extras Driver
  2. Version 0.14
  3. April 21st, 2007
  4. Borislav Deianov <borislav@users.sf.net>
  5. Henrique de Moraes Holschuh <hmh@hmh.eng.br>
  6. http://ibm-acpi.sf.net/
  7. This is a Linux driver for the IBM and Lenovo ThinkPad laptops. It
  8. supports various features of these laptops which are accessible
  9. through the ACPI and ACPI EC framework, but not otherwise fully
  10. supported by the generic Linux ACPI drivers.
  11. This driver used to be named ibm-acpi until kernel 2.6.21 and release
  12. 0.13-20070314. It used to be in the drivers/acpi tree, but it was
  13. moved to the drivers/misc tree and renamed to thinkpad-acpi for kernel
  14. 2.6.22, and release 0.14.
  15. Status
  16. ------
  17. The features currently supported are the following (see below for
  18. detailed description):
  19. - Fn key combinations
  20. - Bluetooth enable and disable
  21. - video output switching, expansion control
  22. - ThinkLight on and off
  23. - limited docking and undocking
  24. - UltraBay eject
  25. - CMOS control
  26. - LED control
  27. - ACPI sounds
  28. - temperature sensors
  29. - Experimental: embedded controller register dump
  30. - LCD brightness control
  31. - Volume control
  32. - Fan control and monitoring: fan speed, fan enable/disable
  33. - Experimental: WAN enable and disable
  34. A compatibility table by model and feature is maintained on the web
  35. site, http://ibm-acpi.sf.net/. I appreciate any success or failure
  36. reports, especially if they add to or correct the compatibility table.
  37. Please include the following information in your report:
  38. - ThinkPad model name
  39. - a copy of your DSDT, from /proc/acpi/dsdt
  40. - a copy of the output of dmidecode, with serial numbers
  41. and UUIDs masked off
  42. - which driver features work and which don't
  43. - the observed behavior of non-working features
  44. Any other comments or patches are also more than welcome.
  45. Installation
  46. ------------
  47. If you are compiling this driver as included in the Linux kernel
  48. sources, simply enable the CONFIG_THINKPAD_ACPI option, and optionally
  49. enable the CONFIG_THINKPAD_ACPI_BAY option if you want the
  50. thinkpad-specific bay functionality.
  51. Features
  52. --------
  53. The driver exports two different interfaces to userspace, which can be
  54. used to access the features it provides. One is a legacy procfs-based
  55. interface, which will be removed at some time in the distant future.
  56. The other is a new sysfs-based interface which is not complete yet.
  57. The procfs interface creates the /proc/acpi/ibm directory. There is a
  58. file under that directory for each feature it supports. The procfs
  59. interface is mostly frozen, and will change very little if at all: it
  60. will not be extended to add any new functionality in the driver, instead
  61. all new functionality will be implemented on the sysfs interface.
  62. The sysfs interface tries to blend in the generic Linux sysfs subsystems
  63. and classes as much as possible. Since some of these subsystems are not
  64. yet ready or stabilized, it is expected that this interface will change,
  65. and any and all userspace programs must deal with it.
  66. Notes about the sysfs interface:
  67. Unlike what was done with the procfs interface, correctness when talking
  68. to the sysfs interfaces will be enforced, as will correctness in the
  69. thinkpad-acpi's implementation of sysfs interfaces.
  70. Also, any bugs in the thinkpad-acpi sysfs driver code or in the
  71. thinkpad-acpi's implementation of the sysfs interfaces will be fixed for
  72. maximum correctness, even if that means changing an interface in
  73. non-compatible ways. As these interfaces mature both in the kernel and
  74. in thinkpad-acpi, such changes should become quite rare.
  75. Applications interfacing to the thinkpad-acpi sysfs interfaces must
  76. follow all sysfs guidelines and correctly process all errors (the sysfs
  77. interface makes extensive use of errors). File descriptors and open /
  78. close operations to the sysfs inodes must also be properly implemented.
  79. The version of thinkpad-acpi's sysfs interface is exported by the driver
  80. as a driver attribute (see below).
  81. Sysfs driver attributes are on the driver's sysfs attribute space,
  82. for 2.6.20 this is /sys/bus/platform/drivers/thinkpad-acpi/.
  83. Sysfs device attributes are on the driver's sysfs attribute space,
  84. for 2.6.20 this is /sys/devices/platform/thinkpad-acpi/.
  85. Driver version
  86. --------------
  87. procfs: /proc/acpi/ibm/driver
  88. sysfs driver attribute: version
  89. The driver name and version. No commands can be written to this file.
  90. Sysfs interface version
  91. -----------------------
  92. sysfs driver attribute: interface_version
  93. Version of the thinkpad-acpi sysfs interface, as an unsigned long
  94. (output in hex format: 0xAAAABBCC), where:
  95. AAAA - major revision
  96. BB - minor revision
  97. CC - bugfix revision
  98. The sysfs interface version changelog for the driver can be found at the
  99. end of this document. Changes to the sysfs interface done by the kernel
  100. subsystems are not documented here, nor are they tracked by this
  101. attribute.
  102. Changes to the thinkpad-acpi sysfs interface are only considered
  103. non-experimental when they are submitted to Linux mainline, at which
  104. point the changes in this interface are documented and interface_version
  105. may be updated. If you are using any thinkpad-acpi features not yet
  106. sent to mainline for merging, you do so on your own risk: these features
  107. may disappear, or be implemented in a different and incompatible way by
  108. the time they are merged in Linux mainline.
  109. Changes that are backwards-compatible by nature (e.g. the addition of
  110. attributes that do not change the way the other attributes work) do not
  111. always warrant an update of interface_version. Therefore, one must
  112. expect that an attribute might not be there, and deal with it properly
  113. (an attribute not being there *is* a valid way to make it clear that a
  114. feature is not available in sysfs).
  115. Hot keys
  116. --------
  117. procfs: /proc/acpi/ibm/hotkey
  118. sysfs device attribute: hotkey_*
  119. Without this driver, only the Fn-F4 key (sleep button) generates an
  120. ACPI event. With the driver loaded, the hotkey feature enabled and the
  121. mask set (see below), the various hot keys generate ACPI events in the
  122. following format:
  123. ibm/hotkey HKEY 00000080 0000xxxx
  124. The last four digits vary depending on the key combination pressed.
  125. All labeled Fn-Fx key combinations generate distinct events. In
  126. addition, the lid microswitch and some docking station buttons may
  127. also generate such events.
  128. The bit mask allows some control over which hot keys generate ACPI
  129. events. Not all bits in the mask can be modified. Not all bits that can
  130. be modified do anything. Not all hot keys can be individually controlled
  131. by the mask. Some models do not support the mask at all. On those
  132. models, hot keys cannot be controlled individually.
  133. Note that enabling ACPI events for some keys prevents their default
  134. behavior. For example, if events for Fn-F5 are enabled, that key will no
  135. longer enable/disable Bluetooth by itself. This can still be done from
  136. an acpid handler for the ibm/hotkey event.
  137. On some models, even enabling/disabling the entire hot key feature may
  138. change the way some keys behave (e.g. in a T43, Fn+F4 will generate an
  139. button/sleep ACPI event if hot keys are disabled, and it will ignore its
  140. mask when hot keys are enabled, so the key always does something. On a
  141. X40, Fn+F4 respects its mask status, but generates the button/sleep ACPI
  142. event if masked off).
  143. Note also that not all Fn key combinations are supported through
  144. ACPI. For example, on the X40, the brightness, volume and "Access IBM"
  145. buttons do not generate ACPI events even with this driver. They *can*
  146. be used through the "ThinkPad Buttons" utility, see
  147. http://www.nongnu.org/tpb/
  148. procfs notes:
  149. The following commands can be written to the /proc/acpi/ibm/hotkey file:
  150. echo enable > /proc/acpi/ibm/hotkey -- enable the hot keys feature
  151. echo disable > /proc/acpi/ibm/hotkey -- disable the hot keys feature
  152. echo 0xffffffff > /proc/acpi/ibm/hotkey -- enable all hot keys
  153. echo 0 > /proc/acpi/ibm/hotkey -- disable all possible hot keys
  154. ... any other 8-hex-digit mask ...
  155. echo reset > /proc/acpi/ibm/hotkey -- restore the original mask
  156. sysfs notes:
  157. hotkey_bios_enabled:
  158. Returns the status of the hot keys feature when
  159. thinkpad-acpi was loaded. Upon module unload, the hot
  160. key feature status will be restored to this value.
  161. 0: hot keys were disabled
  162. 1: hot keys were enabled
  163. hotkey_bios_mask:
  164. Returns the hot keys mask when thinkpad-acpi was loaded.
  165. Upon module unload, the hot keys mask will be restored
  166. to this value.
  167. hotkey_enable:
  168. Enables/disables the hot keys feature, and reports
  169. current status of the hot keys feature.
  170. 0: disables the hot keys feature / feature disabled
  171. 1: enables the hot keys feature / feature enabled
  172. hotkey_mask:
  173. bit mask to enable ACPI event generation for each hot
  174. key (see above). Returns the current status of the hot
  175. keys mask, and allows one to modify it.
  176. hotkey_all_mask:
  177. bit mask that should enable event reporting for all
  178. supported hot keys, when echoed to hotkey_mask above.
  179. Unless you know which events need to be handled
  180. passively (because the firmware *will* handle them
  181. anyway), do *not* use hotkey_all_mask. Use
  182. hotkey_recommended_mask, instead. You have been warned.
  183. hotkey_recommended_mask:
  184. bit mask that should enable event reporting for all
  185. supported hot keys, except those which are handled by
  186. the firmware. Echo it to hotkey_mask above, to use.
  187. hotkey_radio_sw:
  188. if the ThinkPad has a hardware radio switch, this
  189. attribute will read 0 if the switch is in the "radios
  190. disabled" postition, and 1 if the switch is in the
  191. "radios enabled" position.
  192. Bluetooth
  193. ---------
  194. procfs: /proc/acpi/ibm/bluetooth
  195. sysfs device attribute: bluetooth_enable
  196. This feature shows the presence and current state of a ThinkPad
  197. Bluetooth device in the internal ThinkPad CDC slot.
  198. Procfs notes:
  199. If Bluetooth is installed, the following commands can be used:
  200. echo enable > /proc/acpi/ibm/bluetooth
  201. echo disable > /proc/acpi/ibm/bluetooth
  202. Sysfs notes:
  203. If the Bluetooth CDC card is installed, it can be enabled /
  204. disabled through the "bluetooth_enable" thinkpad-acpi device
  205. attribute, and its current status can also be queried.
  206. enable:
  207. 0: disables Bluetooth / Bluetooth is disabled
  208. 1: enables Bluetooth / Bluetooth is enabled.
  209. Note: this interface will be probably be superseeded by the
  210. generic rfkill class, so it is NOT to be considered stable yet.
  211. Video output control -- /proc/acpi/ibm/video
  212. --------------------------------------------
  213. This feature allows control over the devices used for video output -
  214. LCD, CRT or DVI (if available). The following commands are available:
  215. echo lcd_enable > /proc/acpi/ibm/video
  216. echo lcd_disable > /proc/acpi/ibm/video
  217. echo crt_enable > /proc/acpi/ibm/video
  218. echo crt_disable > /proc/acpi/ibm/video
  219. echo dvi_enable > /proc/acpi/ibm/video
  220. echo dvi_disable > /proc/acpi/ibm/video
  221. echo auto_enable > /proc/acpi/ibm/video
  222. echo auto_disable > /proc/acpi/ibm/video
  223. echo expand_toggle > /proc/acpi/ibm/video
  224. echo video_switch > /proc/acpi/ibm/video
  225. Each video output device can be enabled or disabled individually.
  226. Reading /proc/acpi/ibm/video shows the status of each device.
  227. Automatic video switching can be enabled or disabled. When automatic
  228. video switching is enabled, certain events (e.g. opening the lid,
  229. docking or undocking) cause the video output device to change
  230. automatically. While this can be useful, it also causes flickering
  231. and, on the X40, video corruption. By disabling automatic switching,
  232. the flickering or video corruption can be avoided.
  233. The video_switch command cycles through the available video outputs
  234. (it simulates the behavior of Fn-F7).
  235. Video expansion can be toggled through this feature. This controls
  236. whether the display is expanded to fill the entire LCD screen when a
  237. mode with less than full resolution is used. Note that the current
  238. video expansion status cannot be determined through this feature.
  239. Note that on many models (particularly those using Radeon graphics
  240. chips) the X driver configures the video card in a way which prevents
  241. Fn-F7 from working. This also disables the video output switching
  242. features of this driver, as it uses the same ACPI methods as
  243. Fn-F7. Video switching on the console should still work.
  244. UPDATE: There's now a patch for the X.org Radeon driver which
  245. addresses this issue. Some people are reporting success with the patch
  246. while others are still having problems. For more information:
  247. https://bugs.freedesktop.org/show_bug.cgi?id=2000
  248. ThinkLight control -- /proc/acpi/ibm/light
  249. ------------------------------------------
  250. The current status of the ThinkLight can be found in this file. A few
  251. models which do not make the status available will show it as
  252. "unknown". The available commands are:
  253. echo on > /proc/acpi/ibm/light
  254. echo off > /proc/acpi/ibm/light
  255. Docking / undocking -- /proc/acpi/ibm/dock
  256. ------------------------------------------
  257. Docking and undocking (e.g. with the X4 UltraBase) requires some
  258. actions to be taken by the operating system to safely make or break
  259. the electrical connections with the dock.
  260. The docking feature of this driver generates the following ACPI events:
  261. ibm/dock GDCK 00000003 00000001 -- eject request
  262. ibm/dock GDCK 00000003 00000002 -- undocked
  263. ibm/dock GDCK 00000000 00000003 -- docked
  264. NOTE: These events will only be generated if the laptop was docked
  265. when originally booted. This is due to the current lack of support for
  266. hot plugging of devices in the Linux ACPI framework. If the laptop was
  267. booted while not in the dock, the following message is shown in the
  268. logs:
  269. Mar 17 01:42:34 aero kernel: thinkpad_acpi: dock device not present
  270. In this case, no dock-related events are generated but the dock and
  271. undock commands described below still work. They can be executed
  272. manually or triggered by Fn key combinations (see the example acpid
  273. configuration files included in the driver tarball package available
  274. on the web site).
  275. When the eject request button on the dock is pressed, the first event
  276. above is generated. The handler for this event should issue the
  277. following command:
  278. echo undock > /proc/acpi/ibm/dock
  279. After the LED on the dock goes off, it is safe to eject the laptop.
  280. Note: if you pressed this key by mistake, go ahead and eject the
  281. laptop, then dock it back in. Otherwise, the dock may not function as
  282. expected.
  283. When the laptop is docked, the third event above is generated. The
  284. handler for this event should issue the following command to fully
  285. enable the dock:
  286. echo dock > /proc/acpi/ibm/dock
  287. The contents of the /proc/acpi/ibm/dock file shows the current status
  288. of the dock, as provided by the ACPI framework.
  289. The docking support in this driver does not take care of enabling or
  290. disabling any other devices you may have attached to the dock. For
  291. example, a CD drive plugged into the UltraBase needs to be disabled or
  292. enabled separately. See the provided example acpid configuration files
  293. for how this can be accomplished.
  294. There is no support yet for PCI devices that may be attached to a
  295. docking station, e.g. in the ThinkPad Dock II. The driver currently
  296. does not recognize, enable or disable such devices. This means that
  297. the only docking stations currently supported are the X-series
  298. UltraBase docks and "dumb" port replicators like the Mini Dock (the
  299. latter don't need any ACPI support, actually).
  300. UltraBay eject -- /proc/acpi/ibm/bay
  301. ------------------------------------
  302. Inserting or ejecting an UltraBay device requires some actions to be
  303. taken by the operating system to safely make or break the electrical
  304. connections with the device.
  305. This feature generates the following ACPI events:
  306. ibm/bay MSTR 00000003 00000000 -- eject request
  307. ibm/bay MSTR 00000001 00000000 -- eject lever inserted
  308. NOTE: These events will only be generated if the UltraBay was present
  309. when the laptop was originally booted (on the X series, the UltraBay
  310. is in the dock, so it may not be present if the laptop was undocked).
  311. This is due to the current lack of support for hot plugging of devices
  312. in the Linux ACPI framework. If the laptop was booted without the
  313. UltraBay, the following message is shown in the logs:
  314. Mar 17 01:42:34 aero kernel: thinkpad_acpi: bay device not present
  315. In this case, no bay-related events are generated but the eject
  316. command described below still works. It can be executed manually or
  317. triggered by a hot key combination.
  318. Sliding the eject lever generates the first event shown above. The
  319. handler for this event should take whatever actions are necessary to
  320. shut down the device in the UltraBay (e.g. call idectl), then issue
  321. the following command:
  322. echo eject > /proc/acpi/ibm/bay
  323. After the LED on the UltraBay goes off, it is safe to pull out the
  324. device.
  325. When the eject lever is inserted, the second event above is
  326. generated. The handler for this event should take whatever actions are
  327. necessary to enable the UltraBay device (e.g. call idectl).
  328. The contents of the /proc/acpi/ibm/bay file shows the current status
  329. of the UltraBay, as provided by the ACPI framework.
  330. EXPERIMENTAL warm eject support on the 600e/x, A22p and A3x (To use
  331. this feature, you need to supply the experimental=1 parameter when
  332. loading the module):
  333. These models do not have a button near the UltraBay device to request
  334. a hot eject but rather require the laptop to be put to sleep
  335. (suspend-to-ram) before the bay device is ejected or inserted).
  336. The sequence of steps to eject the device is as follows:
  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. On the A3x, both the UltraBay 2000 and UltraBay Plus devices are
  343. supported. Use "eject2" instead of "eject" for the second bay.
  344. Note: the UltraBay eject support on the 600e/x, A22p and A3x is
  345. EXPERIMENTAL and may not work as expected. USE WITH CAUTION!
  346. CMOS control
  347. ------------
  348. procfs: /proc/acpi/ibm/cmos
  349. sysfs device attribute: cmos_command
  350. This feature is mostly used internally by the ACPI firmware to keep the legacy
  351. CMOS NVRAM bits in sync with the current machine state, and to record this
  352. state so that the ThinkPad will retain such settings across reboots.
  353. Some of these commands actually perform actions in some ThinkPad models, but
  354. this is expected to disappear more and more in newer models. As an example, in
  355. a T43 and in a X40, commands 12 and 13 still control the ThinkLight state for
  356. real, but commands 0 to 2 don't control the mixer anymore (they have been
  357. phased out) and just update the NVRAM.
  358. The range of valid cmos command numbers is 0 to 21, but not all have an
  359. effect and the behavior varies from model to model. Here is the behavior
  360. on the X40 (tpb is the ThinkPad Buttons utility):
  361. 0 - Related to "Volume down" key press
  362. 1 - Related to "Volume up" key press
  363. 2 - Related to "Mute on" key press
  364. 3 - Related to "Access IBM" key press
  365. 4 - Related to "LCD brightness up" key pess
  366. 5 - Related to "LCD brightness down" key press
  367. 11 - Related to "toggle screen expansion" key press/function
  368. 12 - Related to "ThinkLight on"
  369. 13 - Related to "ThinkLight off"
  370. 14 - Related to "ThinkLight" key press (toggle thinklight)
  371. The cmos command interface is prone to firmware split-brain problems, as
  372. in newer ThinkPads it is just a compatibility layer. Do not use it, it is
  373. exported just as a debug tool.
  374. LED control -- /proc/acpi/ibm/led
  375. ---------------------------------
  376. Some of the LED indicators can be controlled through this feature. The
  377. available commands are:
  378. echo '<led number> on' >/proc/acpi/ibm/led
  379. echo '<led number> off' >/proc/acpi/ibm/led
  380. echo '<led number> blink' >/proc/acpi/ibm/led
  381. The <led number> range is 0 to 7. The set of LEDs that can be
  382. controlled varies from model to model. Here is the mapping on the X40:
  383. 0 - power
  384. 1 - battery (orange)
  385. 2 - battery (green)
  386. 3 - UltraBase
  387. 4 - UltraBay
  388. 7 - standby
  389. All of the above can be turned on and off and can be made to blink.
  390. ACPI sounds -- /proc/acpi/ibm/beep
  391. ----------------------------------
  392. The BEEP method is used internally by the ACPI firmware to provide
  393. audible alerts in various situations. This feature allows the same
  394. sounds to be triggered manually.
  395. The commands are non-negative integer numbers:
  396. echo <number> >/proc/acpi/ibm/beep
  397. The valid <number> range is 0 to 17. Not all numbers trigger sounds
  398. and the sounds vary from model to model. Here is the behavior on the
  399. X40:
  400. 0 - stop a sound in progress (but use 17 to stop 16)
  401. 2 - two beeps, pause, third beep ("low battery")
  402. 3 - single beep
  403. 4 - high, followed by low-pitched beep ("unable")
  404. 5 - single beep
  405. 6 - very high, followed by high-pitched beep ("AC/DC")
  406. 7 - high-pitched beep
  407. 9 - three short beeps
  408. 10 - very long beep
  409. 12 - low-pitched beep
  410. 15 - three high-pitched beeps repeating constantly, stop with 0
  411. 16 - one medium-pitched beep repeating constantly, stop with 17
  412. 17 - stop 16
  413. Temperature sensors
  414. -------------------
  415. procfs: /proc/acpi/ibm/thermal
  416. sysfs device attributes: (hwmon) temp*_input
  417. Most ThinkPads include six or more separate temperature sensors but
  418. only expose the CPU temperature through the standard ACPI methods.
  419. This feature shows readings from up to eight different sensors on older
  420. ThinkPads, and it has experimental support for up to sixteen different
  421. sensors on newer ThinkPads.
  422. EXPERIMENTAL: The 16-sensors feature is marked EXPERIMENTAL because the
  423. implementation directly accesses hardware registers and may not work as
  424. expected. USE WITH CAUTION! To use this feature, you need to supply the
  425. experimental=1 parameter when loading the module. When EXPERIMENTAL
  426. mode is enabled, reading the first 8 sensors on newer ThinkPads will
  427. also use an new experimental thermal sensor access mode.
  428. For example, on the X40, a typical output may be:
  429. temperatures: 42 42 45 41 36 -128 33 -128
  430. EXPERIMENTAL: On the T43/p, a typical output may be:
  431. temperatures: 48 48 36 52 38 -128 31 -128 48 52 48 -128 -128 -128 -128 -128
  432. The mapping of thermal sensors to physical locations varies depending on
  433. system-board model (and thus, on ThinkPad model).
  434. http://thinkwiki.org/wiki/Thermal_Sensors is a public wiki page that
  435. tries to track down these locations for various models.
  436. Most (newer?) models seem to follow this pattern:
  437. 1: CPU
  438. 2: (depends on model)
  439. 3: (depends on model)
  440. 4: GPU
  441. 5: Main battery: main sensor
  442. 6: Bay battery: main sensor
  443. 7: Main battery: secondary sensor
  444. 8: Bay battery: secondary sensor
  445. 9-15: (depends on model)
  446. For the R51 (source: Thomas Gruber):
  447. 2: Mini-PCI
  448. 3: Internal HDD
  449. For the T43, T43/p (source: Shmidoax/Thinkwiki.org)
  450. http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_T43.2C_T43p
  451. 2: System board, left side (near PCMCIA slot), reported as HDAPS temp
  452. 3: PCMCIA slot
  453. 9: MCH (northbridge) to DRAM Bus
  454. 10: Clock-generator, mini-pci card and ICH (southbridge), under Mini-PCI
  455. card, under touchpad
  456. 11: Power regulator, underside of system board, below F2 key
  457. The A31 has a very atypical layout for the thermal sensors
  458. (source: Milos Popovic, http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_A31)
  459. 1: CPU
  460. 2: Main Battery: main sensor
  461. 3: Power Converter
  462. 4: Bay Battery: main sensor
  463. 5: MCH (northbridge)
  464. 6: PCMCIA/ambient
  465. 7: Main Battery: secondary sensor
  466. 8: Bay Battery: secondary sensor
  467. Procfs notes:
  468. Readings from sensors that are not available return -128.
  469. No commands can be written to this file.
  470. Sysfs notes:
  471. Sensors that are not available return the ENXIO error. This
  472. status may change at runtime, as there are hotplug thermal
  473. sensors, like those inside the batteries and docks.
  474. thinkpad-acpi thermal sensors are reported through the hwmon
  475. subsystem, and follow all of the hwmon guidelines at
  476. Documentation/hwmon.
  477. EXPERIMENTAL: Embedded controller register dump -- /proc/acpi/ibm/ecdump
  478. ------------------------------------------------------------------------
  479. This feature is marked EXPERIMENTAL because the implementation
  480. directly accesses hardware registers and may not work as expected. USE
  481. WITH CAUTION! To use this feature, you need to supply the
  482. experimental=1 parameter when loading the module.
  483. This feature dumps the values of 256 embedded controller
  484. registers. Values which have changed since the last time the registers
  485. were dumped are marked with a star:
  486. [root@x40 ibm-acpi]# cat /proc/acpi/ibm/ecdump
  487. EC +00 +01 +02 +03 +04 +05 +06 +07 +08 +09 +0a +0b +0c +0d +0e +0f
  488. EC 0x00: a7 47 87 01 fe 96 00 08 01 00 cb 00 00 00 40 00
  489. EC 0x10: 00 00 ff ff f4 3c 87 09 01 ff 42 01 ff ff 0d 00
  490. EC 0x20: 00 00 00 00 00 00 00 00 00 00 00 03 43 00 00 80
  491. EC 0x30: 01 07 1a 00 30 04 00 00 *85 00 00 10 00 50 00 00
  492. EC 0x40: 00 00 00 00 00 00 14 01 00 04 00 00 00 00 00 00
  493. EC 0x50: 00 c0 02 0d 00 01 01 02 02 03 03 03 03 *bc *02 *bc
  494. EC 0x60: *02 *bc *02 00 00 00 00 00 00 00 00 00 00 00 00 00
  495. EC 0x70: 00 00 00 00 00 12 30 40 *24 *26 *2c *27 *20 80 *1f 80
  496. EC 0x80: 00 00 00 06 *37 *0e 03 00 00 00 0e 07 00 00 00 00
  497. EC 0x90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  498. EC 0xa0: *ff 09 ff 09 ff ff *64 00 *00 *00 *a2 41 *ff *ff *e0 00
  499. EC 0xb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  500. EC 0xc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  501. EC 0xd0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  502. EC 0xe0: 00 00 00 00 00 00 00 00 11 20 49 04 24 06 55 03
  503. EC 0xf0: 31 55 48 54 35 38 57 57 08 2f 45 73 07 65 6c 1a
  504. This feature can be used to determine the register holding the fan
  505. speed on some models. To do that, do the following:
  506. - make sure the battery is fully charged
  507. - make sure the fan is running
  508. - run 'cat /proc/acpi/ibm/ecdump' several times, once per second or so
  509. The first step makes sure various charging-related values don't
  510. vary. The second ensures that the fan-related values do vary, since
  511. the fan speed fluctuates a bit. The third will (hopefully) mark the
  512. fan register with a star:
  513. [root@x40 ibm-acpi]# cat /proc/acpi/ibm/ecdump
  514. EC +00 +01 +02 +03 +04 +05 +06 +07 +08 +09 +0a +0b +0c +0d +0e +0f
  515. EC 0x00: a7 47 87 01 fe 96 00 08 01 00 cb 00 00 00 40 00
  516. EC 0x10: 00 00 ff ff f4 3c 87 09 01 ff 42 01 ff ff 0d 00
  517. EC 0x20: 00 00 00 00 00 00 00 00 00 00 00 03 43 00 00 80
  518. EC 0x30: 01 07 1a 00 30 04 00 00 85 00 00 10 00 50 00 00
  519. EC 0x40: 00 00 00 00 00 00 14 01 00 04 00 00 00 00 00 00
  520. EC 0x50: 00 c0 02 0d 00 01 01 02 02 03 03 03 03 bc 02 bc
  521. EC 0x60: 02 bc 02 00 00 00 00 00 00 00 00 00 00 00 00 00
  522. EC 0x70: 00 00 00 00 00 12 30 40 24 27 2c 27 21 80 1f 80
  523. EC 0x80: 00 00 00 06 *be 0d 03 00 00 00 0e 07 00 00 00 00
  524. EC 0x90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  525. EC 0xa0: ff 09 ff 09 ff ff 64 00 00 00 a2 41 ff ff e0 00
  526. EC 0xb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  527. EC 0xc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  528. EC 0xd0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  529. EC 0xe0: 00 00 00 00 00 00 00 00 11 20 49 04 24 06 55 03
  530. EC 0xf0: 31 55 48 54 35 38 57 57 08 2f 45 73 07 65 6c 1a
  531. Another set of values that varies often is the temperature
  532. readings. Since temperatures don't change vary fast, you can take
  533. several quick dumps to eliminate them.
  534. You can use a similar method to figure out the meaning of other
  535. embedded controller registers - e.g. make sure nothing else changes
  536. except the charging or discharging battery to determine which
  537. registers contain the current battery capacity, etc. If you experiment
  538. with this, do send me your results (including some complete dumps with
  539. a description of the conditions when they were taken.)
  540. LCD brightness control
  541. ----------------------
  542. procfs: /proc/acpi/ibm/brightness
  543. sysfs backlight device "thinkpad_screen"
  544. This feature allows software control of the LCD brightness on ThinkPad
  545. models which don't have a hardware brightness slider.
  546. It has some limitations: the LCD backlight cannot be actually turned on or off
  547. by this interface, and in many ThinkPad models, the "dim while on battery"
  548. functionality will be enabled by the BIOS when this interface is used, and
  549. cannot be controlled.
  550. The backlight control has eight levels, ranging from 0 to 7. Some of the
  551. levels may not be distinct.
  552. Procfs notes:
  553. The available commands are:
  554. echo up >/proc/acpi/ibm/brightness
  555. echo down >/proc/acpi/ibm/brightness
  556. echo 'level <level>' >/proc/acpi/ibm/brightness
  557. Sysfs notes:
  558. The interface is implemented through the backlight sysfs class, which is poorly
  559. documented at this time.
  560. Locate the thinkpad_screen device under /sys/class/backlight, and inside it
  561. there will be the following attributes:
  562. max_brightness:
  563. Reads the maximum brightness the hardware can be set to.
  564. The minimum is always zero.
  565. actual_brightness:
  566. Reads what brightness the screen is set to at this instant.
  567. brightness:
  568. Writes request the driver to change brightness to the given
  569. value. Reads will tell you what brightness the driver is trying
  570. to set the display to when "power" is set to zero and the display
  571. has not been dimmed by a kernel power management event.
  572. power:
  573. power management mode, where 0 is "display on", and 1 to 3 will
  574. dim the display backlight to brightness level 0 because
  575. thinkpad-acpi cannot really turn the backlight off. Kernel
  576. power management events can temporarily increase the current
  577. power management level, i.e. they can dim the display.
  578. Volume control -- /proc/acpi/ibm/volume
  579. ---------------------------------------
  580. This feature allows volume control on ThinkPad models which don't have
  581. a hardware volume knob. The available commands are:
  582. echo up >/proc/acpi/ibm/volume
  583. echo down >/proc/acpi/ibm/volume
  584. echo mute >/proc/acpi/ibm/volume
  585. echo 'level <level>' >/proc/acpi/ibm/volume
  586. The <level> number range is 0 to 15 although not all of them may be
  587. distinct. The unmute the volume after the mute command, use either the
  588. up or down command (the level command will not unmute the volume).
  589. The current volume level and mute state is shown in the file.
  590. Fan control and monitoring: fan speed, fan enable/disable
  591. ---------------------------------------------------------
  592. procfs: /proc/acpi/ibm/fan
  593. sysfs device attributes: (hwmon) fan_input, pwm1, pwm1_enable
  594. NOTE NOTE NOTE: fan control operations are disabled by default for
  595. safety reasons. To enable them, the module parameter "fan_control=1"
  596. must be given to thinkpad-acpi.
  597. This feature attempts to show the current fan speed, control mode and
  598. other fan data that might be available. The speed is read directly
  599. from the hardware registers of the embedded controller. This is known
  600. to work on later R, T, X and Z series ThinkPads but may show a bogus
  601. value on other models.
  602. Fan levels:
  603. Most ThinkPad fans work in "levels" at the firmware interface. Level 0
  604. stops the fan. The higher the level, the higher the fan speed, although
  605. adjacent levels often map to the same fan speed. 7 is the highest
  606. level, where the fan reaches the maximum recommended speed.
  607. Level "auto" means the EC changes the fan level according to some
  608. internal algorithm, usually based on readings from the thermal sensors.
  609. There is also a "full-speed" level, also known as "disengaged" level.
  610. In this level, the EC disables the speed-locked closed-loop fan control,
  611. and drives the fan as fast as it can go, which might exceed hardware
  612. limits, so use this level with caution.
  613. The fan usually ramps up or down slowly from one speed to another, and
  614. it is normal for the EC to take several seconds to react to fan
  615. commands. The full-speed level may take up to two minutes to ramp up to
  616. maximum speed, and in some ThinkPads, the tachometer readings go stale
  617. while the EC is transitioning to the full-speed level.
  618. WARNING WARNING WARNING: do not leave the fan disabled unless you are
  619. monitoring all of the temperature sensor readings and you are ready to
  620. enable it if necessary to avoid overheating.
  621. An enabled fan in level "auto" may stop spinning if the EC decides the
  622. ThinkPad is cool enough and doesn't need the extra airflow. This is
  623. normal, and the EC will spin the fan up if the varios thermal readings
  624. rise too much.
  625. On the X40, this seems to depend on the CPU and HDD temperatures.
  626. Specifically, the fan is turned on when either the CPU temperature
  627. climbs to 56 degrees or the HDD temperature climbs to 46 degrees. The
  628. fan is turned off when the CPU temperature drops to 49 degrees and the
  629. HDD temperature drops to 41 degrees. These thresholds cannot
  630. currently be controlled.
  631. The ThinkPad's ACPI DSDT code will reprogram the fan on its own when
  632. certain conditions are met. It will override any fan programming done
  633. through thinkpad-acpi.
  634. The thinkpad-acpi kernel driver can be programmed to revert the fan
  635. level to a safe setting if userspace does not issue one of the procfs
  636. fan commands: "enable", "disable", "level" or "watchdog", or if there
  637. are no writes to pwm1_enable (or to pwm1 *if and only if* pwm1_enable is
  638. set to 1, manual mode) within a configurable amount of time of up to
  639. 120 seconds. This functionality is called fan safety watchdog.
  640. Note that the watchdog timer stops after it enables the fan. It will be
  641. rearmed again automatically (using the same interval) when one of the
  642. above mentioned fan commands is received. The fan watchdog is,
  643. therefore, not suitable to protect against fan mode changes made through
  644. means other than the "enable", "disable", and "level" procfs fan
  645. commands, or the hwmon fan control sysfs interface.
  646. Procfs notes:
  647. The fan may be enabled or disabled with the following commands:
  648. echo enable >/proc/acpi/ibm/fan
  649. echo disable >/proc/acpi/ibm/fan
  650. Placing a fan on level 0 is the same as disabling it. Enabling a fan
  651. will try to place it in a safe level if it is too slow or disabled.
  652. The fan level can be controlled with the command:
  653. echo 'level <level>' > /proc/acpi/ibm/fan
  654. Where <level> is an integer from 0 to 7, or one of the words "auto" or
  655. "full-speed" (without the quotes). Not all ThinkPads support the "auto"
  656. and "full-speed" levels. The driver accepts "disengaged" as an alias for
  657. "full-speed", and reports it as "disengaged" for backwards
  658. compatibility.
  659. On the X31 and X40 (and ONLY on those models), the fan speed can be
  660. controlled to a certain degree. Once the fan is running, it can be
  661. forced to run faster or slower with the following command:
  662. echo 'speed <speed>' > /proc/acpi/ibm/fan
  663. The sustainable range of fan speeds on the X40 appears to be from about
  664. 3700 to about 7350. Values outside this range either do not have any
  665. effect or the fan speed eventually settles somewhere in that range. The
  666. fan cannot be stopped or started with this command. This functionality
  667. is incomplete, and not available through the sysfs interface.
  668. To program the safety watchdog, use the "watchdog" command.
  669. echo 'watchdog <interval in seconds>' > /proc/acpi/ibm/fan
  670. If you want to disable the watchdog, use 0 as the interval.
  671. Sysfs notes:
  672. The sysfs interface follows the hwmon subsystem guidelines for the most
  673. part, and the exception is the fan safety watchdog.
  674. Writes to any of the sysfs attributes may return the EINVAL error if
  675. that operation is not supported in a given ThinkPad or if the parameter
  676. is out-of-bounds, and EPERM if it is forbidden. They may also return
  677. EINTR (interrupted system call), and EIO (I/O error while trying to talk
  678. to the firmware).
  679. Features not yet implemented by the driver return ENOSYS.
  680. hwmon device attribute pwm1_enable:
  681. 0: PWM offline (fan is set to full-speed mode)
  682. 1: Manual PWM control (use pwm1 to set fan level)
  683. 2: Hardware PWM control (EC "auto" mode)
  684. 3: reserved (Software PWM control, not implemented yet)
  685. Modes 0 and 2 are not supported by all ThinkPads, and the
  686. driver is not always able to detect this. If it does know a
  687. mode is unsupported, it will return -EINVAL.
  688. hwmon device attribute pwm1:
  689. Fan level, scaled from the firmware values of 0-7 to the hwmon
  690. scale of 0-255. 0 means fan stopped, 255 means highest normal
  691. speed (level 7).
  692. This attribute only commands the fan if pmw1_enable is set to 1
  693. (manual PWM control).
  694. hwmon device attribute fan1_input:
  695. Fan tachometer reading, in RPM. May go stale on certain
  696. ThinkPads while the EC transitions the PWM to offline mode,
  697. which can take up to two minutes. May return rubbish on older
  698. ThinkPads.
  699. driver attribute fan_watchdog:
  700. Fan safety watchdog timer interval, in seconds. Minimum is
  701. 1 second, maximum is 120 seconds. 0 disables the watchdog.
  702. To stop the fan: set pwm1 to zero, and pwm1_enable to 1.
  703. To start the fan in a safe mode: set pwm1_enable to 2. If that fails
  704. with EINVAL, try to set pwm1_enable to 1 and pwm1 to at least 128 (255
  705. would be the safest choice, though).
  706. EXPERIMENTAL: WAN
  707. -----------------
  708. procfs: /proc/acpi/ibm/wan
  709. sysfs device attribute: wwan_enable
  710. This feature is marked EXPERIMENTAL because the implementation
  711. directly accesses hardware registers and may not work as expected. USE
  712. WITH CAUTION! To use this feature, you need to supply the
  713. experimental=1 parameter when loading the module.
  714. This feature shows the presence and current state of a W-WAN (Sierra
  715. Wireless EV-DO) device.
  716. It was tested on a Lenovo Thinkpad X60. It should probably work on other
  717. Thinkpad models which come with this module installed.
  718. Procfs notes:
  719. If the W-WAN card is installed, the following commands can be used:
  720. echo enable > /proc/acpi/ibm/wan
  721. echo disable > /proc/acpi/ibm/wan
  722. Sysfs notes:
  723. If the W-WAN card is installed, it can be enabled /
  724. disabled through the "wwan_enable" thinkpad-acpi device
  725. attribute, and its current status can also be queried.
  726. enable:
  727. 0: disables WWAN card / WWAN card is disabled
  728. 1: enables WWAN card / WWAN card is enabled.
  729. Note: this interface will be probably be superseeded by the
  730. generic rfkill class, so it is NOT to be considered stable yet.
  731. Multiple Commands, Module Parameters
  732. ------------------------------------
  733. Multiple commands can be written to the proc files in one shot by
  734. separating them with commas, for example:
  735. echo enable,0xffff > /proc/acpi/ibm/hotkey
  736. echo lcd_disable,crt_enable > /proc/acpi/ibm/video
  737. Commands can also be specified when loading the thinkpad-acpi module,
  738. for example:
  739. modprobe thinkpad_acpi hotkey=enable,0xffff video=auto_disable
  740. Enabling debugging output
  741. -------------------------
  742. The module takes a debug paramater which can be used to selectively
  743. enable various classes of debugging output, for example:
  744. modprobe ibm_acpi debug=0xffff
  745. will enable all debugging output classes. It takes a bitmask, so
  746. to enable more than one output class, just add their values.
  747. Debug bitmask Description
  748. 0x0001 Initialization and probing
  749. 0x0002 Removal
  750. There is also a kernel build option to enable more debugging
  751. information, which may be necessary to debug driver problems.
  752. The level of debugging information output by the driver can be changed
  753. at runtime through sysfs, using the driver attribute debug_level. The
  754. attribute takes the same bitmask as the debug module parameter above.
  755. Force loading of module
  756. -----------------------
  757. If thinkpad-acpi refuses to detect your ThinkPad, you can try to specify
  758. the module parameter force_load=1. Regardless of whether this works or
  759. not, please contact ibm-acpi-devel@lists.sourceforge.net with a report.
  760. Sysfs interface changelog:
  761. 0x000100: Initial sysfs support, as a single platform driver and
  762. device.
  763. 0x000200: Hot key support for 32 hot keys, and radio slider switch
  764. support.