Skip to content

Commit

Permalink
Added Asus 1215N Optimus power control script.
Browse files Browse the repository at this point in the history
Added M11X R2 power control script.
  • Loading branch information
peberlein committed Oct 10, 2010
1 parent 33335ac commit b60ce1f
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
48 changes: 48 additions & 0 deletions asus1215n.sh
@@ -0,0 +1,48 @@
#!/bin/sh
# Power control for Asus 1215N Optimus
# by Pete Eberlein

if ! lsmod | grep -q acpi_call; then
echo "Error: acpi_call module not loaded"
exit
fi

acpi_call () {
echo "$*" > /proc/acpi/call
cat /proc/acpi/call
}


case "$1" in
off)
echo _DSM $(acpi_call "\_SB.PCI0.P0P4.GFX0._DSM" \
"{0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47," \
"0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0}" \
"0x100 0x1A {0x1,0x0,0x0,0x3}")
# ok to turn off: Buffer {0x59 0x0 0x0 0x11}
# is already off: Buffer {0x41 0x0 0x0 0x11}
echo _PS3 $(acpi_call "\_SB.PCI0.P0P4.GFX0._PS3")
;;
on)
echo _PS0 $(acpi_call "\_SB.PCI0.P0P4.GFX0._PS0")
;;
*)
echo "Usage: $0 [on|off]"
esac


echo P3MO $(acpi_call "\_SB.PCI0.P0P4.GFX0.P3MO")
echo DGPS $(acpi_call "\_SB.PCI0.P0P4.GFX0.DGPS")
PSC=$(acpi_call "\_SB.PCI0.P0P4.GFX0._PSC")
echo _PSC ${PSC}
case "$PSC" in
0x0)
PSC="on"
;;
0x3)
PSC="off"
;;
esac
echo "Asus 1215N Optimus appears to be ${PSC}"


27 changes: 27 additions & 0 deletions m11xr2.sh
@@ -0,0 +1,27 @@
#!/bin/sh
# Based on m11xr2hack by George Shearer

if ! lsmod | grep -q acpi_call; then
echo "Error: acpi_call module not loaded"
exit
fi

acpi_call () {
echo "$*" > /proc/acpi/call
cat /proc/acpi/call
}


case "$1" in
off)
echo NVOP $(acpi_call "\_SB.PCI0.P0P2.PEGP.NVOP 0 0x100 0x1A {255,255,255,255}")
echo _PS3 $(acpi_call "\_SB.PCI0.P0P2.PEGP._PS3")
;;
on)
echo _PS0 $(acpi_call "\_SB.PCI0.P0P2.PEGP._PS0")
;;
*)
echo "Usage: $0 [on|off]"
;;
esac

0 comments on commit b60ce1f

Please sign in to comment.