https://www.thinkwiki.org/w/api.php?action=feedcontributions&user=Ywarnier&feedformat=atomThinkWiki - User contributions [en]2024-03-28T20:32:57ZUser contributionsMediaWiki 1.31.12https://www.thinkwiki.org/w/index.php?title=Tp_smapi&diff=51147Tp smapi2011-03-16T02:02:49Z<p>Ywarnier: /* Model-specific status - Added W500 */</p>
<hr />
<div>{| width="100%"<br />
|style="vertical-align:top;padding-right:20px;width:10px;white-space:nowrap;" | __TOC__<br />
|style="vertical-align:top" |<br />
The <tt>tp_smapi</tt> kernel module exposes some features of the ThinkPad hardware/firmware via a <tt>sysfs</tt> interface. Currently, the main implemented functionality is control of battery charging and extended battery status. The tp_smapi software package also includes an improved version of the [[HDAPS]] driver. The underlying hardware interfaces are [[SMAPI support for Linux|SMAPI]] and direct access to the embedded controller.<br />
<br />
This driver uses undocumented features and direct hardware access, so it may work unreliably or even damage your hardware; but so far no such damage has been reported.<br />
|}<br />
<br />
===Features===<br />
*<tt>tp_smapi</tt> driver<br />
**Battery charge/discharge control<br />
**Battery status information<br />
*<tt>hdaps</tt> driver (compared with the standard <tt>hdaps</tt> driver)<br />
**Improved stability<br />
**Improved model support<br />
**Improved functionality<br />
<br />
===Project Homepage / Availability===<br />
* Project page: http://tpctl.sourceforge.net/<br />
* Download page: http://sourceforge.net/projects/tpctl/files/tp_smapi<br />
* You need to download only the <i>tp_smapi</i> package.<br />
<br />
===Installation===<br />
====Installation from source====<br />
You will need the kernel headers and makefiles corresponding to your current kernel version. On {{Fedora}}, this means {{cmdroot|yum install kernel-devel-$(uname -r)}} .<br />
<br />
:{{cmdroot|tar xzvf tp_smapi-0.40.tgz}}<br />
:{{cmdroot|cd tp_smapi-0.40}}<br />
<br />
Then, either compile and load the driver within the current working directory (for testing):<br />
:{{cmdroot|make load}}<br />
OR compile and install into the kernel's module path:<br />
:{{cmdroot|make install}}<br />
<br />
If you use the [[HDAPS]] driver, add <tt>HDAPS=1</tt> to also patch the <tt>hdaps</tt> for compatibility with <tt>tp_smapi</tt> (this requires a kernel source tree matching the current kernel).<br />
Again, either load the driver within the current working directory:<br />
:{{cmdroot|1=make load HDAPS=1}}<br />
OR install into the kernel's module path:<br />
:{{cmdroot|1=make install HDAPS=1}}<br />
<br />
To prepare a stand-alone patch against the current kernel tree (including<br />
a patch against <tt>hdaps</tt> and new <tt>Kconfig</tt> entries):<br />
:{{cmdroot|make patch}}<br />
<br />
To delete all autogenerated files:<br />
:{{cmdroot|make clean}}<br />
<br />
The original kernel tree is never modified by any these commands. <br />
The {{path|/lib/modules}} directory is modified only by {{cmdroot|make install}}.<br />
<br />
====Installation in Gentoo====<br />
The {{Gentoo}} portage system carries a [http://packages.gentoo.org/package/app-laptop/tp_smapi tp_smapi package], which follows the latest version pretty closely. On a Gentoo system, you can install and load as follows.<br />
<br />
If you use the [[HDAPS]] driver, do this first:<br />
<br />
* Disable the <tt>hdaps</tt> module in your kernel configuration (Device Drivers &rarr; Hardware Monitoring Support &rarr; IBM Hard Drive Active Protection System)<br />
* Rebuild and install the kernel<br />
* Add the <tt>hdaps</tt> use flag in {{path|/etc/make.conf}}<br />
* {{cmdroot|rmmod hdaps}}<br />
<br />
Then:<br />
* {{cmdroot|emerge tp_smapi}} (or install tp_smapi with hdaps support manually, as above)<br />
* {{cmdroot|echo "tp_smapi" >> /etc/modules.autoload.d/kernel-2.6}}<br />
* {{cmdroot|echo "hdaps" >> /etc/modules.autoload.d/kernel-2.6}}<br />
<br />
Then reboot, or run:<br />
* {{cmdroot|modprobe tp_smapi}}<br />
* {{cmdroot|modprobe hdaps}}<br />
<br />
'''NOTE:''' If {{cmdroot|modprobe}} fails and dmesg says something about <tt>__stack_chk_fail()</tt>, you probably just compiled your modules with <tt>-fstack-protector</tt> and/or <tt>-fstack-protector-all</tt> without having a kernel that supports it. You can either configure your kernel to have <tt>CC_STACKPROTECTOR</tt> enabled (in ''Processor type and features'' if you use {{cmdroot|make menuconfig}}) or edit your <tt>make.conf</tt> (or, if you're using paludis, your <tt>/etc/paludis/bashrc</tt>) and remove <tt>-fstack-protector</tt> and <tt>-fstack-protector-all</tt> from your <tt>CFLAGS</tt>. If you choose to enable it in the kernel, be aware that you need a patched GCC for it (and I do not know if the gcc in stage3 is patched).<br />
<br />
====Installation on Debian unstable (sid), testing (squeeze) or stable (lenny)====<br />
Debian now contains the [http://packages.debian.org/tp-smapi packaged module source] and prebuilt modules for Debian kernels.<br />
<br />
If you use a stock Debian kernel, you can install the tp_smapi modules with:<br />
* {{cmdroot|apt-get install tp-smapi-modules-`uname -r`}}<br />
* in order to make sure the modules package is kept in sync with the kernel one, you may also want to install the <code>tm-smapi-modules-2.6-686</code> or <code>tm-smapi-modules-2.6-amd64</code> package, depending on your architecture <br />
<br />
If you use a custom kernel, you can build tp_smapi with module-assistant:<br />
* {{cmdroot|aptitude install tp-smapi-source}}<br />
* {{cmdroot|m-a -t a-i tp-smapi}}<br />
<br />
====Installation on Debian unstable (sid) or testing (squeeze) (kernel >=2.6.32-5)====<br />
You can use 'dkms' on Debian unstable (sid) or testing (squeeze) (kernel >=2.6.32-5) (Note: If installation seems ineffective, confirm your have the linux-headers of your kernel installed, purge tp-smapi-dkms and reinstall.)<br />
* {{cmdroot|aptitude install tp-smapi-dkms}}<br />
<br />
====Installation on openSUSE====<br />
openSUSE provides rpm packages. Look for them at the package search: [http://software.opensuse.org/search/], search for the package named "tp_smapi".<br />
<br />
A step-by-step guide on how a relative linux newbie installed tp_smapi on a Thinkpad W500 running openSuse 11.1 using YAST Software Manager is available [http://forums.opensuse.org/hardware/laptop/417254-tp_smapi-lenovo-thinkpad-t400-t500-w500-step-step.html#post2005932 here]<br />
<br />
In case you are taking the hard way around, while compiling on 11.0, make complained about not being able to locate the kernel sources. It worked for me after I did this:<br />
<pre><nowiki>cp /usr/include/linux/aio_abi.h /lib/modules/`uname -r`/build/include/linux/</nowiki></pre><br />
<br />
====Installation on Ubuntu====<br />
Ubuntu ships tp_smapi in their <tt>linux-ubuntu-modules-*</tt> package for Hardy, so you don't have to build it yourself. Please note that they have renamed tp_smapi's modified <tt>hdaps</tt> module to <tt>hdaps_ec</tt> so that the two can coexist. You should load <tt>hdaps_ec</tt>, not <tt>hdaps</tt>.<br />
<br />
Ubuntu Intrepid and Jaunty, however, lack the <tt>hdaps_ec</tt> module, as reported [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/297213 here]. It will not be included again until said [[#Bundled hdaps driver|bundled hdaps driver]] is merged into mainline.<br />
<br />
=====Installation on Ubuntu Jaunty=====<br />
I have posted my experiences [http://meandmyubuntu.blogspot.com/2009/05/getting-hdasp-to-work-on-jaunty.html here]<br />
<br />
=====Installation on Ubuntu Karmic=====<br />
Ubuntu does not ship the precompiled module tp_smapi any more. However the source code is still present in the repository. It can be installed through module-assistant :<br />
:{{cmdroot|aptitude install tp-smapi-source}}<br />
:{{cmdroot|module-assistant prepare tp-smapi}}<br />
:{{cmdroot|module-assistant auto-install tp-smapi}}<br />
:{{cmdroot|modprobe tp-smapi}}<br />
<br />
=====Installation on Ubuntu Lucid=====<br />
The Karmic solution above works well.<br />
<br />
As an alternative, one can use the dkms flavour of the packages via<br />
:{{cmdroot|aptitude install tp-smapi-dkms}}<br />
:{{cmdroot|modprobe tp_smapi}}<br />
<br />
{{HINT|This appears to be the ideal solution. A description of DKMS, from [http://linux.dell.com/projects.shtml#dkms Dell]: "DKMS stands for Dynamic Kernel Module Support. It is designed to create a framework where kernel dependent module source can reside so that it is very easy to rebuild modules as you upgrade kernels."}}<br />
<br />
====Installation on older Ubuntu/Debian====<br />
Installation on Ubuntu or Debian is quite easy, but there are a few things to look after:<br />
<br />
To get your system ready for compiling code, install the build-essentials (as root, of course, as all of the following comands; Ubuntu users have to prepend 'sudo' to every line and enter their own password when prompted):<br />
<pre><nowiki>apt-get install build-essential</nowiki></pre><br />
<br />
To get tp_smapi to work, obtain the latest source as mentioned above and unpack it. If you want to use HDAPS, you need to install the kernel source matching te kernel you are running. To do so, issue this:<br />
<pre><nowiki>uname -r</nowiki></pre><br />
This will give you the version of your current kernel. <br />
Debian users execute the following:<br />
<pre><nowiki>apt-get install linux-source-`uname -r`</nowiki></pre><br />
Ubuntu users execute the following using the kernel-version only (exclude -XX-generic; e.g. 'linux-source-2.6.20'):<br />
<pre><nowiki>apt-get install linux-source-`uname -r`</nowiki></pre><br />
<br />
Be sure to unpack the source file. The easiest way is to open Nautilus as root:<br />
<pre><nowiki>sudo nautilus</nowiki></pre><br />
Then browse to /usr/src/ and extract the source file to that directory.<br />
<br />
Now change to the tp_smapi dir:<br />
<pre><nowiki>cd tp_smapi-X.YY</nowiki></pre> (X.YY being the version-number of [[tp_smapi]])<br />
and make and install tp_smapi as instructed above.<br />
<br />
If you get an error that the kernel version isn't matching (or that you need to set KSRC/KBUILD), please check that there is a symlink from the modules dir to the kernel source:<br />
<pre><nowiki>root@localhost:~#ls -l /lib/modules/2.6.20-16-generic<br />
lrwxrwxrwx 1 root root 28 2007-02-02 08:39 build -> /usr/src/linux-source-2.6.20</nowiki></pre><br />
Create the link if the line above does not exist:<br />
<pre><nowiki>root@localhost:~#ln -s /usr/src/linux-source-2.6.20 /lib/modules/2.6.20-16-generic/build</nowiki></pre><br />
<br />
Now the following will build and install the correct modules to their locations:<br />
<pre><nowiki>make install HDAPS=1</nowiki></pre><br />
To make sure your system loads the modules at boot time, do this:<br />
<pre><nowiki>echo "tp_smapi" >> /etc/modules<br />
echo "hdaps" >> /etc/modules</nowiki></pre><br />
and update your initramfs:<br />
<pre><nowiki>update-initramfs -u</nowiki></pre><br />
<br />
To get tp_smapi running now, just load the modules:<br />
<pre><nowiki>modprobe -a tp_smapi hdaps</nowiki></pre><br />
<br />
This description was tested on Kubuntu 'Feisty Fawn' and should work on all Debian-based distros with minor tweaks.<br />
<br />
'''EDIT:''' Works on Kubuntu 7.10 ("Gutsy Gibbon"), too<br />
<br />
===Battery charge control features===<br />
{{NOTE|Not all Thinkpad ECs support these charge control features. If you get the message "Operation not supported" when trying to cat for the status of a given parameter, it means your controller does not support that feature.}}<br />
<br />
To set the thresholds for starting and stopping battery charging (in percent of current full charge capacity):<br />
:{{cmdroot|echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh}}<br />
:{{cmdroot|echo 70 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh}}<br />
:{{cmdroot|cat /sys/devices/platform/smapi/BAT0/*_charge_thresh}}<br />
{{HINT|Battery charging thresholds can be used to keep Li-Ion and Li-Polymer batteries partially charged, in order to [[Maintenance#Battery_treatment|increase their lifetime]].}}<br />
To prevent charging for 17 minutes (regardless of thresholds):<br />
:{{cmdroot|echo 17 > /sys/devices/platform/smapi/BAT0/inhibit_charge_minutes}}<br />
{{HINT|Charge inhibiting can be used to reduce the power draw of the laptop, in order to use an under-spec power supply that can't handle the combined power draw of running and charging. It can also be used to control which battery is charged when [[How to use UltraBay batteries|using an Ultrabay battery]].}}<br />
<br />
To cancel charging preventation:<br />
:{{cmdroot|echo 0 > /sys/devices/platform/smapi/BAT0/inhibit_charge_minutes}}<br />
<br />
To force battery discharging (even if connected to AC):<br />
:{{cmdroot|echo 1 > /sys/devices/platform/smapi/BAT0/force_discharge}}<br />
{{HINT|This can be used to choose which battery is discharged when [[How to use UltraBay batteries|using an UltraBay battery]]. For example, see the {{CodeRef|tp-bat-balance}} script.}}<br />
<br />
To cancel forced discharge:<br />
:{{cmdroot|echo 0 > /sys/devices/platform/smapi/BAT0/force_discharge}}<br />
<br />
{{HINT|TPBattStat-Applet is a gnome applet for integrating battery balancing with a graphics and/or text display of both batteries in a panel. Battery balancing improves battery life by not leaving one battery empty while the other discharges. For the latest alpha release, see https://github.com/teleshoes/tpbattstat-applet}}<br />
<br />
====Making the settings permanent on reboot====<br />
<br />
If you always use the same type of battery, then you may want the same settings to be configured each time you boot the machine.<br />
<br />
If you use various types of battery, then you may want to consider writing some scripts to detect the battery type and apply the appropriate settings.<br />
<br />
=====Debian=====<br />
<br />
It is not necessary to create your own init.d script or modify /etc/rc.local - you just need the package sysfsutils:<br />
:{{cmdroot|apt-get install sysfsutils}}<br />
<br />
Now, put your desired settings in /etc/sysfs.conf:<br />
<br />
<pre><nowiki># cat >> /etc/sysfs.conf << EOF<br />
# For a LiIon battery in a Thinkpad<br />
devices/platform/smapi/BAT0/start_charge_thresh = 50<br />
devices/platform/smapi/BAT0/stop_charge_thresh = 80<br />
EOF</nowiki></pre><br />
<br />
The init script supplied by sysfsutils will load these settings on each boot.<br />
<br />
===Battery status features===<br />
To view extended battery status such as charging state, voltage, current, capacity, cycle count and model information:<br />
<br />
<pre><br />
# cat /sys/devices/platform/smapi/BAT0/installed<br />
# cat /sys/devices/platform/smapi/BAT0/state # idle/charging/discharging<br />
# cat /sys/devices/platform/smapi/BAT0/cycle_count<br />
# cat /sys/devices/platform/smapi/BAT0/current_now # instantaneous current<br />
# cat /sys/devices/platform/smapi/BAT0/current_avg # last minute average<br />
# cat /sys/devices/platform/smapi/BAT0/power_now # instantaneous power<br />
# cat /sys/devices/platform/smapi/BAT0/power_avg # last minute average<br />
# cat /sys/devices/platform/smapi/BAT0/last_full_capacity<br />
# cat /sys/devices/platform/smapi/BAT0/remaining_percent<br />
# cat /sys/devices/platform/smapi/BAT0/remaining_running_time<br />
# cat /sys/devices/platform/smapi/BAT0/remaining_charging_time<br />
# cat /sys/devices/platform/smapi/BAT0/remaining_capacity<br />
# cat /sys/devices/platform/smapi/BAT0/design_capacity<br />
# cat /sys/devices/platform/smapi/BAT0/voltage<br />
# cat /sys/devices/platform/smapi/BAT0/design_voltage<br />
# cat /sys/devices/platform/smapi/BAT0/manufacturer<br />
# cat /sys/devices/platform/smapi/BAT0/model<br />
# cat /sys/devices/platform/smapi/BAT0/barcoding<br />
# cat /sys/devices/platform/smapi/BAT0/chemistry<br />
# cat /sys/devices/platform/smapi/BAT0/serial<br />
# cat /sys/devices/platform/smapi/BAT0/manufacture_date<br />
# cat /sys/devices/platform/smapi/BAT0/first_use_date<br />
# cat /sys/devices/platform/smapi/BAT0/temperature # in milli-Celsius<br />
# cat /sys/devices/platform/smapi/ac_connected<br />
</pre><br />
<br />
The raw status data is also available, including some fields not listed above (in case you can figure them out):<br />
<br />
:{{cmdroot|cat /sys/devices/platform/smapi/BAT0/dump}}<br />
<br />
In all of the above, replace <tt>BAT0</tt> with <tt>BAT1</tt> to address the 2nd battery.<br />
<br />
Note that the battery status readout conflicts with the stock [[HDAPS|hdaps]] driver, so if you use <tt>hdaps</tt> you will need to load <tt>tp_smapi</tt> using {{cmdroot|1=make load HDAPS=1}} (see [[#Bundled hdaps driver|Bundled hdaps driver]] below).<br />
<br />
On [[ACPI]]-enabled systems, most of above information is also available through the files under {{path|/proc/acpi/battery}}. However, the ACPI interface does not include the instantaneous power and cycle count readouts, and does not work well when [[How to use UltraBay batteries|hotswapping UltraBay batteries]].<br />
<br />
====Scripts====<br />
Some scripts can make it easier to grep the information you need from tp_smapi<br />
* [[battery.rb]]<br />
<br />
===Other features===<br />
<br />
There is also [[sysfs]] attribute for making direct SMAPI requests to the SM BIOS firmware. Don't touch it unless you really know what you're doing. Example:<br />
# echo '211a 100 0 0' > /sys/devices/platform/smapi/smapi_request; cat /sys/devices/platform/smapi/smapi_request<br />
211a 34b b2 0 0 0 'OK'<br />
The "4b" in the 2nd value, converted to decimal, is 75: the current charging stop threshold (stop_charge_thresh).<br />
<br />
===Bundled <tt>hdaps</tt> driver===<br />
<br />
The tp_smapi package includes a modified version of the <tt>hdaps</tt> Linux kernel driver used by the [[HDAPS]] system. It has remained outside the mainline kernel for a few years for several reasons, [https://lists.ubuntu.com/archives/kernel-team/2009-April/005565.html] including the upstream maintainer's assertion that the new code's anonymous author was under a NDA. (Although this would not normally expose the kernel team to litigation.) [http://lkml.org/lkml/2008/9/15/126] [http://lkml.org/lkml/2008/10/7/403] [http://lkml.org/lkml/2008/10/7/428]<br />
<br />
To use <tt>tp_smapi</tt> and <tt>hdaps</tt> concurrently, you '''must''' use the modified version.<br />
<br />
To build the modified version, simply append the <tt>HDAPS=1</tt> parameter to the <tt>make</tt> command (see [[#Installation|Installation]] above):<br />
:{{cmdroot|1=make load HDAPS=1}}<br />
or<br />
:{{cmdroot|1=make install HDAPS=1}}<br />
<br />
If you don't do that, you will not be able to load <tt>tp_smapi</tt> (and its support module <tt>thinkpad_ec</tt>) when <tt>hdaps</tt> is loaded, and vice versa. You can use <tt>rmmod</tt> to switch between these modules.<br />
<br />
Note that some of the battery status is also visible through ACPI ({{path|/proc/acpi/battery/*}}), independently of <tt>tp_smapi</tt>.<br />
<br />
The modified <tt>hdaps</tt> has several changes:<br />
* The <tt>hdaps</tt> driver in mainline kernels conflicts with the extended battery status (they use the same IO ports). The modified <tt>hdaps</tt> coordinates this access through the bundled <tt>thinkpad_ec</tt> driver.<br />
* The modified <tt>hdaps</tt> driver fixes reliability and improves support for recent ThinkPad models (*60 and newer), since unlike the mainline driver, it correctly follows the Embedded Controller communication protocol.<br />
* Several other improvements, such as the ability to control the polling rate.<br />
<br />
===Troubleshooting===<br />
==== <tt>thinkpad_ec: cannot claim io ports 0x1600-0x161f</tt> ====<br />
The "<tt>thinkpad_ec: cannot claim io ports 0x1600-0x161f!</tt>" error message is printed when loading the <tt>thinkpad_ec</tt> module on some recent ThinkPad models. This occurs because the ACPI BIOS DSDT is reserving ports used by tp_smapi.<br />
<br />
As a workaround, add the <tt>force_io=1</tt> module parameter to <tt>thinkpad_ec</tt> in {{path|/etc/modprobe.conf}} (or your distribution's equivalent). Add the line:<br />
: options thinkpad_ec force_io=1<br />
<br />
For transient testing, load the modules as follows:<br />
<br />
: {{cmdroot|1=make load HDAPS=1 FORCE_IO=1}}<br />
<br />
Note: force_io option was added in tp_smapi v0.40 (released 2008-12-16).<br />
<br />
Models which need this option include:<br />
* ThinkPad {{T400}}<br />
* ThinkPad {{T500}}<br />
* ThinkPad {{X60s}}<br />
* ThinkPad {{X301}}<br />
<br />
More information:<br />
* http://bugzilla.kernel.org/show_bug.cgi?id=12221<br />
* http://www.nabble.com/thinkpad_ec-fails-to-load-on-Thinkpad-T500-td19932985.html<br />
<br />
==== <tt>thinkpad_ec: no ThinkPad embedded controller!</tt> ====<br />
If you get "<tt>thinkpad_ec: no ThinkPad embedded controller!</tt>" when trying to load the module on a supported model listed below, you should [[BIOS_Upgrade|upgrade your BIOS]]. Some early BIOS (like 1.x on the X31) don't handle the embedded controller.<br />
<br />
==== <tt>T60p writing to start_charge_thresh/stop_charge_thresh does not work!</tt> ====<br />
Writing to /sys/devices/platform/smapi/BAT0/start_charge_thresh succeeds, but the older value does not change. Solution: unknown. If you know a solution please update here.<br />
<br />
UPDATE: Failure to effectively change sysfs values sometimes happens at boot time (through sysfs.conf OR etc/local.start for instance) when the values have never previously been changed manually (ie using echo from a shell). Try initializing the values manually before including them in boot-time scripting.<br />
<br />
===Model-specific status===<br />
<br />
<br />
<div style="font-size: 92%"><br />
{| border="1" cellspacing="0" cellpadding="2"<br />
|+<tt>tp_smapi</tt> feature support matrix<br />
|-<br />
! colspan=12 style="text-align:center;background:#efefef;" | <br />
=====A series=====<br />
|-<br />
{{tp_smapi/model_status_table_header}}<br />
|-<br />
! {{A22p}} 2629-USG<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || N/A || N/A || || || ||<br />
|-<br />
! {{A30}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || N/A || N/A || || || ||<br />
|-<br />
! colspan=12 style="text-align:center;background:#efefef;" |<br />
=====G series=====<br />
|-<br />
{{tp_smapi/model_status_table_header}}<br />
|-<br />
! {{G41}}<br />
| {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || N/A || N/A || || || ||<br />
|-<br />
! colspan=12 style="text-align:center;background:#efefef;" |<br />
<br />
=====R series=====<br />
|-<br />
{{tp_smapi/model_status_table_header}}<br />
|-<br />
! {{R31}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || N/A || N/A || || || || No SMAPI BIOS<br />
|-<br />
! {{R40}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || N/A || N/A || || || ||<br />
|-<br />
! {{R50}}<br />
| {{Cunk}} || {{Cno}} || {{Cunk}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || || || ||<br />
|-<br />
! {{R50e}} 1834-JAG<br />
| {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || N/A || N/A || || || ||<br />
|-<br />
! {{R50e}} 1834-5US<br />
| {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || N/A || N/A || || || ||<br />
|-<br />
! {{R50p}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || || || ||<br />
|-<br />
! {{R51}} 18*<br />
| {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} 0 || 0.32 || 3.22 || || Machine types 1829, 1830, 1831 and 1836<br />
|-<br />
! {{R51}} 28*<br />
| {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || || 1.29 || || Machine types 2883, 2887, 2888, 2889, 2894 and 2495<br />
|-<br />
! {{R52}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} 0 || 0.33 || 1.29 || 1.06 ||<br />
|-<br />
! {{R60}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} ||{{Cyes}} || {{Cno|text=}} 1 || 0.33 || || ||<br />
|-<br />
! {{R61}}<br />
| {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || {{Cyes}} ||{{Cyes}} || {{Cyes|text=}} 1 || 0.35-test1 || 7KETA7WW 2.07 || 7KHT24WW 1.08 || Machine type 8918<br />
|-<br />
! {{R61i}}<br />
| {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || {{Cyes}} ||{{Cunk}} || {{Cunk}} || || || || Machine type 8250<br />
|-<br />
! {{R400}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} ||{{Cyes}} || {{Cyes|text=}} 1 || 0.40-1 || || || Machine type 7443<br />
|-<br />
! {{R500}}<br />
| {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || {{Cyes}} ||{{Cunk}} || {{Cyes|text=}} 1 || 0.40-1 || || ||<br />
|-<br />
! colspan=12 style="text-align:center;background:#efefef;" |<br />
<br />
=====T series=====<br />
|-<br />
{{tp_smapi/model_status_table_header}}<br />
|-<br />
! {{T20}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || N/A || N/A || || || || Has SMAPI BIOS but no function is supported. EC LPC3 protocol fails.<br />
|-<br />
! {{T22}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || N/A || N/A || || || || Has SMAPI BIOS but no function is supported. EC LPC3 protocol fails.<br />
|-<br />
! {{T23}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || N/A || N/A || || || ||<br />
|-<br />
! {{T30}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || N/A || N/A || || || ||<br />
|-<br />
! {{T40}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || N/A || N/A || || || ||<br />
|-<br />
! {{T40}} 2373-72U<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || N/A || N/A || 0.40 || 3.23 || 1RHT71WW-3.04 ||<br />
|-<br />
! {{T40p}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || N/A || N/A || || || ||<br />
|-<br />
! {{T41}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || 0.37 || 3.23 || 3.04 ||<br />
|-<br />
! {{T41}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || 0.40 || 3.20 || 3.04 ||<br />
|-<br />
! {{T41}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || 0.40 || 3.23 || 3.04 ||<br />
|-<br />
! {{T41p}} 2373-AM9<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} 1 || 0.32 || 3.20 || v3.04 ||<br />
|-<br />
! {{T42}}<br />
| {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || || || ||<br />
|-<br />
! {{T42p}} 2373-KXU<br />
| {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} 1 || 0.32 || 3.21 || || Stop charge threshold works in Windows, but dmesg says "__get_real_thresh: cannot get stop_thresh of bat=0: Function is not supported by SMAPI BIOS".<br />
|-<br />
! {{T42p}} 2373-KUU<br />
| {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || || || ||<br />
|-<br />
! {{T43}} 2686<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} 0 || 0.33 || 1.27 || ||<br />
|-<br />
! {{T43p}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cyes|text=}} 0 || || || ||<br />
|-<br />
! {{T60}}<br />
| {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 7 || 0.32 || || ||<br />
|-<br />
! {{T60}}<br />
| {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 1 || 0.34 || || ||<br />
|-<br />
! {{T60}} 1951-24G<br />
| {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || 0.36 || 1.09a || ||<br />
|-<br />
! {{T60}} 2007-FSG<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || 0.39 || 1.10 || 1.05b ||<br />
|-<br />
! {{T60}} 1951-CZ1<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} 1 || 0.40 || 2.23 || 1.07 ||<br />
|-<br />
! {{T60p}} 8743-CTO<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} 1 || 0.32 || || ||<br />
|-<br />
! {{T61}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 1 || 0.32 || || || [http://ubuntuforums.org/showthread.php?p=3146719 ref]<br />
|-<br />
! {{T61p}} 6457-7XG<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 1 || 0.32 || || || [http://ubuntuforums.org/showthread.php?p=3146719 ref]<br />
|-<br />
! {{T400}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} 1 || 0.40 || 1.19 || || Requires <tt>force_io=1</tt> parameter to <tt>thinkpad_ec</tt><br />
|-<br />
! {{T400s}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} 2 || 0.40 || 1.06 || || Requires <tt>invert=2</tt> paramteter to <tt>hdaps</tt><br />
|-<br />
! {{T410s}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} 4 || 0.40 || 1.14 || || Requires <tt>invert=4</tt> accoding to <tt>hdaps-gl</tt><br />
|-<br />
! {{T410}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} 1 || 0.40 || 1.25 || ||<br />
|-<br />
! {{T500}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} 1 || 0.40 || 2.07 || || Requires <tt>force_io=1</tt> parameter to <tt>thinkpad_ec</tt><br />
|-<br />
! {{T510}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 7 || 0.40 || 1.12 || 1.08 || ||<br />
|-<br />
! {{T510}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 7 || 0.40 || 1.35 || 1.17 || ||<br />
|-<br />
! colspan=12 style="text-align:center;background:#efefef;" |<br />
<br />
=====W series=====<br />
|-<br />
{{tp_smapi/model_status_table_header}}<br />
|-<br />
! {{W700}} 2757-CTO<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || 0.40 || 2.08 || 1.05 ||<br />
|-<br />
! {{W500}} 4062-4EG<br />
| {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cunk}} || 0.40 || {{Cunk}} || {{Cunk}} ||<br />
|-<br />
<br />
! colspan=12 style="text-align:center;background:#efefef;" |<br />
<br />
=====X series=====<br />
|-<br />
{{tp_smapi/model_status_table_header}}<br />
|-<br />
! {{X22}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || N/A || N/A || || || || no EC controller found<br />
|-<br />
! {{X24}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || {{Cyes}} || N/A || N/A || || || ||<br />
|-<br />
! {{X30}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || N/A || N/A || 0.34 || 1.09 || ||<br />
|-<br />
! {{X31}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || N/A || N/A || 0.40 || 3.02 || ||<br />
|-<br />
! {{X32}}<br />
| {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || N/A || N/A || || || ||<br />
|-<br />
! {{X40}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 3 || 0.32 || 2.08 || 1.62 || <br />
|-<br />
! {{X41}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 3 || 0.32 || || ||<br />
|-<br />
! {{X41_Tablet}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 3 || 0.40 || 75ET60WW (2.06 ) || 75HT20WW (1.02) ||<br />
|-<br />
! {{X60}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 6 || || 2.07 || 1.10 || 2.6.20 issue (see discussion)<br />
|-<br />
! {{X60_Tablet}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 3 || 0.34 || 7JET25WW (1.10 ) || 7JHT13WW 1.04 || [http://luke.no-ip.org/x60tablet/ ref] [http://rad.bioinfo.ulaval.ca/hardware/x60tablet ref]<br />
|-<br />
! {{X60s}} 1704-5UG<br />
| {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cno|text=}} 3 || 0.34 || 7BETD2WW 2.13 || 7BHT40WW 1.13 ||<br />
|-<br />
! {{X60s}} 1704-56G<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || {{Cno|text=}} 3 || 0.40 || 7BETD5WW 2.16 || 7BHT40WW 1.13 ||<br />
|-<br />
! {{X61}} 7673-CTO<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || 0.37 || 7NETB9WW (2.19) || {{Cunk}} ||<br />
|-<br />
! {{X61}} 7675-CTO<br />
| {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cyes}} || {{Cno|text=}} 6 || 0.35-test1 || || ||<br />
|-<br />
! {{X61}} 7675-4KU<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 6 || 0.34 || 7NET30WW (1.11 ) || 7MHT24WW 1.02 ||<br />
|-<br />
! {{X61_Tablet}}<br />
| {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 6 || 0.32 || || ||<br />
|-<br />
! {{X61s}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 6 / 3 || 0.32 || || || [http://www.slackwiki.org/ThinkPad_X61s ref] says 3 but conflicting report received<br />
|-<br />
! {{X100e}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || 0.40 || 6XET36WW (1.20a) || 6XHT36WW (1.176000) || x100e NTS4UTX, dual-core L625 also works (NTT27MH)<br />
|-<br />
! {{X200}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 7 || 0.40 || 6DET40WW (2.04 ) || 7XHT22WW 1.04 ||<br />
|-<br />
! {{X200s}} 7470-X01<br />
| {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 5 || 0.40 || 6DET63WW (3.13) || 7XHT24WW 1.06 ||<br />
|-<br />
! {{X201}}<br />
| {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 6 || 0.40 || || ECP: ||<br />
|-<br />
! {{X201s}}<br />
| {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} 5 || 0.40 || 6QET44WW (1.14 ) || ECP: 1.09/1.09 ||<br />
|-<br />
! {{X300}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || 0.37 || 7TET25WW (1.02 ) || 7THT15WW 1.00c ||<br />
|-<br />
! colspan=12 style="text-align:center;background:#efefef;" |<br />
<br />
=====Z series=====<br />
|-<br />
{{tp_smapi/model_status_table_header}}<br />
|-<br />
! {{Z60m}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || || || ||<br />
|-<br />
! {{Z60t}}<br />
| {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || || || ||<br />
|-<br />
! {{Z61m}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} 0 || 0.32 || || ||<br />
|-<br />
! {{Z61t}}<br />
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || || || || [https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/45014 ref]<br />
|-<br />
! {{Z61p}}<br />
| {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || || || ||<br />
|-<br />
! colspan=12 style="text-align:center;background:#efefef;" |<br />
<br />
=====SL series and IdeaPad=====<br />
|-<br />
! colspan=12 style="text-align:left" |<br />
The ThinkPad SL series and IdeaPad series have firmware that is completely different from other ThinkPad models. Neither [[tp_smapi]] nor [[thinkpad-acpi]] support these models.<br />
|}<br />
</div><br />
<br />
<br />
SMAPI capabilities may depend on the BIOS version as well, so upgrading to the latest version of the BIOS might provide more SMAPI functions (especially true for long-lived BIOS with lots of releases, like the TP-1R).<br />
<br />
Please update the above and report your experience on the [[Talk:tp_smapi|discussion]] page. If the module loads but gives a "<tt>not supported</tt>" or "<tt>not implementeded</tt>" error when you try to use some specific file in {{path|/sys/devices/platform/smapi/}}, please report the <tt>dmesg</tt> output and whether the corresponding functionality is available under Windows - maybe your ThinkPad just can't do that. <br />
<br />
While at it, you may also want to add your laptop to the [[list of DMI IDs]].<br />
<br />
=====HDAPS axis orientation=====<br />
<sup>1</sup> The HDAPS axis orientation is set using the <tt>invert</tt> module parameter (at load time) or sysfs attribute (at runtime). The <tt>hdaps</tt> driver of tp_smapi supports all 8 possible sensor orientations (inversion and swapping). You can use [[HDAPS#Visualisation_of_ThinkPad_orientation|hdaps visualisation]] to check if the settings is correct.<br />
<br />
The <tt>invert</tt> parameter is an integer between 0 and 7, whose meaning is defined below. (This is confusing. Most people will find it easier to just try all 8 possibilities.)<br />
<br />
Let <tt>X</tt> and <tt>Y</tt> denote the hardware readouts. Let <tt>R</tt> denote the laptop's roll (tilt left/right), and let <tt>P</tt> denote the laptop's pitch (tilt forward/backward). The possible values are as follows:<br />
invert=0: R= X P= Y (same as mainline)<br />
invert=1: R=-X P=-Y (same as mainline)<br />
invert=2: R=-X P= Y (new)<br />
invert=3: R= X P=-Y (new)<br />
invert=4: R= Y P= X (new)<br />
invert=5: R=-Y P=-X (new)<br />
invert=6: R=-Y P= X (new)<br />
invert=7: R= Y P=-X (new)<br />
<br />
[[Category:Drivers]] [[Category:Patches]]<br />
<br />
===Tools using this driver===<br />
<br />
The driver's interface can be accessed directly through the files under {{path|/sys/devices/platform/smapi}}, or via the following tools:<br />
* [[KThinkBat]] - display battery status on the KDE <tt>kicker</tt> panel.<br />
* [[gkrellm-ThinkBat]] - battery status plugin for Gkrellm2<br />
* {{CodeRef|thinkpad-smapi.sh}} - script to display various SMAPI information using tp_smapi module.<br />
<br />
== Headline text ==</div>Ywarnier