GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing www.thinkwiki.org — Tp smapi - ThinkWiki Tp smapi
Jump to: navigation, search
Features
Project Homepage / Availability
InstallationInstallation from sourceYou will need the kernel headers and makefiles corresponding to your current kernel version. On Fedora, this means
Then, either compile and load the driver within the current working directory (for testing):
OR compile and install into the kernel's module path:
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). Again, either load the driver within the current working directory:
OR install into the kernel's module path:
To prepare a stand-alone patch against the current kernel tree (including a patch against hdaps and new Kconfig entries):
To delete all autogenerated files:
The original kernel tree is never modified by any these commands.
The /lib/modules directory is modified only by Installation in GentooThe 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:
Then:
Then reboot, or run:
NOTE: If
Installation on Debian and UbuntuSince Debian 7 Wheezy and Ubuntu 12.04 Precise you can use 'dkms'. (Note: If installation seems ineffective, confirm you have the linux-headers of your kernel installed, purge tp-smapi-dkms and reinstall.)
Hint:
This appears to be the ideal solution. A description of DKMS, from 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."
Installation on openSUSEopenSUSE provides rpm packages. Look for them at the package search: [1], search for the package named "tp_smapi". 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 here 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: cp /usr/include/linux/aio_abi.h /lib/modules/`uname -r`/build/include/linux/ Battery charge control featuresNOTE!
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.
To set the thresholds for starting and stopping battery charging (in percent of current full charge capacity):
Hint:
Battery charging thresholds can be used to keep Li-Ion and Li-Polymer batteries partially charged, in order to increase their lifetime.
To prevent charging for 17 minutes (regardless of thresholds):
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 using an Ultrabay battery.
To cancel charging preventation:
To force battery discharging (even if connected to AC):
Hint:
This can be used to choose which battery is discharged when using an UltraBay battery. For example, see the tp-bat-balance (download) script.
To cancel forced discharge:
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
Making the settings permanent on rebootIf you always use the same type of battery, then you may want the same settings to be configured each time you boot the machine. 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. DebianIt is not necessary to create your own init.d script or modify /etc/rc.local - you just need the package sysfsutils:
Now, put your desired settings in /etc/sysfs.conf: # cat >> /etc/sysfs.conf << EOF # For a LiIon battery in a Thinkpad devices/platform/smapi/BAT0/start_charge_thresh = 50 devices/platform/smapi/BAT0/stop_charge_thresh = 80 EOF The init script supplied by sysfsutils will load these settings on each boot. Battery status featuresTo 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):
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 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. ScriptsSome scripts can make it easier to grep the information you need from tp_smapi Other featuresThere 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 charging stop threshold (stop_charge_thresh). Bundled hdaps driverThe tp_smapi package includes a modified version of the hdaps Linux kernel driver used by the HDAPS system. It has remained outside the mainline kernel for a few years for several reasons, [2] 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.) [3] [4] [5] 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):
or
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:
Troubleshootingthinkpad_ec: cannot claim io ports 0x1600-0x161fThe "thinkpad_ec: cannot claim io ports 0x1600-0x161f!" error message is printed when loading the thinkpad_ec module on some recent ThinkPad models. This occurs because the ACPI BIOS DSDT is reserving ports used by tp_smapi. As a workaround, add the force_io=1 module parameter to thinkpad_ec in /etc/modprobe.conf (or your distribution's equivalent). Add the line:
For transient testing, load the modules as follows:
Note: force_io option was added in tp_smapi v0.40 (released 2008-12-16). Models which need this option include: T400, T500, X60s, X61, X301 More information:
thinkpad_ec: no ThinkPad embedded controller!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. T60p writing to start_charge_thresh/stop_charge_thresh does not work!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. 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. Model-specific statusTip: The thinkpad-acpi module reports both the BIOS and EC firmware versions when it loads.
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 orientation1 The HDAPS axis orientation is set using the invert module parameter (at load time) or sysfs attribute (at runtime). The hdaps driver of tp_smapi supports all 8 possible sensor orientations (inversion and swapping). You can use hdaps visualisation to check if the settings is correct. The invert 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.) Let X and Y denote the hardware readouts. Let R denote the laptop's roll (tilt left/right), and let P denote the laptop's pitch (tilt forward/backward). The possible values are as follows: invert=0: R= X P= Y (same as mainline) invert=1: R=-X P=-Y (same as mainline) invert=2: R=-X P= Y (new) invert=3: R= X P=-Y (new) invert=4: R= Y P= X (new) invert=5: R=-Y P=-X (new) invert=6: R=-Y P= X (new) invert=7: R= Y P=-X (new) Tools using this driverThe driver's interface can be accessed directly through the files under /sys/devices/platform/smapi, or via the following tools:
See alsoHeadline text
Retrieved from "https://www.thinkwiki.org/w/index.php?title=Tp_smapi&oldid=56895"
Categories:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402809 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||