Difference between revisions of "SMAPI support for Linux"
(→Using <tt>tp_smapi</tt>: - v0.03) |
|||
Line 15: | Line 15: | ||
==Using <tt>tp_smapi</tt>== | ==Using <tt>tp_smapi</tt>== | ||
− | The <tt>tp_smapi</tt> kernel module uses the current SMAPI interface to expose some features of the SMAPI BIOS via a sysfs interface. Currently, the only | + | The <tt>tp_smapi</tt> kernel module uses the current SMAPI interface to expose some features of the SMAPI BIOS via a sysfs interface. Currently, the only implemented functionality is control over battery charging (this is useful for [[Maintenance#Battery_Treatment|increasing battery lifetime]], or for using an under-spec power supply that can't handle a running+charging laptop). The module was first posted [http://mailman.linux-thinkpad.org/pipermail/linux-thinkpad/2005-December/030792.html here]. |
− | implemented functionality is | ||
To download the current version from the [http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad linux-thinkpad] list archives: | To download the current version from the [http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad linux-thinkpad] list archives: | ||
Line 41: | Line 40: | ||
40 | 40 | ||
70 | 70 | ||
+ | # echo 1 > /sys/devices/platform/smapi/inhibit_charge | ||
+ | # cat /sys/devices/platform/smapi/inhibit_charge | ||
+ | 0 | ||
− | + | If you get a "not supported error", your laptop doesn't provide the specific function (or at least not via SMAPI). | |
− | |||
− | |||
− | ====Models on which this driver works | + | Other things that can be controlled through SMAPI, but are not supported in this version of the driver, include forcing battery discharge, PCI bus power saving, CPU power saving control, extended smart battery information, CD/DVD drive speed control and fan control. See the exported symbols in |
+ | PWRMGRIF.DLL or TPPWR32.DLL in your Windows partition for more hints. | ||
+ | |||
+ | ====Models on which this driver works (at least some functions)==== | ||
* ThinkPad {{T43}} | * ThinkPad {{T43}} | ||
+ | * ThinkPad {{T42p}}, {{X40}}, {{G41}} (not yet verified). | ||
+ | |||
+ | For the details, see the README file inside the package. | ||
− | ====Models which | + | ====Models on which none of the functions work==== |
− | * ThinkPad | + | * ThinkPad {{T40p}}, {{R40}} |
Please update the above and report your experience on the [[Talk:Editing SMAPI support for Linux|discussion]] page. If the module loads but gives "not supported" errors when you try to use it, report whether the corresponding functionality is available under Windows - maybe your ThinkPad just can't do that. | Please update the above and report your experience on the [[Talk:Editing SMAPI support for Linux|discussion]] page. If the module loads but gives "not supported" errors when you try to use it, report whether the corresponding functionality is available under Windows - maybe your ThinkPad just can't do that. | ||
[[Category:Tools]] [[Category:Patches]] | [[Category:Tools]] [[Category:Patches]] |
Revision as of 15:17, 5 December 2005
ThinkPad laptops include a proprietary interface called SMAPI BIOS (System Management Application Program Interface) which provides some hardware control functionality that is not exposed by any other interface (e.g., ACPI).
The SMAPI interfaces changes a lot between models, and is poorly documented, so Linux support is not exhaustive for most models. There currently two SMAPI interfaces available: tpctl for older ThinkPads, and tp_smapi for newer ones.
Contents
Using tpctl and thinkpad
This solution consists of a module, called thinkpad, and a user-space tool caled tpctl. It provides very rich functionality for older ThinkPads, but on newer ThinkPads much of this functionality is exposed and supported through an ACPI interface and the SMAPI access does not work anymore. For details, see the README and list of supported models.
Project page: http://tpctl.sourceforge.net/
Using tp_smapi
The tp_smapi kernel module uses the current SMAPI interface to expose some features of the SMAPI BIOS via a sysfs interface. Currently, the only implemented functionality is control over battery charging (this is useful for increasing battery lifetime, or for using an under-spec power supply that can't handle a running+charging laptop). The module was first posted here.
To download the current version from the linux-thinkpad list archives:
# wget -O - http://mailman.linux-thinkpad.org/pipermail/linux-thinkpad/2005-December/030830.html | perl -MMIME::Base64 -ne '$a=!$a if m/^------=_/; next if !$a; $a++ if m/^$/; print decode_base64($_) if $a>1' > tp_smapi-0.03.tgz
To compile and load the module:
# tar xzvf tp_smapi-0.03.tgz # cd tp_smapi-0.03 # make load
To install permanently (optional):
# make install # modprobe tp_smapi
Example of usage:
# echo 40 > /sys/devices/platform/smapi/start_charge_thresh # echo 70 > /sys/devices/platform/smapi/stop_charge_thresh # cat /sys/devices/platform/smapi/*_charge_thresh 40 70 # echo 1 > /sys/devices/platform/smapi/inhibit_charge # cat /sys/devices/platform/smapi/inhibit_charge 0
If you get a "not supported error", your laptop doesn't provide the specific function (or at least not via SMAPI).
Other things that can be controlled through SMAPI, but are not supported in this version of the driver, include forcing battery discharge, PCI bus power saving, CPU power saving control, extended smart battery information, CD/DVD drive speed control and fan control. See the exported symbols in PWRMGRIF.DLL or TPPWR32.DLL in your Windows partition for more hints.
Models on which this driver works (at least some functions)
For the details, see the README file inside the package.
Models on which none of the functions work
Please update the above and report your experience on the discussion page. If the module loads but gives "not supported" errors when you try to use it, report whether the corresponding functionality is available under Windows - maybe your ThinkPad just can't do that.