Ubuntu – How to adjust charging thresholds of laptop battery

batterylinuxpower-managementthinkpadUbuntu

My laptop is Lenovo T400, and OS is Ubuntu 12.04.

I have not been able to adjust the thresholds for battery starting charging and stopping charging. I observed that its current starting charging threshold is about 40%, and stopping charging threshold is about 60%. I forgot if it was me and which program I used to control the battery to stop charging at 60% and start charging at 40%.

I followed my previous post https://askubuntu.com/questions/58789/how-to-check-charged-percentage-of-battery-and-to-adjust-its-thresholds, but I don't find /sys/devices/platform/smapi. Also I have /proc/acpi/battery/BAT0/, but I have only three files alarm, info and state.

I want to adjust the thresholds. So I wonder how to do that?

Best Answer

You need to install tp_smapi-dkms, just do

apt-get install tp_smapi-dkms

When finished, use lsmod | grep tp_smapi to check if module is loaded, to adjust the charge thresholds, do something like this

echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
echo 60 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh

Add these lines to /etc/rc.local to run them at boot.

This module works at least on X220.

Related Question