Browse files

Added support scripts for Asus 1015PN.

  • Loading branch information...
1 parent d870f42 commit 0435ee9796d2e4785a158c83dd59d395735137d5 @aurelgadjo committed Jun 12, 2011
Showing with 82 additions and 0 deletions.
  1. +44 −0 install-files/bumblebee-disablecard.1015PN
  2. +38 −0 install-files/bumblebee-enablecard.1015PN
View
44 install-files/bumblebee-disablecard.1015PN
@@ -0,0 +1,44 @@
+#!/bin/bash
+# This script should contain the command(s) nessesary to switch off the
+# nVidia card.
+# This is a template script..
+# Please note that the acpi_call module is need for these operations:
+#
+# http://linux-hybrid-graphics.blogspot.com/2010/07/using-acpicall-module-to-switch-onoff.html
+# https://github.com/MrMEEE/bumblebee/issues/171
+if ! lsmod | grep -q nvidia; then
+ echo "Skipping: nVidia Card already disabled"
+ exit
+fi
+
+rmmod nvidia
+if lsmod | grep -q nvidia; then
+ echo "Error: could not unload nvidia module, leaving card turned on"
+ exit
+fi
+modprobe acpi_call
+
+if ! lsmod | grep -q acpi_call; then
+ echo "Error: acpi_call module not loaded"
+ exit
+fi
+
+acpi_call () {
+ echo "$*" > /proc/acpi/call
+ result=$(cat /proc/acpi/call)
+ case "$result" in
+ Error*)
+ echo "Disabling nVidia Card failed ($result)."
+ ;;
+ *)
+ echo "Disabling nVidia Card Succeded."
+ ;;
+ esac
+}
+
+# disables the card
+echo $(acpi_call "\_SB.PCI0.P0P4.DGPU.DOFF")
+
+# If I understood as well, this ACPI call just tells to hardware
+# to enable both graphics cards at boot (and not just nvidia one)
+echo _PS0 $(acpi_call "\OSGS 0x03")
View
38 install-files/bumblebee-enablecard.1015PN
@@ -0,0 +1,38 @@
+#!/bin/bash
+# This script should contain the command(s) nessesary to switch on the
+# nVidia card.
+# This example originally comes from bumblebee project for the Asus 1215n, provided by BarzantMD..
+# It works on Asus1015PN.
+# Please note that the acpi_call module is need for these operations:
+#
+# http://linux-hybrid-graphics.blogspot.com/2010/07/using-acpicall-module-to-switch-onoff.html
+# https://github.com/MrMEEE/bumblebee/issues/171
+
+if lsmod | grep -q nvidia; then
+ echo "Skipping: nVidia Card already enabled"
+ exit
+fi
+
+modprobe acpi_call
+
+if ! lsmod | grep -q acpi_call; then
+ echo "Error: acpi_call module not loaded"
+ exit
+fi
+
+acpi_call () {
+ echo "$*" > /proc/acpi/call
+ result=$(cat /proc/acpi/call)
+ case "$result" in
+ Error*)
+ echo "Enabling nVidia Card failed ($result)."
+ ;;
+ *)
+ echo "Enabling nVidia Card Succeded."
+ ;;
+ esac
+}
+
+echo _PS0 $(acpi_call "\_SB.PCI0.P0P4.DGPU.DON")
+modprobe nvidia-current
+

0 comments on commit 0435ee9

Please sign in to comment.