Difference between revisions of "Thinkpad-acpi"

From ThinkWiki
Jump to: navigation, search
(suggest merge with ibm-acpi)
Line 11: Line 11:
 
The thinkpad-acpi driver has detailed documentation, which is shipped inside the Linux kernel sources, as "Documentation/thinkpad-acpi.txt" or as "Documentation/laptops/thinkpad-acpi.txt".  If you feel a need to change the hot key mask manually, it is probably best to look at that documentation first to understand the full side effects of any changes.
 
The thinkpad-acpi driver has detailed documentation, which is shipped inside the Linux kernel sources, as "Documentation/thinkpad-acpi.txt" or as "Documentation/laptops/thinkpad-acpi.txt".  If you feel a need to change the hot key mask manually, it is probably best to look at that documentation first to understand the full side effects of any changes.
  
 +
==sysfs interface==
 +
some of the ThinkPad specific settings can be viewed or altered in sysfs under {{path|/sys/devices/platform/thinkpad_acpi}} and {{path|/sys/devices/platform/thinkpad_hwmon}}
 +
 +
====thinkpad_acpi====
 +
{{path|/sys/devices/platform/thinkpad_acpi}} directory structure is as follows on a T60 with kernel 2.6.29
 +
<pre>
 +
bluetooth_enable
 +
|-- cmos_command
 +
|-- driver -> ../../../bus/platform/drivers/thinkpad_acpi
 +
|-- hotkey_all_mask
 +
|-- hotkey_bios_enabled
 +
|-- hotkey_bios_mask
 +
|-- hotkey_enable
 +
|-- hotkey_mask
 +
|-- hotkey_poll_freq
 +
|-- hotkey_recommended_mask
 +
|-- hotkey_report_mode
 +
|-- hotkey_source_mask
 +
|-- leds
 +
|  |-- tpacpi::bay_active
 +
|  |  |-- brightness
 +
|  |  |-- device -> ../../../thinkpad_acpi
 +
|  |  |-- power
 +
|  |  |  `-- wakeup
 +
|  |  |-- subsystem -> ../../../../../class/leds
 +
|  |  |-- trigger
 +
|  |  `-- uevent
 +
|  |-- tpacpi::dock_active
 +
|  |  |-- brightness
 +
|  |  |-- device -> ../../../thinkpad_acpi
 +
|  |  |-- power
 +
|  |  |  `-- wakeup
 +
|  |  |-- subsystem -> ../../../../../class/leds
 +
|  |  |-- trigger
 +
|  |  `-- uevent
 +
|  |-- tpacpi::dock_batt
 +
|  |  |-- brightness
 +
|  |  |-- device -> ../../../thinkpad_acpi
 +
|  |  |-- power
 +
|  |  |  `-- wakeup
 +
|  |  |-- subsystem -> ../../../../../class/leds
 +
|  |  |-- trigger
 +
|  |  `-- uevent
 +
|  |-- tpacpi::power
 +
|  |  |-- brightness
 +
|  |  |-- device -> ../../../thinkpad_acpi
 +
|  |  |-- power
 +
|  |  |  `-- wakeup
 +
|  |  |-- subsystem -> ../../../../../class/leds
 +
|  |  |-- trigger
 +
|  |  `-- uevent
 +
|  |-- tpacpi::standby
 +
|  |  |-- brightness
 +
|  |  |-- device -> ../../../thinkpad_acpi
 +
|  |  |-- power
 +
|  |  |  `-- wakeup
 +
|  |  |-- subsystem -> ../../../../../class/leds
 +
|  |  |-- trigger
 +
|  |  `-- uevent
 +
|  |-- tpacpi::thinklight
 +
|  |  |-- brightness
 +
|  |  |-- device -> ../../../thinkpad_acpi
 +
|  |  |-- power
 +
|  |  |  `-- wakeup
 +
|  |  |-- subsystem -> ../../../../../class/leds
 +
|  |  |-- trigger
 +
|  |  `-- uevent
 +
|  |-- tpacpi::unknown_led
 +
|  |  |-- brightness
 +
|  |  |-- device -> ../../../thinkpad_acpi
 +
|  |  |-- power
 +
|  |  |  `-- wakeup
 +
|  |  |-- subsystem -> ../../../../../class/leds
 +
|  |  |-- trigger
 +
|  |  `-- uevent
 +
|  |-- tpacpi:green:batt
 +
|  |  |-- brightness
 +
|  |  |-- device -> ../../../thinkpad_acpi
 +
|  |  |-- power
 +
|  |  |  `-- wakeup
 +
|  |  |-- subsystem -> ../../../../../class/leds
 +
|  |  |-- trigger
 +
|  |  `-- uevent
 +
|  `-- tpacpi:orange:batt
 +
|      |-- brightness
 +
|      |-- device -> ../../../thinkpad_acpi
 +
|      |-- power
 +
|      |  `-- wakeup
 +
|      |-- subsystem -> ../../../../../class/leds
 +
|      |-- trigger
 +
|      `-- uevent
 +
|-- modalias
 +
|-- power
 +
|  `-- wakeup
 +
|-- rfkill
 +
|  `-- rfkill0
 +
|      |-- claim
 +
|      |-- device -> ../../../thinkpad_acpi
 +
|      |-- name
 +
|      |-- power
 +
|      |  `-- wakeup
 +
|      |-- state
 +
|      |-- subsystem -> ../../../../../class/rfkill
 +
|      |-- type
 +
|      `-- uevent
 +
|-- subsystem -> ../../../bus/platform
 +
|-- uevent
 +
|-- wakeup_hotunplug_complete
 +
`-- wakeup_reason
 +
</pre>
 +
====thinkpad_hwmon====
 +
{{path|/sys/devices/platform/thinkpad_hwmon}} directory structure is as follows on a T60 with kernel 2.6.29
 +
<pre>
 +
|-- driver -> ../../../bus/platform/drivers/thinkpad_hwmon
 +
|-- fan1_input
 +
|-- hwmon
 +
|  `-- hwmon0
 +
|      |-- device -> ../../../thinkpad_hwmon
 +
|      |-- power
 +
|      |  `-- wakeup
 +
|      |-- subsystem -> ../../../../../class/hwmon
 +
|      `-- uevent
 +
|-- modalias
 +
|-- name
 +
|-- power
 +
|  `-- wakeup
 +
|-- pwm1
 +
|-- pwm1_enable
 +
|-- subsystem -> ../../../bus/platform
 +
|-- temp1_input
 +
|-- temp2_input
 +
|-- temp3_input
 +
|-- temp4_input
 +
|-- temp5_input
 +
|-- temp6_input
 +
|-- temp7_input
 +
|-- temp8_input
 +
`-- uevent
 +
</pre>
 +
==proc interface==
 +
some legacy interfaces can also be found under {{path|/proc/acpi/ibm}} these interfaces should be considered deprecated. Please use sysfs instead.
 +
 +
<pre>
 +
|-- bay
 +
|-- beep
 +
|-- bluetooth
 +
|-- brightness
 +
|-- cmos
 +
|-- driver
 +
|-- fan
 +
|-- hotkey
 +
|-- led
 +
|-- light
 +
|-- thermal
 +
|-- video
 +
`-- volume
 +
</pre>
 
==Development==
 
==Development==
 
To help with development and maintenance of the thinkpad-acpi driver, please add your model to the [[List of DMI IDs]].
 
To help with development and maintenance of the thinkpad-acpi driver, please add your model to the [[List of DMI IDs]].

Revision as of 14:35, 22 April 2009

Thinkpad-specific ACPI driver

This is a Linux ACPI driver for the IBM ThinkPad laptops written by Borislav Deianov and Henrique de Moraes Holschuh. The driver replaces ibm-acpi in Linux mainline as of 2.6.22 (March 2007). To confuse matters further, it appears that there was also an older (now abandoned) driver of the same name written by Erik Rigtorp which never made it into the mainline kernel. The current thinkpad-acpi contains essentially the same functionality as ibm-acpi with some added features. Among which are registering of acpi events to the "thinkvantage" and volume/mute buttons which could previously only be accessed through the use of the tpb utility.

Hotkeys

To view which hotkeys are active you can use "acpi_listen", but that is deprecated. A better way is to use "lsinput" and "input-events" commands to look at the output of the thinkpad-acpi input device(s).

One important difference from ibm-acpi for those who wish to enable all possible hot keys, is that thinkpad-acpi automatically enables them. One should not need to do anything to get the best possible thinkpad-acpi configuration for his ThinkPad (as long as he is using the latest thinkpad-acpi).

In particular, old documentation that tells you to "echo enable,0xffffffff >/proc/acpi/ibm/hotkey", or to give thinkpad-acpi any hotkey= module parameters to enable hot keys by default, is likely incorrect.

The thinkpad-acpi driver has detailed documentation, which is shipped inside the Linux kernel sources, as "Documentation/thinkpad-acpi.txt" or as "Documentation/laptops/thinkpad-acpi.txt". If you feel a need to change the hot key mask manually, it is probably best to look at that documentation first to understand the full side effects of any changes.

sysfs interface

some of the ThinkPad specific settings can be viewed or altered in sysfs under /sys/devices/platform/thinkpad_acpi and /sys/devices/platform/thinkpad_hwmon

thinkpad_acpi

/sys/devices/platform/thinkpad_acpi directory structure is as follows on a T60 with kernel 2.6.29

bluetooth_enable
|-- cmos_command
|-- driver -> ../../../bus/platform/drivers/thinkpad_acpi
|-- hotkey_all_mask
|-- hotkey_bios_enabled
|-- hotkey_bios_mask
|-- hotkey_enable
|-- hotkey_mask
|-- hotkey_poll_freq
|-- hotkey_recommended_mask
|-- hotkey_report_mode
|-- hotkey_source_mask
|-- leds
|   |-- tpacpi::bay_active
|   |   |-- brightness
|   |   |-- device -> ../../../thinkpad_acpi
|   |   |-- power
|   |   |   `-- wakeup
|   |   |-- subsystem -> ../../../../../class/leds
|   |   |-- trigger
|   |   `-- uevent
|   |-- tpacpi::dock_active
|   |   |-- brightness
|   |   |-- device -> ../../../thinkpad_acpi
|   |   |-- power
|   |   |   `-- wakeup
|   |   |-- subsystem -> ../../../../../class/leds
|   |   |-- trigger
|   |   `-- uevent
|   |-- tpacpi::dock_batt
|   |   |-- brightness
|   |   |-- device -> ../../../thinkpad_acpi
|   |   |-- power
|   |   |   `-- wakeup
|   |   |-- subsystem -> ../../../../../class/leds
|   |   |-- trigger
|   |   `-- uevent
|   |-- tpacpi::power
|   |   |-- brightness
|   |   |-- device -> ../../../thinkpad_acpi
|   |   |-- power
|   |   |   `-- wakeup
|   |   |-- subsystem -> ../../../../../class/leds
|   |   |-- trigger
|   |   `-- uevent
|   |-- tpacpi::standby
|   |   |-- brightness
|   |   |-- device -> ../../../thinkpad_acpi
|   |   |-- power
|   |   |   `-- wakeup
|   |   |-- subsystem -> ../../../../../class/leds
|   |   |-- trigger
|   |   `-- uevent
|   |-- tpacpi::thinklight
|   |   |-- brightness
|   |   |-- device -> ../../../thinkpad_acpi
|   |   |-- power
|   |   |   `-- wakeup
|   |   |-- subsystem -> ../../../../../class/leds
|   |   |-- trigger
|   |   `-- uevent
|   |-- tpacpi::unknown_led
|   |   |-- brightness
|   |   |-- device -> ../../../thinkpad_acpi
|   |   |-- power
|   |   |   `-- wakeup
|   |   |-- subsystem -> ../../../../../class/leds
|   |   |-- trigger
|   |   `-- uevent
|   |-- tpacpi:green:batt
|   |   |-- brightness
|   |   |-- device -> ../../../thinkpad_acpi
|   |   |-- power
|   |   |   `-- wakeup
|   |   |-- subsystem -> ../../../../../class/leds
|   |   |-- trigger
|   |   `-- uevent
|   `-- tpacpi:orange:batt
|       |-- brightness
|       |-- device -> ../../../thinkpad_acpi
|       |-- power
|       |   `-- wakeup
|       |-- subsystem -> ../../../../../class/leds
|       |-- trigger
|       `-- uevent
|-- modalias
|-- power
|   `-- wakeup
|-- rfkill
|   `-- rfkill0
|       |-- claim
|       |-- device -> ../../../thinkpad_acpi
|       |-- name
|       |-- power
|       |   `-- wakeup
|       |-- state
|       |-- subsystem -> ../../../../../class/rfkill
|       |-- type
|       `-- uevent
|-- subsystem -> ../../../bus/platform
|-- uevent
|-- wakeup_hotunplug_complete
`-- wakeup_reason

thinkpad_hwmon

/sys/devices/platform/thinkpad_hwmon directory structure is as follows on a T60 with kernel 2.6.29

|-- driver -> ../../../bus/platform/drivers/thinkpad_hwmon
|-- fan1_input
|-- hwmon
|   `-- hwmon0
|       |-- device -> ../../../thinkpad_hwmon
|       |-- power
|       |   `-- wakeup
|       |-- subsystem -> ../../../../../class/hwmon
|       `-- uevent
|-- modalias
|-- name
|-- power
|   `-- wakeup
|-- pwm1
|-- pwm1_enable
|-- subsystem -> ../../../bus/platform
|-- temp1_input
|-- temp2_input
|-- temp3_input
|-- temp4_input
|-- temp5_input
|-- temp6_input
|-- temp7_input
|-- temp8_input
`-- uevent

proc interface

some legacy interfaces can also be found under /proc/acpi/ibm these interfaces should be considered deprecated. Please use sysfs instead.

|-- bay
|-- beep
|-- bluetooth
|-- brightness
|-- cmos
|-- driver
|-- fan
|-- hotkey
|-- led
|-- light
|-- thermal
|-- video
`-- volume

Development

To help with development and maintenance of the thinkpad-acpi driver, please add your model to the List of DMI IDs.

Further documentation

More comprehensive documentation can be found in the kernel source tree under Documentation/thinkpad-acpi.txt or Documentation/laptops/thinkpad-acpi.txt.

For now, please refer to the ibm-acpi page, or ask on the linux-thinkpad mailinglist for any other information on the new thinkpad-acpi driver.

External links related to thinkpad-acpi

TODO
needs editing

: consider merging with ibm-acpi