diff options
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/Kconfig | 9 | ||||
-rw-r--r-- | drivers/platform/x86/Makefile | 1 | ||||
-rw-r--r-- | drivers/platform/x86/ibm_rtl.c | 13 | ||||
-rw-r--r-- | drivers/platform/x86/intel_ips.c | 13 | ||||
-rw-r--r-- | drivers/platform/x86/mxm-wmi.c | 111 |
5 files changed, 146 insertions, 1 deletions
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index 0485e394712a..5cb999b50f95 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig | |||
@@ -111,7 +111,7 @@ config DELL_WMI_AIO | |||
111 | All-In-One machines. | 111 | All-In-One machines. |
112 | 112 | ||
113 | To compile this driver as a module, choose M here: the module will | 113 | To compile this driver as a module, choose M here: the module will |
114 | be called dell-wmi. | 114 | be called dell-wmi-aio. |
115 | 115 | ||
116 | 116 | ||
117 | config FUJITSU_LAPTOP | 117 | config FUJITSU_LAPTOP |
@@ -753,4 +753,11 @@ config SAMSUNG_LAPTOP | |||
753 | To compile this driver as a module, choose M here: the module | 753 | To compile this driver as a module, choose M here: the module |
754 | will be called samsung-laptop. | 754 | will be called samsung-laptop. |
755 | 755 | ||
756 | config MXM_WMI | ||
757 | tristate "WMI support for MXM Laptop Graphics" | ||
758 | depends on ACPI_WMI | ||
759 | ---help--- | ||
760 | MXM is a standard for laptop graphics cards, the WMI interface | ||
761 | is required for switchable nvidia graphics machines | ||
762 | |||
756 | endif # X86_PLATFORM_DEVICES | 763 | endif # X86_PLATFORM_DEVICES |
diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile index 029e8861d086..a7ab3bc7b3a1 100644 --- a/drivers/platform/x86/Makefile +++ b/drivers/platform/x86/Makefile | |||
@@ -42,3 +42,4 @@ obj-$(CONFIG_XO15_EBOOK) += xo15-ebook.o | |||
42 | obj-$(CONFIG_IBM_RTL) += ibm_rtl.o | 42 | obj-$(CONFIG_IBM_RTL) += ibm_rtl.o |
43 | obj-$(CONFIG_SAMSUNG_LAPTOP) += samsung-laptop.o | 43 | obj-$(CONFIG_SAMSUNG_LAPTOP) += samsung-laptop.o |
44 | obj-$(CONFIG_INTEL_MFLD_THERMAL) += intel_mid_thermal.o | 44 | obj-$(CONFIG_INTEL_MFLD_THERMAL) += intel_mid_thermal.o |
45 | obj-$(CONFIG_MXM_WMI) += mxm-wmi.o | ||
diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c index 94a114aa8e28..b1396e5b2953 100644 --- a/drivers/platform/x86/ibm_rtl.c +++ b/drivers/platform/x86/ibm_rtl.c | |||
@@ -81,6 +81,19 @@ static void __iomem *rtl_cmd_addr; | |||
81 | static u8 rtl_cmd_type; | 81 | static u8 rtl_cmd_type; |
82 | static u8 rtl_cmd_width; | 82 | static u8 rtl_cmd_width; |
83 | 83 | ||
84 | #ifndef readq | ||
85 | static inline __u64 readq(const volatile void __iomem *addr) | ||
86 | { | ||
87 | const volatile u32 __iomem *p = addr; | ||
88 | u32 low, high; | ||
89 | |||
90 | low = readl(p); | ||
91 | high = readl(p + 1); | ||
92 | |||
93 | return low + ((u64)high << 32); | ||
94 | } | ||
95 | #endif | ||
96 | |||
84 | static void __iomem *rtl_port_map(phys_addr_t addr, unsigned long len) | 97 | static void __iomem *rtl_port_map(phys_addr_t addr, unsigned long len) |
85 | { | 98 | { |
86 | if (rtl_cmd_type == RTL_ADDR_TYPE_MMIO) | 99 | if (rtl_cmd_type == RTL_ADDR_TYPE_MMIO) |
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c index 85c8ad43c0c5..5ffe7c398148 100644 --- a/drivers/platform/x86/intel_ips.c +++ b/drivers/platform/x86/intel_ips.c | |||
@@ -344,6 +344,19 @@ struct ips_driver { | |||
344 | static bool | 344 | static bool |
345 | ips_gpu_turbo_enabled(struct ips_driver *ips); | 345 | ips_gpu_turbo_enabled(struct ips_driver *ips); |
346 | 346 | ||
347 | #ifndef readq | ||
348 | static inline __u64 readq(const volatile void __iomem *addr) | ||
349 | { | ||
350 | const volatile u32 __iomem *p = addr; | ||
351 | u32 low, high; | ||
352 | |||
353 | low = readl(p); | ||
354 | high = readl(p + 1); | ||
355 | |||
356 | return low + ((u64)high << 32); | ||
357 | } | ||
358 | #endif | ||
359 | |||
347 | /** | 360 | /** |
348 | * ips_cpu_busy - is CPU busy? | 361 | * ips_cpu_busy - is CPU busy? |
349 | * @ips: IPS driver struct | 362 | * @ips: IPS driver struct |
diff --git a/drivers/platform/x86/mxm-wmi.c b/drivers/platform/x86/mxm-wmi.c new file mode 100644 index 000000000000..0aea63b3729a --- /dev/null +++ b/drivers/platform/x86/mxm-wmi.c | |||
@@ -0,0 +1,111 @@ | |||
1 | /* | ||
2 | * MXM WMI driver | ||
3 | * | ||
4 | * Copyright(C) 2010 Red Hat. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | #include <linux/kernel.h> | ||
21 | #include <linux/module.h> | ||
22 | #include <linux/init.h> | ||
23 | #include <acpi/acpi_bus.h> | ||
24 | #include <acpi/acpi_drivers.h> | ||
25 | |||
26 | MODULE_AUTHOR("Dave Airlie"); | ||
27 | MODULE_DESCRIPTION("MXM WMI Driver"); | ||
28 | MODULE_LICENSE("GPL"); | ||
29 | |||
30 | #define MXM_WMMX_GUID "F6CB5C3C-9CAE-4EBD-B577-931EA32A2CC0" | ||
31 | |||
32 | MODULE_ALIAS("wmi:"MXM_WMMX_GUID); | ||
33 | |||
34 | #define MXM_WMMX_FUNC_MXDS 0x5344584D /* "MXDS" */ | ||
35 | #define MXM_WMMX_FUNC_MXMX 0x53445344 /* "MXMX" */ | ||
36 | |||
37 | struct mxds_args { | ||
38 | u32 func; | ||
39 | u32 args; | ||
40 | u32 xarg; | ||
41 | }; | ||
42 | |||
43 | int mxm_wmi_call_mxds(int adapter) | ||
44 | { | ||
45 | struct mxds_args args = { | ||
46 | .func = MXM_WMMX_FUNC_MXDS, | ||
47 | .args = 0, | ||
48 | .xarg = 1, | ||
49 | }; | ||
50 | struct acpi_buffer input = { (acpi_size)sizeof(args), &args }; | ||
51 | struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL }; | ||
52 | acpi_status status; | ||
53 | |||
54 | printk("calling mux switch %d\n", adapter); | ||
55 | |||
56 | status = wmi_evaluate_method(MXM_WMMX_GUID, 0x1, adapter, &input, | ||
57 | &output); | ||
58 | |||
59 | if (ACPI_FAILURE(status)) | ||
60 | return status; | ||
61 | |||
62 | printk("mux switched %d\n", status); | ||
63 | return 0; | ||
64 | |||
65 | } | ||
66 | EXPORT_SYMBOL_GPL(mxm_wmi_call_mxds); | ||
67 | |||
68 | int mxm_wmi_call_mxmx(int adapter) | ||
69 | { | ||
70 | struct mxds_args args = { | ||
71 | .func = MXM_WMMX_FUNC_MXMX, | ||
72 | .args = 0, | ||
73 | .xarg = 1, | ||
74 | }; | ||
75 | struct acpi_buffer input = { (acpi_size)sizeof(args), &args }; | ||
76 | struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL }; | ||
77 | acpi_status status; | ||
78 | |||
79 | printk("calling mux switch %d\n", adapter); | ||
80 | |||
81 | status = wmi_evaluate_method(MXM_WMMX_GUID, 0x1, adapter, &input, | ||
82 | &output); | ||
83 | |||
84 | if (ACPI_FAILURE(status)) | ||
85 | return status; | ||
86 | |||
87 | printk("mux mutex set switched %d\n", status); | ||
88 | return 0; | ||
89 | |||
90 | } | ||
91 | EXPORT_SYMBOL_GPL(mxm_wmi_call_mxmx); | ||
92 | |||
93 | bool mxm_wmi_supported(void) | ||
94 | { | ||
95 | bool guid_valid; | ||
96 | guid_valid = wmi_has_guid(MXM_WMMX_GUID); | ||
97 | return guid_valid; | ||
98 | } | ||
99 | EXPORT_SYMBOL_GPL(mxm_wmi_supported); | ||
100 | |||
101 | static int __init mxm_wmi_init(void) | ||
102 | { | ||
103 | return 0; | ||
104 | } | ||
105 | |||
106 | static void __exit mxm_wmi_exit(void) | ||
107 | { | ||
108 | } | ||
109 | |||
110 | module_init(mxm_wmi_init); | ||
111 | module_exit(mxm_wmi_exit); | ||