mxm/wmi: add MXMX interface entry point.
authorDave Airlie <airlied@redhat.com>
Mon, 9 May 2011 01:40:25 +0000 (11:40 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 9 May 2011 01:40:38 +0000 (11:40 +1000)
The MXMX method appears to be a mutex of some sort.

Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/nouveau/nouveau_acpi.c
drivers/platform/x86/mxm-wmi.c
include/linux/mxm-wmi.h

index e0a885b72e0ee26b8efb9de583918bbfdef836c9..f0d459bb46e4152a2f40c0fa2e0b54311c79a328 100644 (file)
@@ -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);
 }
index 12b6f341e72b065d1d44ad99822d619b8c83898f..0aea63b3729a4481ece3bc5d1c8dfb041fe0f2bc 100644 (file)
@@ -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;
@@ -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);
 
@@ -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;
index 51359c0718bf204312b952c2c54b4bcc84b9447d..617a2950523cfe3bcb4f4a1e3e797d7ebb4878a0 100644 (file)
@@ -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
This page took 0.040857 seconds and 5 git commands to generate.