View Single Post
  #23  
Old 23rd February 2012, 05:50 PM
esbennn Offline
Registered User
 
Join Date: Sep 2010
Location: Dk
Posts: 96
Re: Batterylife on Asus U36SD

I am using acpi_call to disable the discreet card, but from your previous post, i was under the impression that your are doing the same?

This is the actual script that i just grabbed from my file, 20_custom-ehci_hcd, located /etc/pm/sleep.d:

Code:
#!/bin/sh
 TMPLIST_E=/tmp/ehci-dev-list
 TMPLIST_X=/tmp/xhci-dev-list
 E_DIR=/sys/bus/pci/drivers/ehci_hcd
 X_DIR=/sys/bus/pci/drivers/xhci_hcd
 E_BIND=$E_DIR""/bind
 E_UNBIND=$E_DIR""/unbind
 X_BIND=$X_DIR""/bind
 X_UNBIND=$X_DIR""/unbind
 #param1 = temp file, param2 = device dir, param3 = unbind

 unbindDev (){
 #inspired by http://art.ubuntuforums.org/showpost...0&postcount=19
 echo -n '' > $1
 for i in `ls $2 | egrep '[0-9a-z]+\:[0-9a-z]+\:.*$'`; do
 echo -n "$i" | tee $3
 echo "$i" >> $1
 done
 }
 #param1 = tem file, param2 = bind
 bindDev(){
 [ -f $1 ] || return
 for i in `cat $1`; do
 echo -n "$i" | tee $2
 done
 rm $1
 }
 case "${1}" in
 hibernate|suspend)
 unbindDev $TMPLIST_E $E_DIR $E_UNBIND
 unbindDev $TMPLIST_X $X_DIR $X_UNBIND
 ;;
 resume|thaw)
 bindDev $TMPLIST_E $E_BIND
 bindDev $TMPLIST_X $X_BIND
  echo '\_SB.PCI0.PEG0.GFX0.DOFF' > /proc/acpi/call
 ;;
 esac
The file has these permission details:
Code:
-rwxrwxr-x. 1 root root
This script works for me. I am, however, still on kernel 3.2.6, but i am updating it this moment. If I find that this script is not working with the new kernel for me either, I'll let you know.
Reply With Quote