1
0
Fork 0

- Updated ALPM powersave code in the various powersave profiles

- Disabled USB autosuspend in laptop-battery-powersave for now
This commit is contained in:
Philip Knirsch 2010-03-18 14:28:48 +01:00
parent 4bfefca84e
commit db9c8a8203
4 changed files with 38 additions and 38 deletions

View file

@ -1,18 +1,18 @@
#!/bin/sh
ALPM="medium_power"
ALPM="min_power"
# Set ALPM for all host adapters that support it
set_alpm() {
for x in /sys/bus/scsi/devices/host*/scsi_host/host*/; do
hotplug="0"
if [ -e $x/sata_hotplug ]; then
hotplug="$(cat $x/sata_hotplug)"
fi
if [ "$hotplug" == "0" -a -e $x/link_power_management_policy ]; then
echo $1 > $x/link_power_management_policy
fi
done
for x in /sys/class/scsi_host/*; do
if [ -f $x/ahci_port_cmd ]; then
port_cmd=`cat $x/ahci_port_cmd`;
if [ $((0x$port_cmd & 0x240000)) = 0 -a -f $x/link_power_management_policy ]; then
echo $1 >$x/link_power_management_policy;
else
echo "max_performance" >$x/link_power_management_policy;
fi
fi
done
}
start() {
@ -22,7 +22,7 @@ start() {
# Disable ALPM for all host adapters that support it
stop() {
set_alpm "max_power"
set_alpm "max_performance"
return 0
}

View file

@ -1,18 +1,18 @@
#!/bin/sh
ALPM="medium_power"
ALPM="min_power"
# Set ALPM for all host adapters that support it
set_alpm() {
for x in /sys/bus/scsi/devices/host*/scsi_host/host*/; do
hotplug="0"
if [ -e $x/sata_hotplug ]; then
hotplug="$(cat $x/sata_hotplug)"
fi
if [ "$hotplug" == "0" -a -e $x/link_power_management_policy ]; then
echo $1 > $x/link_power_management_policy
fi
done
for x in /sys/class/scsi_host/*; do
if [ -f $x/ahci_port_cmd ]; then
port_cmd=`cat $x/ahci_port_cmd`;
if [ $((0x$port_cmd & 0x240000)) = 0 -a -f $x/link_power_management_policy ]; then
echo $1 >$x/link_power_management_policy;
else
echo "max_performance" >$x/link_power_management_policy;
fi
fi
done
}
start() {
@ -22,7 +22,7 @@ start() {
# Disable ALPM for all host adapters that support it
stop() {
set_alpm "max_power"
set_alpm "max_performance"
return 0
}

View file

@ -20,7 +20,7 @@ start() {
set_alpm ${ALPM}
# Enables USB autosuspend for all devices
for i in /sys/bus/usb/devices/*/power/autosuspend; do echo 1 > $i; done > /dev/null 2>&1
#for i in /sys/bus/usb/devices/*/power/autosuspend; do echo 1 > $i; done > /dev/null 2>&1
# Enables multi core power savings for low wakeup systems
[ -e /sys/devices/system/cpu/sched_mc_power_savings ] && echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
@ -44,7 +44,7 @@ stop() {
set_alpm "max_performance"
# Disables USB autosuspend for all devices
for i in /sys/bus/usb/devices/*/power/autosuspend; do echo 0 > $i; done > /dev/null 2>&1
#for i in /sys/bus/usb/devices/*/power/autosuspend; do echo 0 > $i; done > /dev/null 2>&1
# Disables multi core power savings for low wakeup systems
[ -e /sys/devices/system/cpu/sched_mc_power_savings ] && echo 0 > /sys/devices/system/cpu/sched_mc_power_savings

View file

@ -1,18 +1,18 @@
#!/bin/sh
ALPM="medium_power"
ALPM="min_power"
# Set ALPM for all host adapters that support it
set_alpm() {
for x in /sys/bus/scsi/devices/host*/scsi_host/host*/; do
hotplug="0"
if [ -e $x/sata_hotplug ]; then
hotplug="$(cat $x/sata_hotplug)"
fi
if [ "$hotplug" == "0" -a -e $x/link_power_management_policy ]; then
echo $1 > $x/link_power_management_policy
fi
done
for x in /sys/class/scsi_host/*; do
if [ -f $x/ahci_port_cmd ]; then
port_cmd=`cat $x/ahci_port_cmd`;
if [ $((0x$port_cmd & 0x240000)) = 0 -a -f $x/link_power_management_policy ]; then
echo $1 >$x/link_power_management_policy;
else
echo "max_performance" >$x/link_power_management_policy;
fi
fi
done
}
start() {
@ -22,7 +22,7 @@ start() {
# Disable ALPM for all host adapters that support it
stop() {
set_alpm "max_power"
set_alpm "max_performance"
return 0
}