mxm/wmi: add MXMX interface entry point.
The MXMX method appears to be a mutex of some sort.
Signed-off-by: Dave Airlie <airlied@redhat.com>
diff --git a/drivers/platform/x86/mxm-wmi.c b/drivers/platform/x86/mxm-wmi.c
index 12b6f34..0aea63b 100644
--- a/drivers/platform/x86/mxm-wmi.c
+++ b/drivers/platform/x86/mxm-wmi.c
@@ -32,6 +32,7 @@
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 @@
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 @@
}
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;