[ltp] SpeedStep & apmd

Matthias Posseldt linux-thinkpad@linux-thinkpad.org
Tue, 22 Jul 2003 20:30:15 +0200


--Boundary-00=_3KYH/3ybLyYQMAu
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,

I just configured SpeedStep (cpufreq) on my A30p.

After building a kernel which supports cpufreq (patch available online) you 
have a cpufreq "file" in /proc. cat /proc/cpufreq gives the current settings, 
you can also echo some values into it to change the settings.

I wrote a small script (attached) for apmd which should be located in 
/etc/apm/event.d and is called when the power status changes. It sets 
powersave mode when on battery and performance mode for AC.

It works on Gentoo with apmd 3.0.2.

Ciao, Matthias
-- 
No Software Patents in the EU

http://swpat.ffii.org/patente/muster/index.en.html

--Boundary-00=_3KYH/3ybLyYQMAu
Content-Type: application/x-shellscript;
  name="speedstep"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="speedstep"

#!/bin/sh

## Enable SpeedStep powersave modus when on battery
case "$1" in
    change)
	case "$2" in
	    power)
		if (on_ac_power > /dev/null); then
		    echo -n "0%0%100%performance" > /proc/cpufreq
		else
		    echo -n "0%0%100%powersave" > /proc/cpufreq
		fi
		;;
	    *)
		;;
	esac
	;;
    *)
	;;
esac

--Boundary-00=_3KYH/3ybLyYQMAu--