Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250576
b: refs/heads/master
c: 000703f
h: refs/heads/master
v: v3
  • Loading branch information
Dave Airlie committed May 9, 2011
1 parent 3480626 commit 90a1c11
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 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: f19467c509e36e5ba3498efd7d4072d3581a1d6c
refs/heads/master: 000703f44c77b152cd966eaf06f4ab043274ff46
1 change: 1 addition & 0 deletions trunk/drivers/gpu/drm/nouveau/nouveau_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result)

static int nouveau_dsm_switch_mux(acpi_handle handle, int mux_id)
{
mxm_wmi_call_mxmx(mux_id == NOUVEAU_DSM_LED_STAMINA ? MXM_MXDS_ADAPTER_IGD : MXM_MXDS_ADAPTER_0);
mxm_wmi_call_mxds(mux_id == NOUVEAU_DSM_LED_STAMINA ? MXM_MXDS_ADAPTER_IGD : MXM_MXDS_ADAPTER_0);
return nouveau_dsm(handle, NOUVEAU_DSM_LED, mux_id, NULL);
}
Expand Down
28 changes: 27 additions & 1 deletion trunk/drivers/platform/x86/mxm-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ MODULE_LICENSE("GPL");
MODULE_ALIAS("wmi:"MXM_WMMX_GUID);

#define MXM_WMMX_FUNC_MXDS 0x5344584D /* "MXDS" */
#define MXM_WMMX_FUNC_MXMX 0x53445344 /* "MXMX" */

struct mxds_args {
u32 func;
Expand All @@ -51,7 +52,7 @@ int mxm_wmi_call_mxds(int adapter)
acpi_status status;

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

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

Expand All @@ -64,6 +65,31 @@ int mxm_wmi_call_mxds(int adapter)
}
EXPORT_SYMBOL_GPL(mxm_wmi_call_mxds);

int mxm_wmi_call_mxmx(int adapter)
{
struct mxds_args args = {
.func = MXM_WMMX_FUNC_MXMX,
.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 mutex set switched %d\n", status);
return 0;

}
EXPORT_SYMBOL_GPL(mxm_wmi_call_mxmx);

bool mxm_wmi_supported(void)
{
bool guid_valid;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/mxm-wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/* integrated adapter */
#define MXM_MXDS_ADAPTER_IGD 0x10
int mxm_wmi_call_mxds(int adapter);
int mxm_wmi_call_mxmx(int adapter);
bool mxm_wmi_supported(void);

#endif

0 comments on commit 90a1c11

Please sign in to comment.