[ltp] [ANN] tp_smapi - a new Linux SMAPI driver

Peter Frühberger linux-thinkpad@linux-thinkpad.org
Sun, 04 Dec 2005 20:34:55 +0100


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Shem Multinymous schrieb:
> ThinkPad laptops include a proprietary interface called SMAPI BIOS
> (System Management Application Program Interface) which provides some
> hardware control functionality that is not accessible by other means.
> The "thinkpad" module from the "tpctl" package used to provide
> access to SMAPI functions, but does not work on recent models due to
> drastic changes in the interface (and is mostly superceded by ACPI
> functions anyway).
> 
> Attached is an initial release of a new driver which exposes features
> of the SMAPI BIOS via a sysfs interface. Currently, the only
> implemented functionality is setting the battery charge start and
> stop thresholds.
> 
> Usage:
> 
> # tar xzvf tp_smapi-0.01.tgz
> # cd tp_smapi-0.01
> # less README
> # make load
> # 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
> 
> 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.
> 
> 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. I don't plain to implement all those features,
> but the current framework should be a good start for contributors.
> 
> WARNING:
> This driver uses undocumented features and direct hardware access.
> It thus cannot be guaranteed to work, and may cause arbitrary damage
> (especially on models it wasn't tested on).


Hi, I just tested this on my R40 2722-B3G

I had to comment out the demidecode check in tp_smapi.c, without I got:
[43036536.770000] tp_smapi: supported laptop not found!
[43036536.770000] tp_smapi: driver init failed (ret=-6)!

After that the module loaded

[43036576.280000] tp_smapi: supported laptop not found!
[43036576.280000] tp_smapi: driver init failed (ret=-6)!
[43036666.870000] tp_smapi: initialized, smapi_port=0xb2.
[43036666.870000] tp_smapi: driver successfully loaded.
[43036700.150000] tp_smapi: smapi_request in: BX=2116 CX=100 DI=0 SI=0
[43036700.150000] tp_smapi: smapi_request out: AX=2 BX=3 CX=4 DX=5 DI=6
SI=7 OK=fffb
[43036700.150000] tp_smapi: get_thresh(0,1) failed
[43036706.360000] tp_smapi: smapi_request in: BX=211a CX=100 DI=0 SI=0
[43036706.360000] tp_smapi: smapi_request out: AX=2 BX=3 CX=4 DX=5 DI=6
SI=7 OK=fffb
[43036706.360000] tp_smapi: get_thresh(0,0) failed
[43036708.810000] tp_smapi: smapi_request in: BX=2116 CX=100 DI=0 SI=0
[43036708.820000] tp_smapi: smapi_request out: AX=2 BX=3 CX=4 DX=5 DI=6
SI=7 OK=fffb
[43036708.820000] tp_smapi: get_thresh(0,1) failed

some output:
root@todesstern:/sys/devices/platform/smapi# ls
bus  driver  power  start_charge_thresh  stop_charge_thresh

root@todesstern:/sys/devices/platform/smapi# echo 40 > start_charge_thresh
root@todesstern:/sys/devices/platform/smapi#

root@todesstern:/sys/devices/platform/smapi# cat start_charge_thresh
cat: start_charge_thresh: Input/Output Error

thx for additional help?

Peter


- --
		    Key-ID:     0x1A995A9B
		    keyserver: pgp.mit.edu
==============================================================
Fingerprint: 4606 DA19 EC2E 9A0B 0157  C81B DA07 CF63 1A99 5A9B
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDk0Tf2gfPYxqZWpsRA25AAKDmDnMlnJD2VuTYzPnMXsDwuTIMMwCg7pkq
BGb1BETmkESL0fn+Xu8EuaI=
=mT81
-----END PGP SIGNATURE-----