Difference between revisions of "Tp smapi"
(→Model-specific status: Clean up recent axis orientation edits) |
(→Model-specific status: Add column for tp_smapi version, colorize hdaps orientation) |
||
Line 206: | Line 206: | ||
! HDAPS<br />([[#Bundled hdaps driver|bundled]]<br />version) | ! HDAPS<br />([[#Bundled hdaps driver|bundled]]<br />version) | ||
! HDAPS axis orientation<sup>[[tp_smapi#HDAPS_axis_orientation|1]]</sup> | ! HDAPS axis orientation<sup>[[tp_smapi#HDAPS_axis_orientation|1]]</sup> | ||
− | ! | + | ! tp_smapi version |
− | ! | + | ! BIOS ver |
+ | ! Notes | ||
|- | |- | ||
− | ! colspan= | + | ! colspan=11 style="text-align:center;background:#efefef;" | |
=====A series===== | =====A series===== | ||
|- | |- | ||
! {{A22p}} 2629-USG | ! {{A22p}} 2629-USG | ||
− | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || || || | + | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || || || || |
|- | |- | ||
! {{A30}} | ! {{A30}} | ||
− | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || || || | + | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || || || || |
|- | |- | ||
− | ! colspan= | + | ! colspan=11 style="text-align:center;background:#efefef;" | |
=====G series===== | =====G series===== | ||
|- | |- | ||
! {{G41}} | ! {{G41}} | ||
− | | {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || {{Cunk}} || || || | + | | {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || {{Cunk}} || || || || |
|- | |- | ||
− | ! colspan= | + | ! colspan=11 style="text-align:center;background:#efefef;" | |
=====R series===== | =====R series===== | ||
|- | |- | ||
! {{R31}} | ! {{R31}} | ||
− | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || || || No SMAPI BIOS | + | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || || || || No SMAPI BIOS |
|- | |- | ||
! {{R40}} | ! {{R40}} | ||
− | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || {{Cunk}} || || || | + | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || {{Cunk}} || || || || |
|- | |- | ||
! {{R50}} | ! {{R50}} | ||
− | | {{Cunk}} || {{Cno}} || {{Cunk}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || || || | + | | {{Cunk}} || {{Cno}} || {{Cunk}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || || || || |
|- | |- | ||
! {{R50e}} 1834-JAG | ! {{R50e}} 1834-JAG | ||
− | | {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || || || | + | | {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || || || || |
|- | |- | ||
! {{R50p}} | ! {{R50p}} | ||
− | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || || || | + | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || || || || |
|- | |- | ||
! {{R51}} 18* | ! {{R51}} 18* | ||
− | | {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || X'=X, Y'=Y | + | | {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} X'=X, Y'=Y || 0.32 || 3.22 || Machine types 1829, 1830, 1831 and 1836 |
|- | |- | ||
! {{R51}} 28* | ! {{R51}} 28* | ||
− | | {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || || 1.29 || Machine types 2883, 2887, 2888, 2889, 2894 and 2495 | + | | {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || || || 1.29 || Machine types 2883, 2887, 2888, 2889, 2894 and 2495 |
|- | |- | ||
! {{R52}} | ! {{R52}} | ||
− | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || X'=X, Y'=Y | + | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} X'=X, Y'=Y || 0.32 || 1.29 || |
|- | |- | ||
! {{R60}} | ! {{R60}} | ||
− | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} ||{{Cyes}} || || || | + | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} ||{{Cyes}} || || || || |
|- | |- | ||
− | ! colspan= | + | ! colspan=11 style="text-align:center;background:#efefef;" | |
=====T series===== | =====T series===== | ||
|- | |- | ||
! {{T20}} | ! {{T20}} | ||
− | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || || || Has SMAPI BIOS but no function is supported. EC LPC3 protocol fails. | + | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || || || || Has SMAPI BIOS but no function is supported. EC LPC3 protocol fails. |
|- | |- | ||
! {{T22}} | ! {{T22}} | ||
− | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || || || Has SMAPI BIOS but no function is supported. EC LPC3 protocol fails. | + | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || || || || Has SMAPI BIOS but no function is supported. EC LPC3 protocol fails. |
|- | |- | ||
! {{T23}} | ! {{T23}} | ||
− | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || || || | + | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || || || || |
|- | |- | ||
! {{T30}} | ! {{T30}} | ||
− | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || || || | + | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || || || || |
|- | |- | ||
! {{T40}} | ! {{T40}} | ||
− | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || || || | + | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || || || || |
|- | |- | ||
! {{T40p}} | ! {{T40p}} | ||
− | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || || || | + | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || || || || |
|- | |- | ||
! {{T41}} | ! {{T41}} | ||
− | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || || || | + | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || || || || |
|- | |- | ||
! {{T41p}} 2373-AM9 | ! {{T41p}} 2373-AM9 | ||
− | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cyes}} || | + | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} X'=-X, Y'=-Y || 0.32 || 3.20 || EC v3.04 |
|- | |- | ||
! {{T42}} | ! {{T42}} | ||
− | | {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || || || | + | | {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || || || || |
|- | |- | ||
! {{T42p}} 2373-KXU | ! {{T42p}} 2373-KXU | ||
− | | {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || | + | | {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} X'=-X, Y'=-Y || 0.32 || 3.21 || Stop charge threshold works in Windows. dmesg output: |
smapi smapi: smapi_request: SMAPI error: Function is not supported by SMAPI BIOS (func=211a) | smapi smapi: smapi_request: SMAPI error: Function is not supported by SMAPI BIOS (func=211a) | ||
smapi smapi: __get_real_thresh: cannot get stop_thresh of bat=0: Function is not supported by SMAPI BIOS | smapi smapi: __get_real_thresh: cannot get stop_thresh of bat=0: Function is not supported by SMAPI BIOS | ||
|- | |- | ||
! {{T42p}} 2373-KUU | ! {{T42p}} 2373-KUU | ||
− | | {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || || || | + | | {{Cyes}} || {{Cno}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || || || || |
|- | |- | ||
! {{T43}} 2686 | ! {{T43}} 2686 | ||
− | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || X'=X, Y'=Y | + | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} X'=X, Y'=Y || 0.32 || 1.27 || |
|- | |- | ||
! {{T43p}} | ! {{T43p}} | ||
− | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || || || | + | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || || || || |
|- | |- | ||
! {{T60}} | ! {{T60}} | ||
− | | {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || X'=Y, Y'=-X | + | | {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} X'=Y, Y'=-X || 0.32 || || |
|- | |- | ||
! {{T60p}} 8743-CTO | ! {{T60p}} 8743-CTO | ||
− | | {{Cunk}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || X'=-X, Y'=-Y | + | | {{Cunk}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} X'=-X, Y'=-Y || 0.32 || || |
|- | |- | ||
! {{T61}} | ! {{T61}} | ||
− | | {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cyes}} || || || [http://ubuntuforums.org/showthread.php?p=3146719 ref] | + | | {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cyes}} || || || || [http://ubuntuforums.org/showthread.php?p=3146719 ref] |
|- | |- | ||
− | ! colspan= | + | ! colspan=11 style="text-align:center;background:#efefef;" | |
=====X series===== | =====X series===== | ||
|- | |- | ||
! {{X20}} 2662-31G | ! {{X20}} 2662-31G | ||
− | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || || || | + | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || || || || |
|- | |- | ||
! {{X24}} | ! {{X24}} | ||
− | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || || || | + | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || || || || |
|- | |- | ||
! {{X31}} | ! {{X31}} | ||
− | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || || || | + | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || || || || |
|- | |- | ||
! {{X32}} | ! {{X32}} | ||
− | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || || || | + | | {{Cno}} || {{Cno}} || {{Cno}} || {{Cno}} || {{Cyes}} || {{Cunk}} || || || || |
|- | |- | ||
! {{X40}} | ! {{X40}} | ||
− | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || X'=X, Y'=-Y | + | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cno|text=}} X'=X, Y'=-Y || 0.32 || 2.08 || EC v1.62 |
|- | |- | ||
! {{X41}} | ! {{X41}} | ||
− | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || X'=X, Y'=-Y | + | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cno|text=}} X'=X, Y'=-Y || 0.32 || || |
|- | |- | ||
! {{X60}} | ! {{X60}} | ||
− | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || || 2.07 || EC v1.10, 2.6.20 issue (see discussion) | + | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || || || 2.07 || EC v1.10, 2.6.20 issue (see discussion) |
|- | |- | ||
! {{X60T}} | ! {{X60T}} | ||
− | | {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cyes}} || || || [http://luke.no-ip.org/x60tablet/ ref] [http://rad.bioinfo.ulaval.ca/hardware/x60tablet ref] | + | | {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cunk}} || {{Cyes}} || || || || [http://luke.no-ip.org/x60tablet/ ref] [http://rad.bioinfo.ulaval.ca/hardware/x60tablet ref] |
|- | |- | ||
− | ! colspan= | + | ! colspan=11 style="text-align:center;background:#efefef;" | |
=====Z series===== | =====Z series===== | ||
|- | |- | ||
! {{Z60m}} | ! {{Z60m}} | ||
− | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || || || | + | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || || || || |
|- | |- | ||
! {{Z60t}} | ! {{Z60t}} | ||
− | | {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || || || | + | | {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || || || || |
|- | |- | ||
! {{Z61m}} | ! {{Z61m}} | ||
− | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || X'=X, Y'=Y | + | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes|text=}} X'=X, Y'=Y || 0.32 || || |
|- | |- | ||
! {{Z61t}} | ! {{Z61t}} | ||
− | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || || || [https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/45014 ref] | + | | {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || || || || [https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/45014 ref] |
|} | |} | ||
</div> | </div> |
Revision as of 21:49, 17 August 2007
The tp_smapi kernel module exposes some features of the ThinkPad hardware/firmware via a sysfs interface. Currently, the main implemented functionality is control of battery charging and extended battery status. The underlying hardware interfaces are SMAPI and direct access to the embedded controller. For older ThinkPad models, see also tpctl. ATTENTION!
This driver uses undocumented features and direct hardware access. It thus cannot be guaranteed to work and could conceivably damage your computer (though so far no incidents have been reported).
|
Features
- Battery charge/discharge control
- Battery status information
Project Homepage / Availability
- Project page: http://tpctl.sourceforge.net/
- You need to download only the tp_smapi package.
Installation
Installation from source
You will need the kernel headers and makefiles corresponding to your current kernel version. On Fedora, this means # yum install kernel-devel-$(uname -r)
.
For testing, you can simply compile and load the driver within the current working directory:
# tar xzvf tp_smapi-0.32.tgz
# cd tp_smapi-0.32
# make load
To compile and install into the kernel's module path:
# make install
If you use the HDAPS driver, add HDAPS=1 to also patch the hdaps for compatibility with tp_smapi (this requires a kernel source tree matching the current kernel):
# make load HDAPS=1
or, to compile and install into the kernel's module path:
# make install HDAPS=1
To prepare a stand-alone patch against the current kernel tree (including
a patch against hdaps and new Kconfig entries):
# make patch
To delete all autogenerated files:
# make clean
The original kernel tree is never modified by any these commands.
The /lib/modules directory is modified only by # make install
.
Installation in Gentoo
The Gentoo portage system carries a tp_smapi package, which follows the latest version pretty closely. On a Gentoo system, you can install and load as follows.
If you use the HDAPS driver, do this first:
- Configure hdaps as module in your kernel
- Add the HDAPS use flag in /etc/make.conf
# rmmod hdaps
Then:
# emerge tp_smapi
(or install tp_smapi with hdaps support manually, as above)# echo "tp_smapi" >> /etc/modules.autoload.d/kernel-2.6
# echo "hdaps" >> /etc/modules.autoload.d/kernel-2.6
Then reboot, or run:
# modprobe tp_smapi
# modprobe hdaps
Installation on Ubuntu/Debian
Installation on Ubuntu or Debian is quite easy, but there are a few things to look after:
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):
apt-get install build-essentials
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:
uname -r
This will give you the version of your current kernel. As Ubuntu adds '-generic' to the kernel-version, the following command works for Debian users only:
apt-get install linux-source-`uname -r`
Ubuntu users use the kernel-version they got by the command before, e.g. 'linux-source-2.6.20'
Now change to the tp_smapi dir:
cd tp_smapi-X.YY
(X.YY being the version-number of tp_smapi)
and make and install tp_smapi as instructed above.
If you get an error that the kernel version isn't matching, please check that there is a symlink from the modules dir to the kernel source:
root@localhost:~#ls -l /lib/modules/2.6.20-6-generic lrwxrwxrwx 1 root root 28 2007-02-02 08:39 source -> /usr/src/linux-source-2.6.20
Create the link if the line above is not existent:
root@localhost:~#ln -s /usr/src/linux-source-2.6.20 /lib/modules/2.6.20-6-generic/source
Now the following will build and install the correct modules to their locations:
make install HDAPS=1
To make sure your system loads the modules at boot time, do this:
echo "tp_smapi" >> /etc/modules echo "hdaps" >> /etc/modules
and update your initramfs:
update-initramfs -u
To get tp_smapi running now, just load the modules:
modprobe -a tp_smapi hdaps
This description was tested on Kubuntu 'Feisty Fawn' and should work on all Debian-based distros with minor tweaks.
Battery charge control features
To set the thresholds for starting and stopping battery charging (in percent of current full charge capacity):
# echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
# echo 70 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
# cat /sys/devices/platform/smapi/BAT0/*_charge_thresh
To unconditionally inhibit charging for 17 minutes:
# echo 17 > /sys/devices/platform/smapi/BAT0/inhibit_charge_minutes
To cancel charge inhibiting:
# echo 0 > /sys/devices/platform/smapi/BAT0/inhibit_charge_minutes
To force battery discharging even if connected to AC, use one of these:
# echo 1 > /sys/devices/platform/smapi/BAT0/force_discharge
To cancel forced discharge:
# echo 0 > /sys/devices/platform/smapi/BAT0/force_discharge
Battery status features
To view extended battery status such as charging state, voltage, current, capacity, cycle count and model information:
# cat /sys/devices/platform/smapi/BAT0/installed # cat /sys/devices/platform/smapi/BAT0/state # idle/charging/discharging # cat /sys/devices/platform/smapi/BAT0/cycle_count # cat /sys/devices/platform/smapi/BAT0/current_now # instantaneous current # cat /sys/devices/platform/smapi/BAT0/current_avg # last minute average # cat /sys/devices/platform/smapi/BAT0/power_now # instantaneous power # cat /sys/devices/platform/smapi/BAT0/power_avg # last minute average # cat /sys/devices/platform/smapi/BAT0/last_full_capacity # cat /sys/devices/platform/smapi/BAT0/remaining_percent # cat /sys/devices/platform/smapi/BAT0/remaining_running_time # cat /sys/devices/platform/smapi/BAT0/remaining_charging_time # cat /sys/devices/platform/smapi/BAT0/remaining_capacity # cat /sys/devices/platform/smapi/BAT0/design_capacity # cat /sys/devices/platform/smapi/BAT0/voltage # cat /sys/devices/platform/smapi/BAT0/design_voltage # cat /sys/devices/platform/smapi/BAT0/manufacturer # cat /sys/devices/platform/smapi/BAT0/model # cat /sys/devices/platform/smapi/BAT0/barcoding # cat /sys/devices/platform/smapi/BAT0/chemistry # cat /sys/devices/platform/smapi/BAT0/serial # cat /sys/devices/platform/smapi/BAT0/manufacture_date # cat /sys/devices/platform/smapi/BAT0/first_use_date # cat /sys/devices/platform/smapi/BAT0/temperature # in milli-Celsius # cat /sys/devices/platform/smapi/ac_connected
The raw status data is also available, including some fields not listed above (in case you can figure them out):
# cat /sys/devices/platform/smapi/BAT0/dump
In all of the above, replace BAT0 with BAT1 to address the 2nd battery.
Note that the battery status readout conflicts with the stock hdaps driver, so if you use hdaps you will need to load tp_smapi using # make load HDAPS=1
(see Bundled hdaps driver below).
On ACPI-enabled systems, most of above information is also available through the files under /proc/acpi/battery. However, the ACPI interface does not include the instantaneous power and cycle count readouts, and does not work well when hotswapping UltraBay batteries.
Other features
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:
# echo '211a 100 0 0 > /sys/devices/platform/smapi/smapi_request; cat /sys/devices/platform/smapi/smapi_request 211a 34b b2 0 0 0 'OK'
The 4b" in the 2nd value, converted to decimal is 75: the current charge stop threshold.
Bundled hdaps driver
The tp_smapi package includes a modified version of the hdaps Linux kernel driver used by the HDAPS system. To use tp_smapi and hdaps concurrently, you must use the modified version.
To build the modified version, simply append the HDAPS=1 parameter to the make command (see Installation above):
# make load HDAPS=1
or
# make install HDAPS=1
If you don't do that, you will not be able to load tp_smapi (and its support module thinkpad_ec) when hdaps is loaded, and vice versa. You can use rmmod to switch between these modules.
Note that some of the battery status is also visible through ACPI (/proc/acpi/battery/*), independently of tp_smapi.
The modified hdaps has several changes:
- The hdaps driver in mainline kernels conflicts with the extended battery status (they use the same IO ports). The modified hdaps coordinates this access through the bundled thinkpad_ec driver.
- The modified hdaps 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.
- Several other improvements, such as the ability to control the polling rate.
Troubleshooting
If you get thinkpad_ec: no ThinkPad embedded controller! when trying to load the module on a supported model listed below, you should upgrade your BIOS. Some early BIOS (like 1.x on the X31) don't handle the embedded controller.
Model-specific status
Model | start_charge_ thresh |
stop_charge_ thresh |
inhbit_charge_ minutes |
force_discharge | battery status files | HDAPS (bundled version) |
HDAPS axis orientation1 | tp_smapi version | BIOS ver | Notes |
---|---|---|---|---|---|---|---|---|---|---|
A series | ||||||||||
A22p 2629-USG | no | no | no | no | no | unknown | ||||
A30 | no | no | no | no | yes | unknown | ||||
G series | ||||||||||
G41 | yes | no | yes | unknown | unknown | unknown | ||||
R series | ||||||||||
R31 | no | no | no | no | no | unknown | No SMAPI BIOS | |||
R40 | no | no | no | no | unknown | unknown | ||||
R50 | unknown | no | unknown | unknown | yes | unknown | ||||
R50e 1834-JAG | yes | no | yes | yes | yes | unknown | ||||
R50p | no | no | no | no | yes | unknown | ||||
R51 18* | yes | no | yes | unknown | yes | yes | X'=X, Y'=Y | 0.32 | 3.22 | Machine types 1829, 1830, 1831 and 1836 |
R51 28* | yes | no | yes | unknown | yes | unknown | 1.29 | Machine types 2883, 2887, 2888, 2889, 2894 and 2495 | ||
R52 | yes | yes | yes | yes | yes | yes | X'=X, Y'=Y | 0.32 | 1.29 | |
R60 | yes | yes | yes | yes | yes | yes | ||||
T series | ||||||||||
T20 | no | no | no | no | no | unknown | Has SMAPI BIOS but no function is supported. EC LPC3 protocol fails. | |||
T22 | no | no | no | no | no | unknown | Has SMAPI BIOS but no function is supported. EC LPC3 protocol fails. | |||
T23 | no | no | no | no | yes | unknown | ||||
T30 | no | no | no | no | yes | unknown | ||||
T40 | no | no | no | unknown | yes | unknown | ||||
T40p | no | no | no | no | yes | unknown | ||||
T41 | no | no | no | no | yes | unknown | ||||
T41p 2373-AM9 | no | no | no | no | yes | yes | X'=-X, Y'=-Y | 0.32 | 3.20 | EC v3.04 |
T42 | yes | no | yes | yes | yes | unknown | ||||
T42p 2373-KXU | yes | no | yes | yes | yes | yes | X'=-X, Y'=-Y | 0.32 | 3.21 | Stop charge threshold works in Windows. dmesg output:
smapi smapi: smapi_request: SMAPI error: Function is not supported by SMAPI BIOS (func=211a) smapi smapi: __get_real_thresh: cannot get stop_thresh of bat=0: Function is not supported by SMAPI BIOS |
T42p 2373-KUU | yes | no | yes | unknown | yes | unknown | ||||
T43 2686 | yes | yes | yes | yes | yes | yes | X'=X, Y'=Y | 0.32 | 1.27 | |
T43p | yes | yes | yes | yes | yes | unknown | ||||
T60 | yes | yes | unknown | yes | yes | yes | X'=Y, Y'=-X | 0.32 | ||
T60p 8743-CTO | unknown | unknown | yes | yes | yes | yes | X'=-X, Y'=-Y | 0.32 | ||
T61 | unknown | unknown | unknown | unknown | unknown | yes | ref | |||
X series | ||||||||||
X20 2662-31G | no | no | no | no | no | unknown | ||||
X24 | no | no | no | unknown | yes | unknown | ||||
X31 | no | no | no | unknown | yes | unknown | ||||
X32 | no | no | no | no | yes | unknown | ||||
X40 | yes | yes | yes | yes | yes | yes | X'=X, Y'=-Y | 0.32 | 2.08 | EC v1.62 |
X41 | yes | yes | yes | yes | yes | unknown | X'=X, Y'=-Y | 0.32 | ||
X60 | yes | yes | yes | yes | yes | yes | 2.07 | EC v1.10, 2.6.20 issue (see discussion) | ||
unknown | unknown | unknown | unknown | unknown | yes | ref ref | ||||
Z series | ||||||||||
Z60m | yes | yes | yes | yes | yes | unknown | ||||
Z60t | yes | yes | unknown | unknown | yes | unknown | ||||
Z61m | yes | yes | yes | yes | yes | yes | X'=X, Y'=Y | 0.32 | ||
Z61t | yes | yes | yes | yes | yes | yes | ref |
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).
Please update the above and report your experience on the discussion page. If the module loads but gives a "not supported" or "not implementeded" error when you try to use some specific file in /sys/devices/platform/smapi/, please report the dmesg output and whether the corresponding functionality is available under Windows - maybe your ThinkPad just can't do that.
While at it, you may also want to add your laptop to the list of DMI IDs.
HDAPS axis orientation
HDAPS axis orientation notation: X,Y are the hardware readouts, X',Y' are horizontal and vertical. You can usehdaps visualisation to see the latter.
Tools using this driver
The driver's interface can be accessed directly through the files under /sys/devices/platform/smapi, or via the following tools:
- KThinkBat - display battery status on the KDE kicker panel.
- gkrellm-ThinkBat - battery status plugin for Gkrellm2
- thinkpad-smapi.sh (download) - script to display various SMAPI information using tp_smapi module.