diff options
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/asus-laptop.c | 97 | ||||
-rw-r--r-- | drivers/platform/x86/eeepc-wmi.c | 4 | ||||
-rw-r--r-- | drivers/platform/x86/fujitsu-laptop.c | 4 | ||||
-rw-r--r-- | drivers/platform/x86/hp-wmi.c | 2 | ||||
-rw-r--r-- | drivers/platform/x86/ibm_rtl.c | 34 | ||||
-rw-r--r-- | drivers/platform/x86/intel_ips.c | 36 | ||||
-rw-r--r-- | drivers/platform/x86/intel_ips.h | 21 | ||||
-rw-r--r-- | drivers/platform/x86/msi-wmi.c | 16 | ||||
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 1 | ||||
-rw-r--r-- | drivers/platform/x86/toshiba_acpi.c | 1 | ||||
-rw-r--r-- | drivers/platform/x86/wmi.c | 2 |
11 files changed, 175 insertions, 43 deletions
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index 60a5a5c6b50a..d235f44fd7a3 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c | |||
@@ -81,6 +81,8 @@ MODULE_PARM_DESC(wapf, "WAPF value"); | |||
81 | 81 | ||
82 | static int wlan_status = 1; | 82 | static int wlan_status = 1; |
83 | static int bluetooth_status = 1; | 83 | static int bluetooth_status = 1; |
84 | static int wimax_status = -1; | ||
85 | static int wwan_status = -1; | ||
84 | 86 | ||
85 | module_param(wlan_status, int, 0444); | 87 | module_param(wlan_status, int, 0444); |
86 | MODULE_PARM_DESC(wlan_status, "Set the wireless status on boot " | 88 | MODULE_PARM_DESC(wlan_status, "Set the wireless status on boot " |
@@ -92,6 +94,16 @@ MODULE_PARM_DESC(bluetooth_status, "Set the wireless status on boot " | |||
92 | "(0 = disabled, 1 = enabled, -1 = don't do anything). " | 94 | "(0 = disabled, 1 = enabled, -1 = don't do anything). " |
93 | "default is 1"); | 95 | "default is 1"); |
94 | 96 | ||
97 | module_param(wimax_status, int, 0444); | ||
98 | MODULE_PARM_DESC(wimax_status, "Set the wireless status on boot " | ||
99 | "(0 = disabled, 1 = enabled, -1 = don't do anything). " | ||
100 | "default is 1"); | ||
101 | |||
102 | module_param(wwan_status, int, 0444); | ||
103 | MODULE_PARM_DESC(wwan_status, "Set the wireless status on boot " | ||
104 | "(0 = disabled, 1 = enabled, -1 = don't do anything). " | ||
105 | "default is 1"); | ||
106 | |||
95 | /* | 107 | /* |
96 | * Some events we use, same for all Asus | 108 | * Some events we use, same for all Asus |
97 | */ | 109 | */ |
@@ -114,6 +126,8 @@ MODULE_PARM_DESC(bluetooth_status, "Set the wireless status on boot " | |||
114 | */ | 126 | */ |
115 | #define WL_RSTS 0x01 /* internal Wifi */ | 127 | #define WL_RSTS 0x01 /* internal Wifi */ |
116 | #define BT_RSTS 0x02 /* internal Bluetooth */ | 128 | #define BT_RSTS 0x02 /* internal Bluetooth */ |
129 | #define WM_RSTS 0x08 /* internal wimax */ | ||
130 | #define WW_RSTS 0x20 /* internal wwan */ | ||
117 | 131 | ||
118 | /* LED */ | 132 | /* LED */ |
119 | #define METHOD_MLED "MLED" | 133 | #define METHOD_MLED "MLED" |
@@ -132,6 +146,11 @@ MODULE_PARM_DESC(bluetooth_status, "Set the wireless status on boot " | |||
132 | */ | 146 | */ |
133 | #define METHOD_WLAN "WLED" | 147 | #define METHOD_WLAN "WLED" |
134 | #define METHOD_BLUETOOTH "BLED" | 148 | #define METHOD_BLUETOOTH "BLED" |
149 | |||
150 | /* WWAN and WIMAX */ | ||
151 | #define METHOD_WWAN "GSMC" | ||
152 | #define METHOD_WIMAX "WMXC" | ||
153 | |||
135 | #define METHOD_WL_STATUS "RSTS" | 154 | #define METHOD_WL_STATUS "RSTS" |
136 | 155 | ||
137 | /* Brightness */ | 156 | /* Brightness */ |
@@ -883,6 +902,64 @@ static ssize_t store_bluetooth(struct device *dev, | |||
883 | } | 902 | } |
884 | 903 | ||
885 | /* | 904 | /* |
905 | * Wimax | ||
906 | */ | ||
907 | static int asus_wimax_set(struct asus_laptop *asus, int status) | ||
908 | { | ||
909 | if (write_acpi_int(asus->handle, METHOD_WIMAX, !!status)) { | ||
910 | pr_warning("Error setting wimax status to %d", status); | ||
911 | return -EIO; | ||
912 | } | ||
913 | return 0; | ||
914 | } | ||
915 | |||
916 | static ssize_t show_wimax(struct device *dev, | ||
917 | struct device_attribute *attr, char *buf) | ||
918 | { | ||
919 | struct asus_laptop *asus = dev_get_drvdata(dev); | ||
920 | |||
921 | return sprintf(buf, "%d\n", asus_wireless_status(asus, WM_RSTS)); | ||
922 | } | ||
923 | |||
924 | static ssize_t store_wimax(struct device *dev, | ||
925 | struct device_attribute *attr, const char *buf, | ||
926 | size_t count) | ||
927 | { | ||
928 | struct asus_laptop *asus = dev_get_drvdata(dev); | ||
929 | |||
930 | return sysfs_acpi_set(asus, buf, count, METHOD_WIMAX); | ||
931 | } | ||
932 | |||
933 | /* | ||
934 | * Wwan | ||
935 | */ | ||
936 | static int asus_wwan_set(struct asus_laptop *asus, int status) | ||
937 | { | ||
938 | if (write_acpi_int(asus->handle, METHOD_WWAN, !!status)) { | ||
939 | pr_warning("Error setting wwan status to %d", status); | ||
940 | return -EIO; | ||
941 | } | ||
942 | return 0; | ||
943 | } | ||
944 | |||
945 | static ssize_t show_wwan(struct device *dev, | ||
946 | struct device_attribute *attr, char *buf) | ||
947 | { | ||
948 | struct asus_laptop *asus = dev_get_drvdata(dev); | ||
949 | |||
950 | return sprintf(buf, "%d\n", asus_wireless_status(asus, WW_RSTS)); | ||
951 | } | ||
952 | |||
953 | static ssize_t store_wwan(struct device *dev, | ||
954 | struct device_attribute *attr, const char *buf, | ||
955 | size_t count) | ||
956 | { | ||
957 | struct asus_laptop *asus = dev_get_drvdata(dev); | ||
958 | |||
959 | return sysfs_acpi_set(asus, buf, count, METHOD_WWAN); | ||
960 | } | ||
961 | |||
962 | /* | ||
886 | * Display | 963 | * Display |
887 | */ | 964 | */ |
888 | static void asus_set_display(struct asus_laptop *asus, int value) | 965 | static void asus_set_display(struct asus_laptop *asus, int value) |
@@ -1202,6 +1279,8 @@ static DEVICE_ATTR(infos, S_IRUGO, show_infos, NULL); | |||
1202 | static DEVICE_ATTR(wlan, S_IRUGO | S_IWUSR, show_wlan, store_wlan); | 1279 | static DEVICE_ATTR(wlan, S_IRUGO | S_IWUSR, show_wlan, store_wlan); |
1203 | static DEVICE_ATTR(bluetooth, S_IRUGO | S_IWUSR, | 1280 | static DEVICE_ATTR(bluetooth, S_IRUGO | S_IWUSR, |
1204 | show_bluetooth, store_bluetooth); | 1281 | show_bluetooth, store_bluetooth); |
1282 | static DEVICE_ATTR(wimax, S_IRUGO | S_IWUSR, show_wimax, store_wimax); | ||
1283 | static DEVICE_ATTR(wwan, S_IRUGO | S_IWUSR, show_wwan, store_wwan); | ||
1205 | static DEVICE_ATTR(display, S_IRUGO | S_IWUSR, show_disp, store_disp); | 1284 | static DEVICE_ATTR(display, S_IRUGO | S_IWUSR, show_disp, store_disp); |
1206 | static DEVICE_ATTR(ledd, S_IRUGO | S_IWUSR, show_ledd, store_ledd); | 1285 | static DEVICE_ATTR(ledd, S_IRUGO | S_IWUSR, show_ledd, store_ledd); |
1207 | static DEVICE_ATTR(ls_level, S_IRUGO | S_IWUSR, show_lslvl, store_lslvl); | 1286 | static DEVICE_ATTR(ls_level, S_IRUGO | S_IWUSR, show_lslvl, store_lslvl); |
@@ -1212,6 +1291,8 @@ static struct attribute *asus_attributes[] = { | |||
1212 | &dev_attr_infos.attr, | 1291 | &dev_attr_infos.attr, |
1213 | &dev_attr_wlan.attr, | 1292 | &dev_attr_wlan.attr, |
1214 | &dev_attr_bluetooth.attr, | 1293 | &dev_attr_bluetooth.attr, |
1294 | &dev_attr_wimax.attr, | ||
1295 | &dev_attr_wwan.attr, | ||
1215 | &dev_attr_display.attr, | 1296 | &dev_attr_display.attr, |
1216 | &dev_attr_ledd.attr, | 1297 | &dev_attr_ledd.attr, |
1217 | &dev_attr_ls_level.attr, | 1298 | &dev_attr_ls_level.attr, |
@@ -1239,6 +1320,13 @@ static mode_t asus_sysfs_is_visible(struct kobject *kobj, | |||
1239 | } else if (attr == &dev_attr_display.attr) { | 1320 | } else if (attr == &dev_attr_display.attr) { |
1240 | supported = !acpi_check_handle(handle, METHOD_SWITCH_DISPLAY, NULL); | 1321 | supported = !acpi_check_handle(handle, METHOD_SWITCH_DISPLAY, NULL); |
1241 | 1322 | ||
1323 | } else if (attr == &dev_attr_wimax.attr) { | ||
1324 | supported = | ||
1325 | !acpi_check_handle(asus->handle, METHOD_WIMAX, NULL); | ||
1326 | |||
1327 | } else if (attr == &dev_attr_wwan.attr) { | ||
1328 | supported = !acpi_check_handle(asus->handle, METHOD_WWAN, NULL); | ||
1329 | |||
1242 | } else if (attr == &dev_attr_ledd.attr) { | 1330 | } else if (attr == &dev_attr_ledd.attr) { |
1243 | supported = !acpi_check_handle(handle, METHOD_LEDD, NULL); | 1331 | supported = !acpi_check_handle(handle, METHOD_LEDD, NULL); |
1244 | 1332 | ||
@@ -1397,7 +1485,8 @@ static int asus_laptop_get_info(struct asus_laptop *asus) | |||
1397 | 1485 | ||
1398 | /* | 1486 | /* |
1399 | * The HWRS method return informations about the hardware. | 1487 | * The HWRS method return informations about the hardware. |
1400 | * 0x80 bit is for WLAN, 0x100 for Bluetooth. | 1488 | * 0x80 bit is for WLAN, 0x100 for Bluetooth, |
1489 | * 0x40 for WWAN, 0x10 for WIMAX. | ||
1401 | * The significance of others is yet to be found. | 1490 | * The significance of others is yet to be found. |
1402 | */ | 1491 | */ |
1403 | status = | 1492 | status = |
@@ -1440,6 +1529,12 @@ static int __devinit asus_acpi_init(struct asus_laptop *asus) | |||
1440 | if (wlan_status >= 0) | 1529 | if (wlan_status >= 0) |
1441 | asus_wlan_set(asus, !!wlan_status); | 1530 | asus_wlan_set(asus, !!wlan_status); |
1442 | 1531 | ||
1532 | if (wimax_status >= 0) | ||
1533 | asus_wimax_set(asus, !!wimax_status); | ||
1534 | |||
1535 | if (wwan_status >= 0) | ||
1536 | asus_wwan_set(asus, !!wwan_status); | ||
1537 | |||
1443 | /* Keyboard Backlight is on by default */ | 1538 | /* Keyboard Backlight is on by default */ |
1444 | if (!acpi_check_handle(asus->handle, METHOD_KBD_LIGHT_SET, NULL)) | 1539 | if (!acpi_check_handle(asus->handle, METHOD_KBD_LIGHT_SET, NULL)) |
1445 | asus_kled_set(asus, 1); | 1540 | asus_kled_set(asus, 1); |
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c index 462ceab93f87..0d50fbbe2478 100644 --- a/drivers/platform/x86/eeepc-wmi.c +++ b/drivers/platform/x86/eeepc-wmi.c | |||
@@ -298,8 +298,8 @@ static void eeepc_wmi_notify(u32 value, void *context) | |||
298 | kfree(obj); | 298 | kfree(obj); |
299 | } | 299 | } |
300 | 300 | ||
301 | static int store_cpufv(struct device *dev, struct device_attribute *attr, | 301 | static ssize_t store_cpufv(struct device *dev, struct device_attribute *attr, |
302 | const char *buf, size_t count) | 302 | const char *buf, size_t count) |
303 | { | 303 | { |
304 | int value; | 304 | int value; |
305 | struct acpi_buffer input = { (acpi_size)sizeof(value), &value }; | 305 | struct acpi_buffer input = { (acpi_size)sizeof(value), &value }; |
diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index f44cd2620ff9..cf6c47250c56 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c | |||
@@ -689,7 +689,7 @@ static int acpi_fujitsu_add(struct acpi_device *device) | |||
689 | if (error) | 689 | if (error) |
690 | goto err_free_input_dev; | 690 | goto err_free_input_dev; |
691 | 691 | ||
692 | result = acpi_bus_get_power(fujitsu->acpi_handle, &state); | 692 | result = acpi_bus_update_power(fujitsu->acpi_handle, &state); |
693 | if (result) { | 693 | if (result) { |
694 | printk(KERN_ERR "Error reading power state\n"); | 694 | printk(KERN_ERR "Error reading power state\n"); |
695 | goto err_unregister_input_dev; | 695 | goto err_unregister_input_dev; |
@@ -857,7 +857,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) | |||
857 | if (error) | 857 | if (error) |
858 | goto err_free_input_dev; | 858 | goto err_free_input_dev; |
859 | 859 | ||
860 | result = acpi_bus_get_power(fujitsu_hotkey->acpi_handle, &state); | 860 | result = acpi_bus_update_power(fujitsu_hotkey->acpi_handle, &state); |
861 | if (result) { | 861 | if (result) { |
862 | printk(KERN_ERR "Error reading power state\n"); | 862 | printk(KERN_ERR "Error reading power state\n"); |
863 | goto err_unregister_input_dev; | 863 | goto err_unregister_input_dev; |
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 1dac659b5e0c..9e05af9c41cb 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c | |||
@@ -172,6 +172,8 @@ static int hp_wmi_perform_query(int query, int write, u32 *buffer, | |||
172 | bios_return = *((struct bios_return *)obj->buffer.pointer); | 172 | bios_return = *((struct bios_return *)obj->buffer.pointer); |
173 | 173 | ||
174 | memcpy(buffer, &bios_return.value, sizeof(bios_return.value)); | 174 | memcpy(buffer, &bios_return.value, sizeof(bios_return.value)); |
175 | |||
176 | kfree(obj); | ||
175 | return 0; | 177 | return 0; |
176 | } | 178 | } |
177 | 179 | ||
diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c index 3c2c6b91ecb3..94a114aa8e28 100644 --- a/drivers/platform/x86/ibm_rtl.c +++ b/drivers/platform/x86/ibm_rtl.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
29 | #include <linux/sysdev.h> | 29 | #include <linux/sysdev.h> |
30 | #include <linux/dmi.h> | 30 | #include <linux/dmi.h> |
31 | #include <linux/efi.h> | ||
31 | #include <linux/mutex.h> | 32 | #include <linux/mutex.h> |
32 | #include <asm/bios_ebda.h> | 33 | #include <asm/bios_ebda.h> |
33 | 34 | ||
@@ -220,32 +221,13 @@ static void rtl_teardown_sysfs(void) { | |||
220 | sysdev_class_unregister(&class_rtl); | 221 | sysdev_class_unregister(&class_rtl); |
221 | } | 222 | } |
222 | 223 | ||
223 | static int dmi_check_cb(const struct dmi_system_id *id) | ||
224 | { | ||
225 | RTL_DEBUG("found IBM server '%s'\n", id->ident); | ||
226 | return 0; | ||
227 | } | ||
228 | |||
229 | #define ibm_dmi_entry(NAME, TYPE) \ | ||
230 | { \ | ||
231 | .ident = NAME, \ | ||
232 | .matches = { \ | ||
233 | DMI_MATCH(DMI_SYS_VENDOR, "IBM"), \ | ||
234 | DMI_MATCH(DMI_PRODUCT_NAME, TYPE), \ | ||
235 | }, \ | ||
236 | .callback = dmi_check_cb \ | ||
237 | } | ||
238 | 224 | ||
239 | static struct dmi_system_id __initdata ibm_rtl_dmi_table[] = { | 225 | static struct dmi_system_id __initdata ibm_rtl_dmi_table[] = { |
240 | ibm_dmi_entry("BladeCenter LS21", "7971"), | 226 | { \ |
241 | ibm_dmi_entry("BladeCenter LS22", "7901"), | 227 | .matches = { \ |
242 | ibm_dmi_entry("BladeCenter HS21 XM", "7995"), | 228 | DMI_MATCH(DMI_SYS_VENDOR, "IBM"), \ |
243 | ibm_dmi_entry("BladeCenter HS22", "7870"), | 229 | }, \ |
244 | ibm_dmi_entry("BladeCenter HS22V", "7871"), | 230 | }, |
245 | ibm_dmi_entry("System x3550 M2", "7946"), | ||
246 | ibm_dmi_entry("System x3650 M2", "7947"), | ||
247 | ibm_dmi_entry("System x3550 M3", "7944"), | ||
248 | ibm_dmi_entry("System x3650 M3", "7945"), | ||
249 | { } | 231 | { } |
250 | }; | 232 | }; |
251 | 233 | ||
@@ -257,7 +239,7 @@ static int __init ibm_rtl_init(void) { | |||
257 | if (force) | 239 | if (force) |
258 | pr_warning("ibm-rtl: module loaded by force\n"); | 240 | pr_warning("ibm-rtl: module loaded by force\n"); |
259 | /* first ensure that we are running on IBM HW */ | 241 | /* first ensure that we are running on IBM HW */ |
260 | else if (!dmi_check_system(ibm_rtl_dmi_table)) | 242 | else if (efi_enabled || !dmi_check_system(ibm_rtl_dmi_table)) |
261 | return -ENODEV; | 243 | return -ENODEV; |
262 | 244 | ||
263 | /* Get the address for the Extended BIOS Data Area */ | 245 | /* Get the address for the Extended BIOS Data Area */ |
@@ -302,7 +284,7 @@ static int __init ibm_rtl_init(void) { | |||
302 | RTL_DEBUG("rtl_cmd_width = %u, rtl_cmd_type = %u\n", | 284 | RTL_DEBUG("rtl_cmd_width = %u, rtl_cmd_type = %u\n", |
303 | rtl_cmd_width, rtl_cmd_type); | 285 | rtl_cmd_width, rtl_cmd_type); |
304 | addr = ioread32(&rtl_table->cmd_port_address); | 286 | addr = ioread32(&rtl_table->cmd_port_address); |
305 | RTL_DEBUG("addr = %#llx\n", addr); | 287 | RTL_DEBUG("addr = %#llx\n", (unsigned long long)addr); |
306 | plen = rtl_cmd_width/sizeof(char); | 288 | plen = rtl_cmd_width/sizeof(char); |
307 | rtl_cmd_addr = rtl_port_map(addr, plen); | 289 | rtl_cmd_addr = rtl_port_map(addr, plen); |
308 | RTL_DEBUG("rtl_cmd_addr = %#llx\n", (u64)rtl_cmd_addr); | 290 | RTL_DEBUG("rtl_cmd_addr = %#llx\n", (u64)rtl_cmd_addr); |
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c index c44a5e8b8b82..f0b3ad13c273 100644 --- a/drivers/platform/x86/intel_ips.c +++ b/drivers/platform/x86/intel_ips.c | |||
@@ -75,6 +75,7 @@ | |||
75 | #include <drm/i915_drm.h> | 75 | #include <drm/i915_drm.h> |
76 | #include <asm/msr.h> | 76 | #include <asm/msr.h> |
77 | #include <asm/processor.h> | 77 | #include <asm/processor.h> |
78 | #include "intel_ips.h" | ||
78 | 79 | ||
79 | #define PCI_DEVICE_ID_INTEL_THERMAL_SENSOR 0x3b32 | 80 | #define PCI_DEVICE_ID_INTEL_THERMAL_SENSOR 0x3b32 |
80 | 81 | ||
@@ -245,6 +246,7 @@ | |||
245 | #define thm_writel(off, val) writel((val), ips->regmap + (off)) | 246 | #define thm_writel(off, val) writel((val), ips->regmap + (off)) |
246 | 247 | ||
247 | static const int IPS_ADJUST_PERIOD = 5000; /* ms */ | 248 | static const int IPS_ADJUST_PERIOD = 5000; /* ms */ |
249 | static bool late_i915_load = false; | ||
248 | 250 | ||
249 | /* For initial average collection */ | 251 | /* For initial average collection */ |
250 | static const int IPS_SAMPLE_PERIOD = 200; /* ms */ | 252 | static const int IPS_SAMPLE_PERIOD = 200; /* ms */ |
@@ -339,6 +341,9 @@ struct ips_driver { | |||
339 | u64 orig_turbo_ratios; | 341 | u64 orig_turbo_ratios; |
340 | }; | 342 | }; |
341 | 343 | ||
344 | static bool | ||
345 | ips_gpu_turbo_enabled(struct ips_driver *ips); | ||
346 | |||
342 | /** | 347 | /** |
343 | * ips_cpu_busy - is CPU busy? | 348 | * ips_cpu_busy - is CPU busy? |
344 | * @ips: IPS driver struct | 349 | * @ips: IPS driver struct |
@@ -517,7 +522,7 @@ static void ips_disable_cpu_turbo(struct ips_driver *ips) | |||
517 | */ | 522 | */ |
518 | static bool ips_gpu_busy(struct ips_driver *ips) | 523 | static bool ips_gpu_busy(struct ips_driver *ips) |
519 | { | 524 | { |
520 | if (!ips->gpu_turbo_enabled) | 525 | if (!ips_gpu_turbo_enabled(ips)) |
521 | return false; | 526 | return false; |
522 | 527 | ||
523 | return ips->gpu_busy(); | 528 | return ips->gpu_busy(); |
@@ -532,7 +537,7 @@ static bool ips_gpu_busy(struct ips_driver *ips) | |||
532 | */ | 537 | */ |
533 | static void ips_gpu_raise(struct ips_driver *ips) | 538 | static void ips_gpu_raise(struct ips_driver *ips) |
534 | { | 539 | { |
535 | if (!ips->gpu_turbo_enabled) | 540 | if (!ips_gpu_turbo_enabled(ips)) |
536 | return; | 541 | return; |
537 | 542 | ||
538 | if (!ips->gpu_raise()) | 543 | if (!ips->gpu_raise()) |
@@ -549,7 +554,7 @@ static void ips_gpu_raise(struct ips_driver *ips) | |||
549 | */ | 554 | */ |
550 | static void ips_gpu_lower(struct ips_driver *ips) | 555 | static void ips_gpu_lower(struct ips_driver *ips) |
551 | { | 556 | { |
552 | if (!ips->gpu_turbo_enabled) | 557 | if (!ips_gpu_turbo_enabled(ips)) |
553 | return; | 558 | return; |
554 | 559 | ||
555 | if (!ips->gpu_lower()) | 560 | if (!ips->gpu_lower()) |
@@ -1454,6 +1459,31 @@ out_err: | |||
1454 | return false; | 1459 | return false; |
1455 | } | 1460 | } |
1456 | 1461 | ||
1462 | static bool | ||
1463 | ips_gpu_turbo_enabled(struct ips_driver *ips) | ||
1464 | { | ||
1465 | if (!ips->gpu_busy && late_i915_load) { | ||
1466 | if (ips_get_i915_syms(ips)) { | ||
1467 | dev_info(&ips->dev->dev, | ||
1468 | "i915 driver attached, reenabling gpu turbo\n"); | ||
1469 | ips->gpu_turbo_enabled = !(thm_readl(THM_HTS) & HTS_GTD_DIS); | ||
1470 | } | ||
1471 | } | ||
1472 | |||
1473 | return ips->gpu_turbo_enabled; | ||
1474 | } | ||
1475 | |||
1476 | void | ||
1477 | ips_link_to_i915_driver() | ||
1478 | { | ||
1479 | /* We can't cleanly get at the various ips_driver structs from | ||
1480 | * this caller (the i915 driver), so just set a flag saying | ||
1481 | * that it's time to try getting the symbols again. | ||
1482 | */ | ||
1483 | late_i915_load = true; | ||
1484 | } | ||
1485 | EXPORT_SYMBOL_GPL(ips_link_to_i915_driver); | ||
1486 | |||
1457 | static DEFINE_PCI_DEVICE_TABLE(ips_id_table) = { | 1487 | static DEFINE_PCI_DEVICE_TABLE(ips_id_table) = { |
1458 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, | 1488 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, |
1459 | PCI_DEVICE_ID_INTEL_THERMAL_SENSOR), }, | 1489 | PCI_DEVICE_ID_INTEL_THERMAL_SENSOR), }, |
diff --git a/drivers/platform/x86/intel_ips.h b/drivers/platform/x86/intel_ips.h new file mode 100644 index 000000000000..73299beff5b3 --- /dev/null +++ b/drivers/platform/x86/intel_ips.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2010 Intel Corporation | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along with | ||
14 | * this program; if not, write to the Free Software Foundation, Inc., | ||
15 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
16 | * | ||
17 | * The full GNU General Public License is included in this distribution in | ||
18 | * the file called "COPYING". | ||
19 | */ | ||
20 | |||
21 | void ips_link_to_i915_driver(void); | ||
diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c index 42a5469a2459..35278ad7e628 100644 --- a/drivers/platform/x86/msi-wmi.c +++ b/drivers/platform/x86/msi-wmi.c | |||
@@ -43,16 +43,18 @@ MODULE_ALIAS("wmi:B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2"); | |||
43 | 43 | ||
44 | #define dprintk(msg...) pr_debug(DRV_PFX msg) | 44 | #define dprintk(msg...) pr_debug(DRV_PFX msg) |
45 | 45 | ||
46 | #define KEYCODE_BASE 0xD0 | 46 | #define SCANCODE_BASE 0xD0 |
47 | #define MSI_WMI_BRIGHTNESSUP KEYCODE_BASE | 47 | #define MSI_WMI_BRIGHTNESSUP SCANCODE_BASE |
48 | #define MSI_WMI_BRIGHTNESSDOWN (KEYCODE_BASE + 1) | 48 | #define MSI_WMI_BRIGHTNESSDOWN (SCANCODE_BASE + 1) |
49 | #define MSI_WMI_VOLUMEUP (KEYCODE_BASE + 2) | 49 | #define MSI_WMI_VOLUMEUP (SCANCODE_BASE + 2) |
50 | #define MSI_WMI_VOLUMEDOWN (KEYCODE_BASE + 3) | 50 | #define MSI_WMI_VOLUMEDOWN (SCANCODE_BASE + 3) |
51 | #define MSI_WMI_MUTE (SCANCODE_BASE + 4) | ||
51 | static struct key_entry msi_wmi_keymap[] = { | 52 | static struct key_entry msi_wmi_keymap[] = { |
52 | { KE_KEY, MSI_WMI_BRIGHTNESSUP, {KEY_BRIGHTNESSUP} }, | 53 | { KE_KEY, MSI_WMI_BRIGHTNESSUP, {KEY_BRIGHTNESSUP} }, |
53 | { KE_KEY, MSI_WMI_BRIGHTNESSDOWN, {KEY_BRIGHTNESSDOWN} }, | 54 | { KE_KEY, MSI_WMI_BRIGHTNESSDOWN, {KEY_BRIGHTNESSDOWN} }, |
54 | { KE_KEY, MSI_WMI_VOLUMEUP, {KEY_VOLUMEUP} }, | 55 | { KE_KEY, MSI_WMI_VOLUMEUP, {KEY_VOLUMEUP} }, |
55 | { KE_KEY, MSI_WMI_VOLUMEDOWN, {KEY_VOLUMEDOWN} }, | 56 | { KE_KEY, MSI_WMI_VOLUMEDOWN, {KEY_VOLUMEDOWN} }, |
57 | { KE_KEY, MSI_WMI_MUTE, {KEY_MUTE} }, | ||
56 | { KE_END, 0} | 58 | { KE_END, 0} |
57 | }; | 59 | }; |
58 | static ktime_t last_pressed[ARRAY_SIZE(msi_wmi_keymap) - 1]; | 60 | static ktime_t last_pressed[ARRAY_SIZE(msi_wmi_keymap) - 1]; |
@@ -169,7 +171,7 @@ static void msi_wmi_notify(u32 value, void *context) | |||
169 | ktime_t diff; | 171 | ktime_t diff; |
170 | cur = ktime_get_real(); | 172 | cur = ktime_get_real(); |
171 | diff = ktime_sub(cur, last_pressed[key->code - | 173 | diff = ktime_sub(cur, last_pressed[key->code - |
172 | KEYCODE_BASE]); | 174 | SCANCODE_BASE]); |
173 | /* Ignore event if the same event happened in a 50 ms | 175 | /* Ignore event if the same event happened in a 50 ms |
174 | timeframe -> Key press may result in 10-20 GPEs */ | 176 | timeframe -> Key press may result in 10-20 GPEs */ |
175 | if (ktime_to_us(diff) < 1000 * 50) { | 177 | if (ktime_to_us(diff) < 1000 * 50) { |
@@ -178,7 +180,7 @@ static void msi_wmi_notify(u32 value, void *context) | |||
178 | key->code, ktime_to_us(diff)); | 180 | key->code, ktime_to_us(diff)); |
179 | return; | 181 | return; |
180 | } | 182 | } |
181 | last_pressed[key->code - KEYCODE_BASE] = cur; | 183 | last_pressed[key->code - SCANCODE_BASE] = cur; |
182 | 184 | ||
183 | if (key->type == KE_KEY && | 185 | if (key->type == KE_KEY && |
184 | /* Brightness is served via acpi video driver */ | 186 | /* Brightness is served via acpi video driver */ |
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 2d61186ad5a2..e8c21994b36d 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -8497,7 +8497,6 @@ static void ibm_exit(struct ibm_struct *ibm) | |||
8497 | ibm->acpi->type, | 8497 | ibm->acpi->type, |
8498 | dispatch_acpi_notify); | 8498 | dispatch_acpi_notify); |
8499 | ibm->flags.acpi_notify_installed = 0; | 8499 | ibm->flags.acpi_notify_installed = 0; |
8500 | ibm->flags.acpi_notify_installed = 0; | ||
8501 | } | 8500 | } |
8502 | 8501 | ||
8503 | if (ibm->flags.proc_created) { | 8502 | if (ibm->flags.proc_created) { |
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 06f304f46e02..4276da7291b8 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c | |||
@@ -135,6 +135,7 @@ static const struct key_entry toshiba_acpi_keymap[] __initconst = { | |||
135 | { KE_KEY, 0x141, { KEY_BRIGHTNESSUP } }, | 135 | { KE_KEY, 0x141, { KEY_BRIGHTNESSUP } }, |
136 | { KE_KEY, 0x142, { KEY_WLAN } }, | 136 | { KE_KEY, 0x142, { KEY_WLAN } }, |
137 | { KE_KEY, 0x143, { KEY_PROG1 } }, | 137 | { KE_KEY, 0x143, { KEY_PROG1 } }, |
138 | { KE_KEY, 0x17f, { KEY_FN } }, | ||
138 | { KE_KEY, 0xb05, { KEY_PROG2 } }, | 139 | { KE_KEY, 0xb05, { KEY_PROG2 } }, |
139 | { KE_KEY, 0xb06, { KEY_WWW } }, | 140 | { KE_KEY, 0xb06, { KEY_WWW } }, |
140 | { KE_KEY, 0xb07, { KEY_MAIL } }, | 141 | { KE_KEY, 0xb07, { KEY_MAIL } }, |
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 104b77c87ef5..aecd9a9b549f 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c | |||
@@ -755,7 +755,7 @@ static bool guid_already_parsed(const char *guid_string) | |||
755 | struct wmi_block *wblock; | 755 | struct wmi_block *wblock; |
756 | 756 | ||
757 | list_for_each_entry(wblock, &wmi_block_list, list) | 757 | list_for_each_entry(wblock, &wmi_block_list, list) |
758 | if (strncmp(wblock->gblock.guid, guid_string, 16) == 0) | 758 | if (memcmp(wblock->gblock.guid, guid_string, 16) == 0) |
759 | return true; | 759 | return true; |
760 | 760 | ||
761 | return false; | 761 | return false; |