Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250572
b: refs/heads/master
c: 99b38b4
h: refs/heads/master
v: v3
  • Loading branch information
Dave Airlie committed May 4, 2011
1 parent 9aa4082 commit d136a43
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 776f2b7cb473baa52cdeee9804073342dee7d7cb
refs/heads/master: 99b38b4acc0d7dbbab443273577cff60080fcfad
18 changes: 6 additions & 12 deletions trunk/drivers/gpu/drm/radeon/radeon_combios.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,26 +544,20 @@ static struct radeon_i2c_bus_rec combios_setup_i2c_bus(struct radeon_device *rde
rdev->family == CHIP_RS480)
ddc_line = RADEON_GPIOPAD_MASK;
else if (rdev->family == CHIP_R300 ||
rdev->family == CHIP_R350) {
rdev->family == CHIP_R350)
ddc_line = RADEON_GPIO_DVI_DDC;
ddc = DDC_DVI;
} else
else
ddc_line = RADEON_GPIO_MONID;
break;
case DDC_CRT2:
if (rdev->family == CHIP_R200 ||
rdev->family == CHIP_R300 ||
rdev->family == CHIP_R350) {
rdev->family == CHIP_R350)
ddc_line = RADEON_GPIO_DVI_DDC;
ddc = DDC_DVI;
} else if (rdev->family == CHIP_RS300 ||
rdev->family == CHIP_RS400 ||
rdev->family == CHIP_RS480)
ddc_line = RADEON_GPIO_MONID;
else if (rdev->family >= CHIP_RV350) {
else if (rdev->family == CHIP_RS300 ||
rdev->family >= CHIP_RV350)
ddc_line = RADEON_GPIO_MONID;
ddc = DDC_MONID;
} else
else
ddc_line = RADEON_GPIO_CRT2_DDC;
break;
}
Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/platform/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -753,4 +753,11 @@ config SAMSUNG_LAPTOP
To compile this driver as a module, choose M here: the module
will be called samsung-laptop.

config MXM_WMI
tristate "WMI support for MXM Laptop Graphics"
depends on WMI
---help---
MXM is a standard for laptop graphics cards, the WMI interface
is required for switchable nvidia graphics machines

endif # X86_PLATFORM_DEVICES
1 change: 1 addition & 0 deletions trunk/drivers/platform/x86/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ obj-$(CONFIG_XO15_EBOOK) += xo15-ebook.o
obj-$(CONFIG_IBM_RTL) += ibm_rtl.o
obj-$(CONFIG_SAMSUNG_LAPTOP) += samsung-laptop.o
obj-$(CONFIG_INTEL_MFLD_THERMAL) += intel_mid_thermal.o
obj-$(CONFIG_MXM_WMI) += mxm-wmi.o
85 changes: 85 additions & 0 deletions trunk/drivers/platform/x86/mxm-wmi.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
* MXM WMI driver
*
* Copyright(C) 2010 Red Hat.
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>

MODULE_AUTHOR("Dave Airlie");
MODULE_DESCRIPTION("MXM WMI Driver");
MODULE_LICENSE("GPL");

#define MXM_WMMX_GUID "F6CB5C3C-9CAE-4EBD-B577-931EA32A2CC0"

MODULE_ALIAS("wmi:"MXM_WMMX_GUID);

#define MXM_WMMX_FUNC_MXDS 0x5344584D /* "MXDS" */

struct mxds_args {
u32 func;
u32 args;
u32 xarg;
};

int mxm_wmi_call_mxds(int adapter)
{
struct mxds_args args = {
.func = MXM_WMMX_FUNC_MXDS,
.args = 0,
.xarg = 1,
};
struct acpi_buffer input = { (acpi_size)sizeof(args), &args };
struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
acpi_status status;

printk("calling mux switch %d\n", adapter);

status = wmi_evaluate_method(MXM_WMMX_GUID, 0x1, adapter, &input,
&output);

if (ACPI_FAILURE(status))
return status;

printk("mux switched %d\n", status);
return 0;

}
EXPORT_SYMBOL_GPL(mxm_wmi_call_mxds);

bool mxm_wmi_supported(void)
{
bool guid_valid;
guid_valid = wmi_has_guid(MXM_WMMX_GUID);
return guid_valid;
}
EXPORT_SYMBOL_GPL(mxm_wmi_supported);

static int __init mxm_wmi_init(void)
{
return 0;
}

static void __exit mxm_wmi_exit(void)
{
}

module_init(mxm_wmi_init);
module_exit(mxm_wmi_exit);
32 changes: 32 additions & 0 deletions trunk/include/linux/mxm-wmi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* MXM WMI driver
*
* Copyright(C) 2010 Red Hat.
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#ifndef MXM_WMI_H
#define MXM_WMI_H

/* discrete adapters */
#define MXM_MXDS_ADAPTER_0 0x0
#define MXM_MXDS_ADAPTER_1 0x0
/* integrated adapter */
#define MXM_MXDS_ADAPTER_IGD 0x10
int mxm_wmi_call_mxds(int adapter);
bool mxm_wmi_supported(void);

#endif

0 comments on commit d136a43

Please sign in to comment.