Skip to contentSkip to conversation

platform/x86: add MXM WMI driver.

RFC PATCH In review Dave Airlie 2 participants 3 messages Dec 21, 2010 – Jan 8, 2011 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 platform/x86: add MXM WMI driver.

From: Dave Airlie <[email protected]>

MXM is a laptop graphics card form-factor + interface specification, this adds an initial stub driver to talk to the MXM WMI interface.

The only method used is the MUX switching method needed to do switchable graphics on the nvidia chipsets.

---
 drivers/platform/x86/Kconfig   |    7 +++
 drivers/platform/x86/Makefile  |    1 +
 drivers/platform/x86/mxm-wmi.c |   85 ++++++++++++++++++++++++++++++++++++++++
 include/linux/mxm-wmi.h        |   32 +++++++++++++++
 4 files changed, 125 insertions(+), 0 deletions(-)
 create mode 100644 drivers/platform/x86/mxm-wmi.c
 create mode 100644 include/linux/mxm-wmi.h
drivers/platform/x86/Kconfig +7 -0
index faec777..8a435a1 100644
@@ -639,4 +639,11 @@ config XO1_RFKILL
 	  Support for enabling/disabling the WLAN interface on the OLPC XO-1
 	  laptop.
 
+config MXM_WMI
+	tristate "WMI support for MXM Laptop Graphics"
+	depends on ACPI_WMI
+	---help---
+	 MXM is a standard for laptop graphics cards, the WMI interface
+	 is required for switchable nvidia graphics machines
+
 endif # X86_PLATFORM_DEVICES
drivers/platform/x86/Makefile +1 -0
index 9950ccc..6abdae9 100644
@@ -33,3 +33,4 @@ obj-$(CONFIG_INTEL_IPS)		+= intel_ips.o
 obj-$(CONFIG_GPIO_INTEL_PMIC)	+= intel_pmic_gpio.o
 obj-$(CONFIG_XO1_RFKILL)	+= xo1-rfkill.o
 obj-$(CONFIG_IBM_RTL)		+= ibm_rtl.o
+obj-$(CONFIG_MXM_WMI)		+= mxm-wmi.o
drivers/platform/x86/mxm-wmi.c new file +85 -0

85 lines not on this page · raw message

include/linux/mxm-wmi.h new file +32 -0
new file mode 100644
index 0000000..56b5454
@@ -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_DIS_0 0x0
+#define MXM_MXDS_ADAPTER_DIS_1 0x1
+/* integrated adapter */
+#define MXM_MXDS_ADAPTER_IGD 0x10
+int mxm_wmi_call_mxds(int adapter, u32 output_id);
+bool mxm_wmi_supported(void);
+
+#endif
Signature · 1 line
1.7.3.3
#1 lore raw

Are you looking for this to be merged at the moment? If so, the printks probably ought to be conditional on a debug parameter (is the drm debug level exported?).

Signature · 1 line
Matthew Garrett | [email protected]
#2 lore raw
Quoted 3 lines · Matthew Garrett

Are you looking for this to be merged at the moment? If so, the printks probably ought to be conditional on a debug parameter (is the drm debug level exported?).

I was looking for some feedback on whether it was sane first ;0

But since it relies on nouveau changes to make it do anything and its all under debugfs I was going to leave the printks alone until we could get some debugging on more hw than my one laptop.

Dave.