Commit 191780a8 authored by Vincent Cheng's avatar Vincent Cheng

Imported Upstream version 0.8

parent 8a4abdef
This diff is collapsed.
Version 0.8 - 5 December 2013
* Compatibility with Linux 3.13.
Version 0.7 - 28 May 2013
* Fixes a scary WARNING on Linux 3.9.
......
......@@ -130,12 +130,13 @@ the boot process. On Debian and Ubuntu, this can performed by running
Some machines do not like the card being disabled at shutdown.
Add the next initscript (`/etc/init/bbswitch.conf`) :
description "Save power by disabling nvidia on Optimus"
author "Lekensteyn <lekensteyn@gmail.com>"
start on runlevel [2345]
stop on runlevel [016]
pre-start exec /sbin/modprobe bbswitch load_state=0 unload_state=1
pre-stop exec /sbin/rmmod bbswitch
description "Save power by disabling nvidia on Optimus"
author "Lekensteyn <lekensteyn@gmail.com>"
start on runlevel [2345]
stop on runlevel [016]
pre-start exec /sbin/modprobe bbswitch load_state=0 unload_state=1
pre-stop exec /sbin/rmmod bbswitch
Reporting bugs
--------------
......
......@@ -15,7 +15,7 @@
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
......@@ -36,7 +36,7 @@
#include <linux/seq_file.h>
#include <linux/pm_runtime.h>
#define BBSWITCH_VERSION "0.7"
#define BBSWITCH_VERSION "0.8"
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Toggle the discrete graphics card");
......@@ -120,6 +120,9 @@ static int acpi_call_dsm(acpi_handle handle, const char muid[16], int revid,
params[1].integer.value = revid;
params[2].type = ACPI_TYPE_INTEGER;
params[2].integer.value = func;
/* Although the ACPI spec defines Arg3 as a Package, in practise
* implementations expect a Buffer (CreateWordField and Index functions are
* applied to it). */
params[3].type = ACPI_TYPE_BUFFER;
params[3].buffer.length = 4;
if (args) {
......@@ -400,7 +403,13 @@ static int __init bbswitch_init(void) {
pci_class != PCI_CLASS_DISPLAY_3D)
continue;
#ifdef ACPI_HANDLE
/* since Linux 3.8 */
handle = ACPI_HANDLE(&pdev->dev);
#else
/* removed since Linux 3.13 */
handle = DEVICE_ACPI_HANDLE(&pdev->dev);
#endif
if (!handle) {
pr_warn("cannot find ACPI handle for VGA device %s\n",
dev_name(&pdev->dev));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment