thinkpad-acpi.txt 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248
  1. ThinkPad ACPI Extras Driver
  2. Version 0.16
  3. August 2nd, 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.23 this is /sys/bus/platform/drivers/thinkpad_acpi/ and
  83. /sys/bus/platform/drivers/thinkpad_hwmon/
  84. Sysfs device attributes are on the thinkpad_acpi device sysfs attribute
  85. space, for 2.6.23 this is /sys/devices/platform/thinkpad_acpi/.
  86. Sysfs device attributes for the sensors and fan are on the
  87. thinkpad_hwmon device's sysfs attribute space, but you should locate it
  88. looking for a hwmon device with the name attribute of "thinkpad".
  89. Driver version
  90. --------------
  91. procfs: /proc/acpi/ibm/driver
  92. sysfs driver attribute: version
  93. The driver name and version. No commands can be written to this file.
  94. Sysfs interface version
  95. -----------------------
  96. sysfs driver attribute: interface_version
  97. Version of the thinkpad-acpi sysfs interface, as an unsigned long
  98. (output in hex format: 0xAAAABBCC), where:
  99. AAAA - major revision
  100. BB - minor revision
  101. CC - bugfix revision
  102. The sysfs interface version changelog for the driver can be found at the
  103. end of this document. Changes to the sysfs interface done by the kernel
  104. subsystems are not documented here, nor are they tracked by this
  105. attribute.
  106. Changes to the thinkpad-acpi sysfs interface are only considered
  107. non-experimental when they are submitted to Linux mainline, at which
  108. point the changes in this interface are documented and interface_version
  109. may be updated. If you are using any thinkpad-acpi features not yet
  110. sent to mainline for merging, you do so on your own risk: these features
  111. may disappear, or be implemented in a different and incompatible way by
  112. the time they are merged in Linux mainline.
  113. Changes that are backwards-compatible by nature (e.g. the addition of
  114. attributes that do not change the way the other attributes work) do not
  115. always warrant an update of interface_version. Therefore, one must
  116. expect that an attribute might not be there, and deal with it properly
  117. (an attribute not being there *is* a valid way to make it clear that a
  118. feature is not available in sysfs).
  119. Hot keys
  120. --------
  121. procfs: /proc/acpi/ibm/hotkey
  122. sysfs device attribute: hotkey_*
  123. In a ThinkPad, the ACPI HKEY handler is responsible for comunicating
  124. some important events and also keyboard hot key presses to the operating
  125. system. Enabling the hotkey functionality of thinkpad-acpi signals the
  126. firmware that such a driver is present, and modifies how the ThinkPad
  127. firmware will behave in many situations.
  128. The driver enables the hot key feature automatically when loaded. The
  129. feature can later be disabled and enabled back at runtime. The driver
  130. will also restore the hot key feature to its previous state and mask
  131. when it is unloaded.
  132. When the hotkey feature is enabled and the hot key mask is set (see
  133. below), the driver will report HKEY events in the following format:
  134. ibm/hotkey HKEY 00000080 0000xxxx
  135. Some of these events refer to hot key presses, but not all.
  136. The driver will generate events over the input layer for hot keys and
  137. radio switches, and over the ACPI netlink layer for other events. The
  138. input layer support accepts the standard IOCTLs to remap the keycodes
  139. assigned to each hot key.
  140. The hot key bit mask allows some control over which hot keys generate
  141. events. If a key is "masked" (bit set to 0 in the mask), the firmware
  142. will handle it. If it is "unmasked", it signals the firmware that
  143. thinkpad-acpi would prefer to handle it, if the firmware would be so
  144. kind to allow it (and it often doesn't!).
  145. Not all bits in the mask can be modified. Not all bits that can be
  146. modified do anything. Not all hot keys can be individually controlled
  147. by the mask. Some models do not support the mask at all, and in those
  148. models, hot keys cannot be controlled individually. The behaviour of
  149. the mask is, therefore, higly dependent on the ThinkPad model.
  150. Note that unmasking some keys prevents their default behavior. For
  151. example, if Fn+F5 is unmasked, that key will no longer enable/disable
  152. Bluetooth by itself.
  153. Note also that not all Fn key combinations are supported through ACPI.
  154. For example, on the X40, the brightness, volume and "Access IBM" buttons
  155. do not generate ACPI events even with this driver. They *can* be used
  156. through the "ThinkPad Buttons" utility, see http://www.nongnu.org/tpb/
  157. procfs notes:
  158. The following commands can be written to the /proc/acpi/ibm/hotkey file:
  159. echo enable > /proc/acpi/ibm/hotkey -- enable the hot keys feature
  160. echo disable > /proc/acpi/ibm/hotkey -- disable the hot keys feature
  161. echo 0xffffffff > /proc/acpi/ibm/hotkey -- enable all hot keys
  162. echo 0 > /proc/acpi/ibm/hotkey -- disable all possible hot keys
  163. ... any other 8-hex-digit mask ...
  164. echo reset > /proc/acpi/ibm/hotkey -- restore the original mask
  165. sysfs notes:
  166. hotkey_bios_enabled:
  167. Returns the status of the hot keys feature when
  168. thinkpad-acpi was loaded. Upon module unload, the hot
  169. key feature status will be restored to this value.
  170. 0: hot keys were disabled
  171. 1: hot keys were enabled (unusual)
  172. hotkey_bios_mask:
  173. Returns the hot keys mask when thinkpad-acpi was loaded.
  174. Upon module unload, the hot keys mask will be restored
  175. to this value.
  176. hotkey_enable:
  177. Enables/disables the hot keys feature, and reports
  178. current status of the hot keys feature.
  179. 0: disables the hot keys feature / feature disabled
  180. 1: enables the hot keys feature / feature enabled
  181. hotkey_mask:
  182. bit mask to enable driver-handling and ACPI event
  183. generation for each hot key (see above). Returns the
  184. current status of the hot keys mask, and allows one to
  185. modify it.
  186. hotkey_all_mask:
  187. bit mask that should enable event reporting for all
  188. supported hot keys, when echoed to hotkey_mask above.
  189. Unless you know which events need to be handled
  190. passively (because the firmware *will* handle them
  191. anyway), do *not* use hotkey_all_mask. Use
  192. hotkey_recommended_mask, instead. You have been warned.
  193. hotkey_recommended_mask:
  194. bit mask that should enable event reporting for all
  195. supported hot keys, except those which are always
  196. handled by the firmware anyway. Echo it to
  197. hotkey_mask above, to use.
  198. hotkey_radio_sw:
  199. if the ThinkPad has a hardware radio switch, this
  200. attribute will read 0 if the switch is in the "radios
  201. disabled" postition, and 1 if the switch is in the
  202. "radios enabled" position.
  203. hotkey_report_mode:
  204. Returns the state of the procfs ACPI event report mode
  205. filter for hot keys. If it is set to 1 (the default),
  206. all hot key presses are reported both through the input
  207. layer and also as ACPI events through procfs (but not
  208. through netlink). If it is set to 2, hot key presses
  209. are reported only through the input layer.
  210. This attribute is read-only in kernels 2.6.23 or later,
  211. and read-write on earlier kernels.
  212. May return -EPERM (write access locked out by module
  213. parameter) or -EACCES (read-only).
  214. input layer notes:
  215. A Hot key is mapped to a single input layer EV_KEY event, possibly
  216. followed by an EV_MSC MSC_SCAN event that shall contain that key's scan
  217. code. An EV_SYN event will always be generated to mark the end of the
  218. event block.
  219. Do not use the EV_MSC MSC_SCAN events to process keys. They are to be
  220. used as a helper to remap keys, only. They are particularly useful when
  221. remapping KEY_UNKNOWN keys.
  222. The events are available in an input device, with the following id:
  223. Bus: BUS_HOST
  224. vendor: 0x1014 (PCI_VENDOR_ID_IBM) or
  225. 0x17aa (PCI_VENDOR_ID_LENOVO)
  226. product: 0x5054 ("TP")
  227. version: 0x4101
  228. The version will have its LSB incremented if the keymap changes in a
  229. backwards-compatible way. The MSB shall always be 0x41 for this input
  230. device. If the MSB is not 0x41, do not use the device as described in
  231. this section, as it is either something else (e.g. another input device
  232. exported by a thinkpad driver, such as HDAPS) or its functionality has
  233. been changed in a non-backwards compatible way.
  234. Adding other event types for other functionalities shall be considered a
  235. backwards-compatible change for this input device.
  236. Thinkpad-acpi Hot Key event map (version 0x4101):
  237. ACPI Scan
  238. event code Key Notes
  239. 0x1001 0x00 FN+F1 -
  240. 0x1002 0x01 FN+F2 IBM: battery (rare)
  241. Lenovo: Screen lock
  242. 0x1003 0x02 FN+F3 Many IBM models always report
  243. this hot key, even with hot keys
  244. disabled or with Fn+F3 masked
  245. off
  246. IBM: screen lock
  247. Lenovo: battery
  248. 0x1004 0x03 FN+F4 Sleep button (ACPI sleep button
  249. semanthics, i.e. sleep-to-RAM).
  250. It is always generate some kind
  251. of event, either the hot key
  252. event or a ACPI sleep button
  253. event. The firmware may
  254. refuse to generate further FN+F4
  255. key presses until a S3 or S4 ACPI
  256. sleep cycle is performed or some
  257. time passes.
  258. 0x1005 0x04 FN+F5 Radio. Enables/disables
  259. the internal BlueTooth hardware
  260. and W-WAN card if left in control
  261. of the firmware. Does not affect
  262. the WLAN card.
  263. Should be used to turn on/off all
  264. radios (bluetooth+W-WAN+WLAN),
  265. really.
  266. 0x1006 0x05 FN+F6 -
  267. 0x1007 0x06 FN+F7 Video output cycle.
  268. Do you feel lucky today?
  269. 0x1008 0x07 FN+F8 IBM: toggle screen expand
  270. Lenovo: configure ultranav
  271. 0x1009 0x08 FN+F9 -
  272. .. .. ..
  273. 0x100B 0x0A FN+F11 -
  274. 0x100C 0x0B FN+F12 Sleep to disk. You are always
  275. supposed to handle it yourself,
  276. either through the ACPI event,
  277. or through a hotkey event.
  278. The firmware may refuse to
  279. generate further FN+F4 key
  280. press events until a S3 or S4
  281. ACPI sleep cycle is performed,
  282. or some time passes.
  283. 0x100D 0x0C FN+BACKSPACE -
  284. 0x100E 0x0D FN+INSERT -
  285. 0x100F 0x0E FN+DELETE -
  286. 0x1010 0x0F FN+HOME Brightness up. This key is
  287. always handled by the firmware
  288. in IBM ThinkPads, even when
  289. unmasked. Just leave it alone.
  290. For Lenovo ThinkPads with a new
  291. BIOS, it has to be handled either
  292. by the ACPI OSI, or by userspace.
  293. 0x1011 0x10 FN+END Brightness down. See brightness
  294. up for details.
  295. 0x1012 0x11 FN+PGUP Thinklight toggle. This key is
  296. always handled by the firmware,
  297. even when unmasked.
  298. 0x1013 0x12 FN+PGDOWN -
  299. 0x1014 0x13 FN+SPACE Zoom key
  300. 0x1015 0x14 VOLUME UP Internal mixer volume up. This
  301. key is always handled by the
  302. firmware, even when unmasked.
  303. NOTE: Lenovo seems to be changing
  304. this.
  305. 0x1016 0x15 VOLUME DOWN Internal mixer volume up. This
  306. key is always handled by the
  307. firmware, even when unmasked.
  308. NOTE: Lenovo seems to be changing
  309. this.
  310. 0x1017 0x16 MUTE Mute internal mixer. This
  311. key is always handled by the
  312. firmware, even when unmasked.
  313. 0x1018 0x17 THINKPAD Thinkpad/Access IBM/Lenovo key
  314. 0x1019 0x18 unknown
  315. .. .. ..
  316. 0x1020 0x1F unknown
  317. The ThinkPad firmware does not allow one to differentiate when most hot
  318. keys are pressed or released (either that, or we don't know how to, yet).
  319. For these keys, the driver generates a set of events for a key press and
  320. immediately issues the same set of events for a key release. It is
  321. unknown by the driver if the ThinkPad firmware triggered these events on
  322. hot key press or release, but the firmware will do it for either one, not
  323. both.
  324. If a key is mapped to KEY_RESERVED, it generates no input events at all.
  325. If a key is mapped to KEY_UNKNOWN, it generates an input event that
  326. includes an scan code. If a key is mapped to anything else, it will
  327. generate input device EV_KEY events.
  328. Non hot-key ACPI HKEY event map:
  329. 0x5001 Lid closed
  330. 0x5002 Lid opened
  331. 0x7000 Radio Switch may have changed state
  332. The above events are not propagated by the driver, except for legacy
  333. compatibility purposes when hotkey_report_mode is set to 1.
  334. Compatibility notes:
  335. ibm-acpi and thinkpad-acpi 0.15 (mainline kernels before 2.6.23) never
  336. supported the input layer, and sent events over the procfs ACPI event
  337. interface.
  338. To avoid sending duplicate events over the input layer and the ACPI
  339. event interface, thinkpad-acpi 0.16 implements a module parameter
  340. (hotkey_report_mode), and also a sysfs device attribute with the same
  341. name.
  342. Make no mistake here: userspace is expected to switch to using the input
  343. layer interface of thinkpad-acpi, together with the ACPI netlink event
  344. interface in kernels 2.6.23 and later, or with the ACPI procfs event
  345. interface in kernels 2.6.22 and earlier.
  346. If no hotkey_report_mode module parameter is specified (or it is set to
  347. zero), the driver defaults to mode 1 (see below), and on kernels 2.6.22
  348. and earlier, also allows one to change the hotkey_report_mode through
  349. sysfs. In kernels 2.6.23 and later, where the netlink ACPI event
  350. interface is available, hotkey_report_mode cannot be changed through
  351. sysfs (it is read-only).
  352. If the hotkey_report_mode module parameter is set to 1 or 2, it cannot
  353. be changed later through sysfs (any writes will return -EPERM to signal
  354. that hotkey_report_mode was locked. On 2.6.23 and later, where
  355. hotkey_report_mode cannot be changed at all, writes will return -EACES).
  356. hotkey_report_mode set to 1 makes the driver export through the procfs
  357. ACPI event interface all hot key presses (which are *also* sent to the
  358. input layer). This is a legacy compatibility behaviour, and it is also
  359. the default mode of operation for the driver.
  360. hotkey_report_mode set to 2 makes the driver filter out the hot key
  361. presses from the procfs ACPI event interface, so these events will only
  362. be sent through the input layer. Userspace that has been updated to use
  363. the thinkpad-acpi input layer interface should set hotkey_report_mode to
  364. 2.
  365. Hot key press events are never sent to the ACPI netlink event interface.
  366. Really up-to-date userspace under kernel 2.6.23 and later is to use the
  367. netlink interface and the input layer interface, and don't bother at all
  368. with hotkey_report_mode.
  369. Bluetooth
  370. ---------
  371. procfs: /proc/acpi/ibm/bluetooth
  372. sysfs device attribute: bluetooth_enable
  373. This feature shows the presence and current state of a ThinkPad
  374. Bluetooth device in the internal ThinkPad CDC slot.
  375. Procfs notes:
  376. If Bluetooth is installed, the following commands can be used:
  377. echo enable > /proc/acpi/ibm/bluetooth
  378. echo disable > /proc/acpi/ibm/bluetooth
  379. Sysfs notes:
  380. If the Bluetooth CDC card is installed, it can be enabled /
  381. disabled through the "bluetooth_enable" thinkpad-acpi device
  382. attribute, and its current status can also be queried.
  383. enable:
  384. 0: disables Bluetooth / Bluetooth is disabled
  385. 1: enables Bluetooth / Bluetooth is enabled.
  386. Note: this interface will be probably be superseeded by the
  387. generic rfkill class, so it is NOT to be considered stable yet.
  388. Video output control -- /proc/acpi/ibm/video
  389. --------------------------------------------
  390. This feature allows control over the devices used for video output -
  391. LCD, CRT or DVI (if available). The following commands are available:
  392. echo lcd_enable > /proc/acpi/ibm/video
  393. echo lcd_disable > /proc/acpi/ibm/video
  394. echo crt_enable > /proc/acpi/ibm/video
  395. echo crt_disable > /proc/acpi/ibm/video
  396. echo dvi_enable > /proc/acpi/ibm/video
  397. echo dvi_disable > /proc/acpi/ibm/video
  398. echo auto_enable > /proc/acpi/ibm/video
  399. echo auto_disable > /proc/acpi/ibm/video
  400. echo expand_toggle > /proc/acpi/ibm/video
  401. echo video_switch > /proc/acpi/ibm/video
  402. Each video output device can be enabled or disabled individually.
  403. Reading /proc/acpi/ibm/video shows the status of each device.
  404. Automatic video switching can be enabled or disabled. When automatic
  405. video switching is enabled, certain events (e.g. opening the lid,
  406. docking or undocking) cause the video output device to change
  407. automatically. While this can be useful, it also causes flickering
  408. and, on the X40, video corruption. By disabling automatic switching,
  409. the flickering or video corruption can be avoided.
  410. The video_switch command cycles through the available video outputs
  411. (it simulates the behavior of Fn-F7).
  412. Video expansion can be toggled through this feature. This controls
  413. whether the display is expanded to fill the entire LCD screen when a
  414. mode with less than full resolution is used. Note that the current
  415. video expansion status cannot be determined through this feature.
  416. Note that on many models (particularly those using Radeon graphics
  417. chips) the X driver configures the video card in a way which prevents
  418. Fn-F7 from working. This also disables the video output switching
  419. features of this driver, as it uses the same ACPI methods as
  420. Fn-F7. Video switching on the console should still work.
  421. UPDATE: There's now a patch for the X.org Radeon driver which
  422. addresses this issue. Some people are reporting success with the patch
  423. while others are still having problems. For more information:
  424. https://bugs.freedesktop.org/show_bug.cgi?id=2000
  425. ThinkLight control -- /proc/acpi/ibm/light
  426. ------------------------------------------
  427. The current status of the ThinkLight can be found in this file. A few
  428. models which do not make the status available will show it as
  429. "unknown". The available commands are:
  430. echo on > /proc/acpi/ibm/light
  431. echo off > /proc/acpi/ibm/light
  432. Docking / undocking -- /proc/acpi/ibm/dock
  433. ------------------------------------------
  434. Docking and undocking (e.g. with the X4 UltraBase) requires some
  435. actions to be taken by the operating system to safely make or break
  436. the electrical connections with the dock.
  437. The docking feature of this driver generates the following ACPI events:
  438. ibm/dock GDCK 00000003 00000001 -- eject request
  439. ibm/dock GDCK 00000003 00000002 -- undocked
  440. ibm/dock GDCK 00000000 00000003 -- docked
  441. NOTE: These events will only be generated if the laptop was docked
  442. when originally booted. This is due to the current lack of support for
  443. hot plugging of devices in the Linux ACPI framework. If the laptop was
  444. booted while not in the dock, the following message is shown in the
  445. logs:
  446. Mar 17 01:42:34 aero kernel: thinkpad_acpi: dock device not present
  447. In this case, no dock-related events are generated but the dock and
  448. undock commands described below still work. They can be executed
  449. manually or triggered by Fn key combinations (see the example acpid
  450. configuration files included in the driver tarball package available
  451. on the web site).
  452. When the eject request button on the dock is pressed, the first event
  453. above is generated. The handler for this event should issue the
  454. following command:
  455. echo undock > /proc/acpi/ibm/dock
  456. After the LED on the dock goes off, it is safe to eject the laptop.
  457. Note: if you pressed this key by mistake, go ahead and eject the
  458. laptop, then dock it back in. Otherwise, the dock may not function as
  459. expected.
  460. When the laptop is docked, the third event above is generated. The
  461. handler for this event should issue the following command to fully
  462. enable the dock:
  463. echo dock > /proc/acpi/ibm/dock
  464. The contents of the /proc/acpi/ibm/dock file shows the current status
  465. of the dock, as provided by the ACPI framework.
  466. The docking support in this driver does not take care of enabling or
  467. disabling any other devices you may have attached to the dock. For
  468. example, a CD drive plugged into the UltraBase needs to be disabled or
  469. enabled separately. See the provided example acpid configuration files
  470. for how this can be accomplished.
  471. There is no support yet for PCI devices that may be attached to a
  472. docking station, e.g. in the ThinkPad Dock II. The driver currently
  473. does not recognize, enable or disable such devices. This means that
  474. the only docking stations currently supported are the X-series
  475. UltraBase docks and "dumb" port replicators like the Mini Dock (the
  476. latter don't need any ACPI support, actually).
  477. UltraBay eject -- /proc/acpi/ibm/bay
  478. ------------------------------------
  479. Inserting or ejecting an UltraBay device requires some actions to be
  480. taken by the operating system to safely make or break the electrical
  481. connections with the device.
  482. This feature generates the following ACPI events:
  483. ibm/bay MSTR 00000003 00000000 -- eject request
  484. ibm/bay MSTR 00000001 00000000 -- eject lever inserted
  485. NOTE: These events will only be generated if the UltraBay was present
  486. when the laptop was originally booted (on the X series, the UltraBay
  487. is in the dock, so it may not be present if the laptop was undocked).
  488. This is due to the current lack of support for hot plugging of devices
  489. in the Linux ACPI framework. If the laptop was booted without the
  490. UltraBay, the following message is shown in the logs:
  491. Mar 17 01:42:34 aero kernel: thinkpad_acpi: bay device not present
  492. In this case, no bay-related events are generated but the eject
  493. command described below still works. It can be executed manually or
  494. triggered by a hot key combination.
  495. Sliding the eject lever generates the first event shown above. The
  496. handler for this event should take whatever actions are necessary to
  497. shut down the device in the UltraBay (e.g. call idectl), then issue
  498. the following command:
  499. echo eject > /proc/acpi/ibm/bay
  500. After the LED on the UltraBay goes off, it is safe to pull out the
  501. device.
  502. When the eject lever is inserted, the second event above is
  503. generated. The handler for this event should take whatever actions are
  504. necessary to enable the UltraBay device (e.g. call idectl).
  505. The contents of the /proc/acpi/ibm/bay file shows the current status
  506. of the UltraBay, as provided by the ACPI framework.
  507. EXPERIMENTAL warm eject support on the 600e/x, A22p and A3x (To use
  508. this feature, you need to supply the experimental=1 parameter when
  509. loading the module):
  510. These models do not have a button near the UltraBay device to request
  511. a hot eject but rather require the laptop to be put to sleep
  512. (suspend-to-ram) before the bay device is ejected or inserted).
  513. The sequence of steps to eject the device is as follows:
  514. echo eject > /proc/acpi/ibm/bay
  515. put the ThinkPad to sleep
  516. remove the drive
  517. resume from sleep
  518. cat /proc/acpi/ibm/bay should show that the drive was removed
  519. On the A3x, both the UltraBay 2000 and UltraBay Plus devices are
  520. supported. Use "eject2" instead of "eject" for the second bay.
  521. Note: the UltraBay eject support on the 600e/x, A22p and A3x is
  522. EXPERIMENTAL and may not work as expected. USE WITH CAUTION!
  523. CMOS control
  524. ------------
  525. procfs: /proc/acpi/ibm/cmos
  526. sysfs device attribute: cmos_command
  527. This feature is mostly used internally by the ACPI firmware to keep the legacy
  528. CMOS NVRAM bits in sync with the current machine state, and to record this
  529. state so that the ThinkPad will retain such settings across reboots.
  530. Some of these commands actually perform actions in some ThinkPad models, but
  531. this is expected to disappear more and more in newer models. As an example, in
  532. a T43 and in a X40, commands 12 and 13 still control the ThinkLight state for
  533. real, but commands 0 to 2 don't control the mixer anymore (they have been
  534. phased out) and just update the NVRAM.
  535. The range of valid cmos command numbers is 0 to 21, but not all have an
  536. effect and the behavior varies from model to model. Here is the behavior
  537. on the X40 (tpb is the ThinkPad Buttons utility):
  538. 0 - Related to "Volume down" key press
  539. 1 - Related to "Volume up" key press
  540. 2 - Related to "Mute on" key press
  541. 3 - Related to "Access IBM" key press
  542. 4 - Related to "LCD brightness up" key pess
  543. 5 - Related to "LCD brightness down" key press
  544. 11 - Related to "toggle screen expansion" key press/function
  545. 12 - Related to "ThinkLight on"
  546. 13 - Related to "ThinkLight off"
  547. 14 - Related to "ThinkLight" key press (toggle thinklight)
  548. The cmos command interface is prone to firmware split-brain problems, as
  549. in newer ThinkPads it is just a compatibility layer. Do not use it, it is
  550. exported just as a debug tool.
  551. LED control -- /proc/acpi/ibm/led
  552. ---------------------------------
  553. Some of the LED indicators can be controlled through this feature. The
  554. available commands are:
  555. echo '<led number> on' >/proc/acpi/ibm/led
  556. echo '<led number> off' >/proc/acpi/ibm/led
  557. echo '<led number> blink' >/proc/acpi/ibm/led
  558. The <led number> range is 0 to 7. The set of LEDs that can be
  559. controlled varies from model to model. Here is the mapping on the X40:
  560. 0 - power
  561. 1 - battery (orange)
  562. 2 - battery (green)
  563. 3 - UltraBase
  564. 4 - UltraBay
  565. 7 - standby
  566. All of the above can be turned on and off and can be made to blink.
  567. ACPI sounds -- /proc/acpi/ibm/beep
  568. ----------------------------------
  569. The BEEP method is used internally by the ACPI firmware to provide
  570. audible alerts in various situations. This feature allows the same
  571. sounds to be triggered manually.
  572. The commands are non-negative integer numbers:
  573. echo <number> >/proc/acpi/ibm/beep
  574. The valid <number> range is 0 to 17. Not all numbers trigger sounds
  575. and the sounds vary from model to model. Here is the behavior on the
  576. X40:
  577. 0 - stop a sound in progress (but use 17 to stop 16)
  578. 2 - two beeps, pause, third beep ("low battery")
  579. 3 - single beep
  580. 4 - high, followed by low-pitched beep ("unable")
  581. 5 - single beep
  582. 6 - very high, followed by high-pitched beep ("AC/DC")
  583. 7 - high-pitched beep
  584. 9 - three short beeps
  585. 10 - very long beep
  586. 12 - low-pitched beep
  587. 15 - three high-pitched beeps repeating constantly, stop with 0
  588. 16 - one medium-pitched beep repeating constantly, stop with 17
  589. 17 - stop 16
  590. Temperature sensors
  591. -------------------
  592. procfs: /proc/acpi/ibm/thermal
  593. sysfs device attributes: (hwmon "thinkpad") temp*_input
  594. Most ThinkPads include six or more separate temperature sensors but only
  595. expose the CPU temperature through the standard ACPI methods. This
  596. feature shows readings from up to eight different sensors on older
  597. ThinkPads, and up to sixteen different sensors on newer ThinkPads.
  598. For example, on the X40, a typical output may be:
  599. temperatures: 42 42 45 41 36 -128 33 -128
  600. On the T43/p, a typical output may be:
  601. temperatures: 48 48 36 52 38 -128 31 -128 48 52 48 -128 -128 -128 -128 -128
  602. The mapping of thermal sensors to physical locations varies depending on
  603. system-board model (and thus, on ThinkPad model).
  604. http://thinkwiki.org/wiki/Thermal_Sensors is a public wiki page that
  605. tries to track down these locations for various models.
  606. Most (newer?) models seem to follow this pattern:
  607. 1: CPU
  608. 2: (depends on model)
  609. 3: (depends on model)
  610. 4: GPU
  611. 5: Main battery: main sensor
  612. 6: Bay battery: main sensor
  613. 7: Main battery: secondary sensor
  614. 8: Bay battery: secondary sensor
  615. 9-15: (depends on model)
  616. For the R51 (source: Thomas Gruber):
  617. 2: Mini-PCI
  618. 3: Internal HDD
  619. For the T43, T43/p (source: Shmidoax/Thinkwiki.org)
  620. http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_T43.2C_T43p
  621. 2: System board, left side (near PCMCIA slot), reported as HDAPS temp
  622. 3: PCMCIA slot
  623. 9: MCH (northbridge) to DRAM Bus
  624. 10: Clock-generator, mini-pci card and ICH (southbridge), under Mini-PCI
  625. card, under touchpad
  626. 11: Power regulator, underside of system board, below F2 key
  627. The A31 has a very atypical layout for the thermal sensors
  628. (source: Milos Popovic, http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_A31)
  629. 1: CPU
  630. 2: Main Battery: main sensor
  631. 3: Power Converter
  632. 4: Bay Battery: main sensor
  633. 5: MCH (northbridge)
  634. 6: PCMCIA/ambient
  635. 7: Main Battery: secondary sensor
  636. 8: Bay Battery: secondary sensor
  637. Procfs notes:
  638. Readings from sensors that are not available return -128.
  639. No commands can be written to this file.
  640. Sysfs notes:
  641. Sensors that are not available return the ENXIO error. This
  642. status may change at runtime, as there are hotplug thermal
  643. sensors, like those inside the batteries and docks.
  644. thinkpad-acpi thermal sensors are reported through the hwmon
  645. subsystem, and follow all of the hwmon guidelines at
  646. Documentation/hwmon.
  647. EXPERIMENTAL: Embedded controller register dump -- /proc/acpi/ibm/ecdump
  648. ------------------------------------------------------------------------
  649. This feature is marked EXPERIMENTAL because the implementation
  650. directly accesses hardware registers and may not work as expected. USE
  651. WITH CAUTION! To use this feature, you need to supply the
  652. experimental=1 parameter when loading the module.
  653. This feature dumps the values of 256 embedded controller
  654. registers. Values which have changed since the last time the registers
  655. were dumped are marked with a star:
  656. [root@x40 ibm-acpi]# cat /proc/acpi/ibm/ecdump
  657. EC +00 +01 +02 +03 +04 +05 +06 +07 +08 +09 +0a +0b +0c +0d +0e +0f
  658. EC 0x00: a7 47 87 01 fe 96 00 08 01 00 cb 00 00 00 40 00
  659. EC 0x10: 00 00 ff ff f4 3c 87 09 01 ff 42 01 ff ff 0d 00
  660. EC 0x20: 00 00 00 00 00 00 00 00 00 00 00 03 43 00 00 80
  661. EC 0x30: 01 07 1a 00 30 04 00 00 *85 00 00 10 00 50 00 00
  662. EC 0x40: 00 00 00 00 00 00 14 01 00 04 00 00 00 00 00 00
  663. EC 0x50: 00 c0 02 0d 00 01 01 02 02 03 03 03 03 *bc *02 *bc
  664. EC 0x60: *02 *bc *02 00 00 00 00 00 00 00 00 00 00 00 00 00
  665. EC 0x70: 00 00 00 00 00 12 30 40 *24 *26 *2c *27 *20 80 *1f 80
  666. EC 0x80: 00 00 00 06 *37 *0e 03 00 00 00 0e 07 00 00 00 00
  667. EC 0x90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  668. EC 0xa0: *ff 09 ff 09 ff ff *64 00 *00 *00 *a2 41 *ff *ff *e0 00
  669. EC 0xb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  670. EC 0xc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  671. EC 0xd0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  672. EC 0xe0: 00 00 00 00 00 00 00 00 11 20 49 04 24 06 55 03
  673. EC 0xf0: 31 55 48 54 35 38 57 57 08 2f 45 73 07 65 6c 1a
  674. This feature can be used to determine the register holding the fan
  675. speed on some models. To do that, do the following:
  676. - make sure the battery is fully charged
  677. - make sure the fan is running
  678. - run 'cat /proc/acpi/ibm/ecdump' several times, once per second or so
  679. The first step makes sure various charging-related values don't
  680. vary. The second ensures that the fan-related values do vary, since
  681. the fan speed fluctuates a bit. The third will (hopefully) mark the
  682. fan register with a star:
  683. [root@x40 ibm-acpi]# cat /proc/acpi/ibm/ecdump
  684. EC +00 +01 +02 +03 +04 +05 +06 +07 +08 +09 +0a +0b +0c +0d +0e +0f
  685. EC 0x00: a7 47 87 01 fe 96 00 08 01 00 cb 00 00 00 40 00
  686. EC 0x10: 00 00 ff ff f4 3c 87 09 01 ff 42 01 ff ff 0d 00
  687. EC 0x20: 00 00 00 00 00 00 00 00 00 00 00 03 43 00 00 80
  688. EC 0x30: 01 07 1a 00 30 04 00 00 85 00 00 10 00 50 00 00
  689. EC 0x40: 00 00 00 00 00 00 14 01 00 04 00 00 00 00 00 00
  690. EC 0x50: 00 c0 02 0d 00 01 01 02 02 03 03 03 03 bc 02 bc
  691. EC 0x60: 02 bc 02 00 00 00 00 00 00 00 00 00 00 00 00 00
  692. EC 0x70: 00 00 00 00 00 12 30 40 24 27 2c 27 21 80 1f 80
  693. EC 0x80: 00 00 00 06 *be 0d 03 00 00 00 0e 07 00 00 00 00
  694. EC 0x90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  695. EC 0xa0: ff 09 ff 09 ff ff 64 00 00 00 a2 41 ff ff e0 00
  696. EC 0xb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  697. EC 0xc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  698. EC 0xd0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  699. EC 0xe0: 00 00 00 00 00 00 00 00 11 20 49 04 24 06 55 03
  700. EC 0xf0: 31 55 48 54 35 38 57 57 08 2f 45 73 07 65 6c 1a
  701. Another set of values that varies often is the temperature
  702. readings. Since temperatures don't change vary fast, you can take
  703. several quick dumps to eliminate them.
  704. You can use a similar method to figure out the meaning of other
  705. embedded controller registers - e.g. make sure nothing else changes
  706. except the charging or discharging battery to determine which
  707. registers contain the current battery capacity, etc. If you experiment
  708. with this, do send me your results (including some complete dumps with
  709. a description of the conditions when they were taken.)
  710. LCD brightness control
  711. ----------------------
  712. procfs: /proc/acpi/ibm/brightness
  713. sysfs backlight device "thinkpad_screen"
  714. This feature allows software control of the LCD brightness on ThinkPad
  715. models which don't have a hardware brightness slider.
  716. It has some limitations: the LCD backlight cannot be actually turned on or off
  717. by this interface, and in many ThinkPad models, the "dim while on battery"
  718. functionality will be enabled by the BIOS when this interface is used, and
  719. cannot be controlled.
  720. The backlight control has eight levels, ranging from 0 to 7. Some of the
  721. levels may not be distinct.
  722. There are two interfaces to the firmware for brightness control, EC and CMOS.
  723. To select which one should be used, use the brightness_mode module parameter:
  724. brightness_mode=1 selects EC mode, brightness_mode=2 selects CMOS mode,
  725. brightness_mode=3 selects both EC and CMOS. The driver tries to autodetect
  726. which interface to use.
  727. Procfs notes:
  728. The available commands are:
  729. echo up >/proc/acpi/ibm/brightness
  730. echo down >/proc/acpi/ibm/brightness
  731. echo 'level <level>' >/proc/acpi/ibm/brightness
  732. Sysfs notes:
  733. The interface is implemented through the backlight sysfs class, which is poorly
  734. documented at this time.
  735. Locate the thinkpad_screen device under /sys/class/backlight, and inside it
  736. there will be the following attributes:
  737. max_brightness:
  738. Reads the maximum brightness the hardware can be set to.
  739. The minimum is always zero.
  740. actual_brightness:
  741. Reads what brightness the screen is set to at this instant.
  742. brightness:
  743. Writes request the driver to change brightness to the given
  744. value. Reads will tell you what brightness the driver is trying
  745. to set the display to when "power" is set to zero and the display
  746. has not been dimmed by a kernel power management event.
  747. power:
  748. power management mode, where 0 is "display on", and 1 to 3 will
  749. dim the display backlight to brightness level 0 because
  750. thinkpad-acpi cannot really turn the backlight off. Kernel
  751. power management events can temporarily increase the current
  752. power management level, i.e. they can dim the display.
  753. Volume control -- /proc/acpi/ibm/volume
  754. ---------------------------------------
  755. This feature allows volume control on ThinkPad models which don't have
  756. a hardware volume knob. The available commands are:
  757. echo up >/proc/acpi/ibm/volume
  758. echo down >/proc/acpi/ibm/volume
  759. echo mute >/proc/acpi/ibm/volume
  760. echo 'level <level>' >/proc/acpi/ibm/volume
  761. The <level> number range is 0 to 15 although not all of them may be
  762. distinct. The unmute the volume after the mute command, use either the
  763. up or down command (the level command will not unmute the volume).
  764. The current volume level and mute state is shown in the file.
  765. Fan control and monitoring: fan speed, fan enable/disable
  766. ---------------------------------------------------------
  767. procfs: /proc/acpi/ibm/fan
  768. sysfs device attributes: (hwmon "thinkpad") fan1_input, pwm1,
  769. pwm1_enable
  770. sysfs hwmon driver attributes: fan_watchdog
  771. NOTE NOTE NOTE: fan control operations are disabled by default for
  772. safety reasons. To enable them, the module parameter "fan_control=1"
  773. must be given to thinkpad-acpi.
  774. This feature attempts to show the current fan speed, control mode and
  775. other fan data that might be available. The speed is read directly
  776. from the hardware registers of the embedded controller. This is known
  777. to work on later R, T, X and Z series ThinkPads but may show a bogus
  778. value on other models.
  779. Fan levels:
  780. Most ThinkPad fans work in "levels" at the firmware interface. Level 0
  781. stops the fan. The higher the level, the higher the fan speed, although
  782. adjacent levels often map to the same fan speed. 7 is the highest
  783. level, where the fan reaches the maximum recommended speed.
  784. Level "auto" means the EC changes the fan level according to some
  785. internal algorithm, usually based on readings from the thermal sensors.
  786. There is also a "full-speed" level, also known as "disengaged" level.
  787. In this level, the EC disables the speed-locked closed-loop fan control,
  788. and drives the fan as fast as it can go, which might exceed hardware
  789. limits, so use this level with caution.
  790. The fan usually ramps up or down slowly from one speed to another, and
  791. it is normal for the EC to take several seconds to react to fan
  792. commands. The full-speed level may take up to two minutes to ramp up to
  793. maximum speed, and in some ThinkPads, the tachometer readings go stale
  794. while the EC is transitioning to the full-speed level.
  795. WARNING WARNING WARNING: do not leave the fan disabled unless you are
  796. monitoring all of the temperature sensor readings and you are ready to
  797. enable it if necessary to avoid overheating.
  798. An enabled fan in level "auto" may stop spinning if the EC decides the
  799. ThinkPad is cool enough and doesn't need the extra airflow. This is
  800. normal, and the EC will spin the fan up if the various thermal readings
  801. rise too much.
  802. On the X40, this seems to depend on the CPU and HDD temperatures.
  803. Specifically, the fan is turned on when either the CPU temperature
  804. climbs to 56 degrees or the HDD temperature climbs to 46 degrees. The
  805. fan is turned off when the CPU temperature drops to 49 degrees and the
  806. HDD temperature drops to 41 degrees. These thresholds cannot
  807. currently be controlled.
  808. The ThinkPad's ACPI DSDT code will reprogram the fan on its own when
  809. certain conditions are met. It will override any fan programming done
  810. through thinkpad-acpi.
  811. The thinkpad-acpi kernel driver can be programmed to revert the fan
  812. level to a safe setting if userspace does not issue one of the procfs
  813. fan commands: "enable", "disable", "level" or "watchdog", or if there
  814. are no writes to pwm1_enable (or to pwm1 *if and only if* pwm1_enable is
  815. set to 1, manual mode) within a configurable amount of time of up to
  816. 120 seconds. This functionality is called fan safety watchdog.
  817. Note that the watchdog timer stops after it enables the fan. It will be
  818. rearmed again automatically (using the same interval) when one of the
  819. above mentioned fan commands is received. The fan watchdog is,
  820. therefore, not suitable to protect against fan mode changes made through
  821. means other than the "enable", "disable", and "level" procfs fan
  822. commands, or the hwmon fan control sysfs interface.
  823. Procfs notes:
  824. The fan may be enabled or disabled with the following commands:
  825. echo enable >/proc/acpi/ibm/fan
  826. echo disable >/proc/acpi/ibm/fan
  827. Placing a fan on level 0 is the same as disabling it. Enabling a fan
  828. will try to place it in a safe level if it is too slow or disabled.
  829. The fan level can be controlled with the command:
  830. echo 'level <level>' > /proc/acpi/ibm/fan
  831. Where <level> is an integer from 0 to 7, or one of the words "auto" or
  832. "full-speed" (without the quotes). Not all ThinkPads support the "auto"
  833. and "full-speed" levels. The driver accepts "disengaged" as an alias for
  834. "full-speed", and reports it as "disengaged" for backwards
  835. compatibility.
  836. On the X31 and X40 (and ONLY on those models), the fan speed can be
  837. controlled to a certain degree. Once the fan is running, it can be
  838. forced to run faster or slower with the following command:
  839. echo 'speed <speed>' > /proc/acpi/ibm/fan
  840. The sustainable range of fan speeds on the X40 appears to be from about
  841. 3700 to about 7350. Values outside this range either do not have any
  842. effect or the fan speed eventually settles somewhere in that range. The
  843. fan cannot be stopped or started with this command. This functionality
  844. is incomplete, and not available through the sysfs interface.
  845. To program the safety watchdog, use the "watchdog" command.
  846. echo 'watchdog <interval in seconds>' > /proc/acpi/ibm/fan
  847. If you want to disable the watchdog, use 0 as the interval.
  848. Sysfs notes:
  849. The sysfs interface follows the hwmon subsystem guidelines for the most
  850. part, and the exception is the fan safety watchdog.
  851. Writes to any of the sysfs attributes may return the EINVAL error if
  852. that operation is not supported in a given ThinkPad or if the parameter
  853. is out-of-bounds, and EPERM if it is forbidden. They may also return
  854. EINTR (interrupted system call), and EIO (I/O error while trying to talk
  855. to the firmware).
  856. Features not yet implemented by the driver return ENOSYS.
  857. hwmon device attribute pwm1_enable:
  858. 0: PWM offline (fan is set to full-speed mode)
  859. 1: Manual PWM control (use pwm1 to set fan level)
  860. 2: Hardware PWM control (EC "auto" mode)
  861. 3: reserved (Software PWM control, not implemented yet)
  862. Modes 0 and 2 are not supported by all ThinkPads, and the
  863. driver is not always able to detect this. If it does know a
  864. mode is unsupported, it will return -EINVAL.
  865. hwmon device attribute pwm1:
  866. Fan level, scaled from the firmware values of 0-7 to the hwmon
  867. scale of 0-255. 0 means fan stopped, 255 means highest normal
  868. speed (level 7).
  869. This attribute only commands the fan if pmw1_enable is set to 1
  870. (manual PWM control).
  871. hwmon device attribute fan1_input:
  872. Fan tachometer reading, in RPM. May go stale on certain
  873. ThinkPads while the EC transitions the PWM to offline mode,
  874. which can take up to two minutes. May return rubbish on older
  875. ThinkPads.
  876. hwmon driver attribute fan_watchdog:
  877. Fan safety watchdog timer interval, in seconds. Minimum is
  878. 1 second, maximum is 120 seconds. 0 disables the watchdog.
  879. To stop the fan: set pwm1 to zero, and pwm1_enable to 1.
  880. To start the fan in a safe mode: set pwm1_enable to 2. If that fails
  881. with EINVAL, try to set pwm1_enable to 1 and pwm1 to at least 128 (255
  882. would be the safest choice, though).
  883. EXPERIMENTAL: WAN
  884. -----------------
  885. procfs: /proc/acpi/ibm/wan
  886. sysfs device attribute: wwan_enable
  887. This feature is marked EXPERIMENTAL because the implementation
  888. directly accesses hardware registers and may not work as expected. USE
  889. WITH CAUTION! To use this feature, you need to supply the
  890. experimental=1 parameter when loading the module.
  891. This feature shows the presence and current state of a W-WAN (Sierra
  892. Wireless EV-DO) device.
  893. It was tested on a Lenovo Thinkpad X60. It should probably work on other
  894. Thinkpad models which come with this module installed.
  895. Procfs notes:
  896. If the W-WAN card is installed, the following commands can be used:
  897. echo enable > /proc/acpi/ibm/wan
  898. echo disable > /proc/acpi/ibm/wan
  899. Sysfs notes:
  900. If the W-WAN card is installed, it can be enabled /
  901. disabled through the "wwan_enable" thinkpad-acpi device
  902. attribute, and its current status can also be queried.
  903. enable:
  904. 0: disables WWAN card / WWAN card is disabled
  905. 1: enables WWAN card / WWAN card is enabled.
  906. Note: this interface will be probably be superseeded by the
  907. generic rfkill class, so it is NOT to be considered stable yet.
  908. Multiple Commands, Module Parameters
  909. ------------------------------------
  910. Multiple commands can be written to the proc files in one shot by
  911. separating them with commas, for example:
  912. echo enable,0xffff > /proc/acpi/ibm/hotkey
  913. echo lcd_disable,crt_enable > /proc/acpi/ibm/video
  914. Commands can also be specified when loading the thinkpad-acpi module,
  915. for example:
  916. modprobe thinkpad_acpi hotkey=enable,0xffff video=auto_disable
  917. Enabling debugging output
  918. -------------------------
  919. The module takes a debug parameter which can be used to selectively
  920. enable various classes of debugging output, for example:
  921. modprobe ibm_acpi debug=0xffff
  922. will enable all debugging output classes. It takes a bitmask, so
  923. to enable more than one output class, just add their values.
  924. Debug bitmask Description
  925. 0x0001 Initialization and probing
  926. 0x0002 Removal
  927. There is also a kernel build option to enable more debugging
  928. information, which may be necessary to debug driver problems.
  929. The level of debugging information output by the driver can be changed
  930. at runtime through sysfs, using the driver attribute debug_level. The
  931. attribute takes the same bitmask as the debug module parameter above.
  932. Force loading of module
  933. -----------------------
  934. If thinkpad-acpi refuses to detect your ThinkPad, you can try to specify
  935. the module parameter force_load=1. Regardless of whether this works or
  936. not, please contact ibm-acpi-devel@lists.sourceforge.net with a report.
  937. Sysfs interface changelog:
  938. 0x000100: Initial sysfs support, as a single platform driver and
  939. device.
  940. 0x000200: Hot key support for 32 hot keys, and radio slider switch
  941. support.
  942. 0x010000: Hot keys are now handled by default over the input
  943. layer, the radio switch generates input event EV_RADIO,
  944. and the driver enables hot key handling by default in
  945. the firmware.
  946. 0x020000: ABI fix: added a separate hwmon platform device and
  947. driver, which must be located by name (thinkpad)
  948. and the hwmon class for libsensors4 (lm-sensors 3)
  949. compatibility. Moved all hwmon attributes to this
  950. new platform device.