echo auto | tee /sys/bus/{pci,spi,i2c}/devices/*/power/control > /dev/null
#!/bin/sh
device_pm() {
for dpcontrol in /sys/bus/{pci,spi,i2c}/devices/*/power/control; do
[ -w "$dpcontrol" ] || continue
echo $1 > "$dpcontrol"
done
}
case "$1" in
true)
echo "**device power management ON"
device_pm auto
;;
false)
echo "**device power management OFF"
device_pm on
;;
esac
exit 0
for i in $(ls /sys/bus/{pci,spi,i2c}/devices/*/power/control);do echo auto > $i;done
as root (or in /etc.rc.local) should do the trick
Thanks for your finding
]]>cd /sys/devices
find pci* -name "control" -exec /root/energy/setauto.sh {} \;
setauto.sh contains nothing much but an additional check of the filename (as find can't test the name on "control/power"):
#!/bin/bash
file=$1
if [[ "$file" =~ 'power' ]]
then
echo "$file"
echo "auto" > "$file"
echo "Done."
fi
On my system, there is only one pci subdirectory called "pci0000:00". I have nevertheless used a wildcard in the find command, hoping that it would cycle through two or more subdirectories as well, but couldn't test it.
After running this script, powertop does no make the respective suggestion and powertop 1.97 beta lists all PCI devices in status "GOOD".
Hope that helps,
F.
]]>How have you all implemented this command? Do you run it at boot, and if so, with what?
This setting seems to affect my 6-cell netbook battery by around 1.5 hours. Seems like something which could be integrated into laptop mode.
]]>is there any other way to enable this?
]]>Enable Device Power Management by pressing the P key
Does anyone know what this is referring to, or how to implement this in a script outside of powertop?
Or is this just a bug in powertop's output?
Thanks
]]>