Difference between revisions of "SMAPI support for Linux"

From ThinkWiki
Jump to: navigation, search
(Models on which none of the functions work)
 
(91 intermediate revisions by 19 users not shown)
Line 1: Line 1:
 
ThinkPad laptops include a proprietary interface called SMAPI BIOS (System Management Application Program Interface) which provides some
 
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).
+
hardware control functionality that is not exposed by standard interfaces such as ACPI and APM.
  
The SMAPI interfaces changes a lot between models, and is poorly documented, so Linux support is not exhaustive for most models. There are currently two SMAPI access mechanisms available: <tt>thinkpad</tt> and <tt>tpctl</tt> for older ThinkPads, and <tt>tp_smapi</tt> for newer ones.
+
The SMAPI interfaces has mutated between models and is poorly documented, so Linux support is not exhaustive for most models. There are currently two SMAPI access mechanisms available:
 
+
*[[tp_smapi]] for newer ThinkPad models. This module provides battery information for models produced since 2001 and possibly earlier, and additional features for models produced since 2003.
{{WARN|These drivers use undocumented features and direct hardware access. They thus cannot be guaranteed to work, and may cause arbitrary damage
+
*[[tpctl]] with the <tt>thinkpad</tt> kernel modules worked on older ThinkPad models but are now obsolete: the drivers no longer build (with the latest Linux versions). On modern ThinkPads tpctl has been superseded by the standardized ACPI subsystem and the tp_smapi driver.
(especially on models they weren't tested on).}}
 
 
 
==Using the <tt>thinkpad</tt> module==
 
 
 
This solution consists of a module, called <tt>thinkpad</tt>, and a user-space tool caled <tt>tpctl</tt>. 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 [http://tpctl.sourceforge.net/README README] and [http://tpctl.sourceforge.net/SUPPORTED-MODELS list of supported models].
 
 
 
* Project page: http://tpctl.sourceforge.net/
 
* You need to download the [http://sourceforge.net/project/showfiles.php?group_id=1212&package_id=29354t thinkpad module] and [http://sourceforge.net/project/showfiles.php?group_id=1212&package_id=1204 tpctl userspace tool].
 
* There is also an optional GUI: [http://sourceforge.net/project/showfiles.php?group_id=1212&package_id=99929 configure-thinkpad].
 
 
 
==Using the <tt>tp_smapi</tt> module==
 
 
 
The <tt>tp_smapi</tt> kernel module exposes some features of the SMAPI BIOS found on recent ThinkPads 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 a leftover under-spec power supply that can't handle the combined power draw of running and charging).
 
 
 
* Project page: http://tpctl.sourceforge.net/
 
* You need to donwnload only the [http://sourceforge.net/project/showfiles.php?group_id=1212&package_id=171579 tp_smapi kernel module].
 
 
 
To compile and load the module:
 
 
 
# tar xzvf tp_smapi-0.06.tgz
 
# cd tp_smapi-0.06
 
# 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
 
 
 
To unconditionally inhibit charging for 17 minutes:
 
 
 
# echo 17 > /sys/devices/platform/smapi/inhibit_charge_minutes
 
 
 
To cancel charge inhibiting:
 
 
 
# echo 0 > /sys/devices/platform/smapi/inhibit_charge_minutes
 
 
 
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 included README file for more information.
 
 
 
====Models on which this driver works====
 
* ThinkPad {{T43}}, {{T43p}}, {{X41}} (all functions)
 
* ThinkPad {{T42p}}, {{X40}}, {{G41}} (all except <tt>stop_charge_thresh</tt>)
 
 
 
For the details, see the README file inside the package.
 
If you have new data, please report it on the [[Talk:SMAPI support for Linux|discussion]] page.
 
 
 
====Models on which none of the functions work====
 
* ThinkPad {{T40}}, {{R50p}}, {{R40}}, {{X31}} and probably all earlier models. These apparently don't have the relevant capabilities, even under Windows.
 
 
 
Please update the above and report your experience on the [[Talk: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]]

Latest revision as of 20:04, 7 January 2008

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 standard interfaces such as ACPI and APM.

The SMAPI interfaces has mutated between models and is poorly documented, so Linux support is not exhaustive for most models. There are currently two SMAPI access mechanisms available:

  • tp_smapi for newer ThinkPad models. This module provides battery information for models produced since 2001 and possibly earlier, and additional features for models produced since 2003.
  • tpctl with the thinkpad kernel modules worked on older ThinkPad models but are now obsolete: the drivers no longer build (with the latest Linux versions). On modern ThinkPads tpctl has been superseded by the standardized ACPI subsystem and the tp_smapi driver.