Howto: Extend the Life of Your Thinkpad's Battery (tp_smapi) on Ubuntu Feisty and Gutsy
You may or may not be aware that lithium ion batteries (like those present in the newer Thinkpad models) survive best when kept charged between 30%-85%. They should not be kept fully charged, and should be left off for long periods of time charged to ~%40. See here for more tips on Thinkpad battery treatment.
One way to extend the life of your Thinkpad's battery is to control the way it charges -- that is, to make sure that you keep it in the 30%-85% charged range whenever possible. This is possible easily and quickly through the tp_smapi kernel module.
(1) Download the tp_smapi code here. For the examples presented here, let's assume that you download the tarball to your home directory (~/):wget http://easynews.dl.sourceforge.net/sourceforge/tpctl/tp_smapi-0.32.tgz ~/tp_smapi-0.32.tgz
sudo aptitude install build-essential linux-source-2.6.22
sudo -s
cd /usr/src
tar -xjf linux-source-2.6.22.tar.bz2
(2c) Now go into /lib/modules/`uname -r`. Both the "build" and "source" symbollic links should point to your source folder. You can check this by observing the output of ln -l, or just create it this way with the following:sudo -s
rm -i /lib/modules/`uname -r`/source /lib/modules/`uname -r`/build
ln -s /usr/src/linux-source-2.6.22 /lib/modules/`uname -r`/source
ln -s /usr/src/linux-source-2.6.22 /lib/modules/`uname -r`/build
tar -xzf ~/tp_smapi-0.32.tgz
cd tp_smapi-0.32 && make && sudo make install
cd tp_smapi-0.32 && make && sudo make install HDAPS=1
sudo -s;
echo "tp_smapi" >> /etc/modules
sudo modprobe tp_smapi
/sys/devices/platform/smapi/BAT0/start_charge_thre sh
/sys/devices/platform/smapi/BAT0/stop_charge_thres h
sudo -s;
echo "30" > /sys/devices/platform/smapi/BAT0/start_charge_thresh;
echo "85" > /sys/devices/platform/smapi/BAT0/stop_charge_thresh;
sudo -s;
echo "81" > /sys/devices/platform/smapi/BAT0/start_charge_thresh;
echo "85" > /sys/devices/platform/smapi/BAT0/stop_charge_thresh;
Hope this helps! Most of this information has come from here. Please let me know if you have any problems.