Permalink
Browse files

asus-switcher: push suspend/resume script out to it's own file

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
  • Loading branch information...
1 parent c3457f8 commit 259b6991f51786507da6e7a79880fa3481852da5 @awilliam committed Apr 17, 2011
Showing with 28 additions and 22 deletions.
  1. +5 −22 README
  2. +23 −0 asus-switcher-suspend-resume.sh
View
27 README
@@ -32,28 +32,11 @@ things might happen.
Also note that on resume, the BIOS powers on the discrete graphics.
This will cause problems if the OS thinks it's still gone. Turning
-the card back on before sleep and off at resume seems to work:
-
-$ cat /etc/pm/sleep.d/75-ul30vt
-#!/bin/sh
-
-case "$1" in
- suspend|hibernate)
- if [ -e /sys/kernel/debug/vgaswitcheroo/switch ]; then
- echo ON > /sys/kernel/debug/vgaswitcheroo/switch
- fi
- exit 0
- ;;
- resume|thaw)
- if [ -e /sys/kernel/debug/vgaswitcheroo/switch ]; then
- echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
- fi
- exit 0
- ;;
- *)
- echo "Usage $0 {suspend|hibernate|resume|thaw}"
- exit 1
-esac
+the card back on before sleep and off at resume seems to work. Do
+the following to put a script in place to handle this automatically.
+
+cp asus-switcher-suspend-resume.sh \
+ /etc/pm/sleep.d/75-asus-switcher-suspend-resume.sh
The lid switch is a known issue when running with the discrete
graphics. Opening the lid causes a crash through the intel
View
23 asus-switcher-suspend-resume.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# When we wakeup from suspend, both devices are turned on. This causes
+# unexpected power draw and confusines switcheroo. Turn the unused device
+# back on before suspend and off after resume some everyone is in sync.
+
+case "$1" in
+ suspend|hibernate)
+ if [ -e /sys/kernel/debug/vgaswitcheroo/switch ]; then
+ echo ON > /sys/kernel/debug/vgaswitcheroo/switch
+ fi
+ exit 0
+ ;;
+ resume|thaw)
+ if [ -e /sys/kernel/debug/vgaswitcheroo/switch ]; then
+ echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
+ fi
+ exit 0
+ ;;
+ *)
+ echo "Usage $0 {suspend|hibernate|resume|thaw}"
+ exit 1
+esac

0 comments on commit 259b699

Please sign in to comment.