Difference between revisions of "SMAPI support for Linux"

From ThinkWiki
Jump to: navigation, search
 
 
(123 intermediate revisions by 22 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 currently two SMAPI interfaces available: <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.
 +
*[[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.
  
{{WARN|These driver uses undocumented features and direct hardware access. They thus cannot be guaranteed to work, and may cause arbitrary damage
+
[[Category:Tools]] [[Category:Patches]]
(especially on models they weren't tested on).}}
 
 
 
==Using <tt>tpctl</tt> and <tt>thinkpad</tt>==
 
 
 
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/
 
 
 
==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
 
implemented functionality is setting the battery charge start and stop thresholds. It has been posted [http://mailman.linux-thinkpad.org/pipermail/linux-thinkpad/2005-December/030792.html here].
 
 
 
Download:
 
 
 
# wget -O - http://mailman.linux-thinkpad.org/pipermail/linux-thinkpad/2005-December/030792.html | \
 
  perl -ne '$a=!$a if m/^---/; next if !$a; $a++ if m/^$/; print if $a>1' | mmencode -u > tp_smapi-0.01.tgz
 
 
 
Loading:
 
 
 
# tar xzvf tp_smapi-0.01.tgz
 
# cd tp_smapi-0.01
 
# make load
 
 
 
To install permanently (optional):
 
 
 
# make install
 
# modprobe tp_smapi
 
 
 
Example:
 
 
 
# 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
 
 
 
The driver has only been tested on a ThinkPad T43, but the built-in whitelist includes all recent ThinkPad models in order to facilitate testing.
 
Please report your experience on the [[Talk:Editing SMAPI support for Linux|discussion]] page.
 
 
 
Other things that can be controlled through SMAPI, but are not supported in this version of the driver, include forcing battery discharge, disallowing
 
battery charging, PCI bus power saving, CPU power saving control, extended smart battery information and fan control. See the exported symbols in
 
PWRMGRIF.DLL for more hints.
 

Latest revision as of 19: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.