thinkpad-acpi.txt 37 KB

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