diff options
author | Jeremy Erickson <jerickso@cs.unc.edu> | 2014-04-18 17:06:00 -0400 |
---|---|---|
committer | Jeremy Erickson <jerickso@cs.unc.edu> | 2014-04-18 17:06:00 -0400 |
commit | a215aa7b9ab3759c047201199fba64d3042d7f13 (patch) | |
tree | bca37493d9b2233450e6d3ffced1261d0e4f71fe /drivers/platform/x86 | |
parent | d31199a77ef606f1d06894385f1852181ba6136b (diff) |
Update 2.6.36 to 2.6.36.4wip-dissipation2-jerickso
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r-- | drivers/platform/x86/asus-laptop.c | 6 | ||||
-rw-r--r-- | drivers/platform/x86/intel_ips.c | 36 | ||||
-rw-r--r-- | drivers/platform/x86/wmi.c | 2 |
3 files changed, 37 insertions, 7 deletions
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index b756e07d41b4..e8acb1c7b194 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c | |||
@@ -1065,9 +1065,9 @@ static ssize_t store_gps(struct device *dev, struct device_attribute *attr, | |||
1065 | */ | 1065 | */ |
1066 | static int asus_gps_rfkill_set(void *data, bool blocked) | 1066 | static int asus_gps_rfkill_set(void *data, bool blocked) |
1067 | { | 1067 | { |
1068 | acpi_handle handle = data; | 1068 | struct asus_laptop *asus = data; |
1069 | 1069 | ||
1070 | return asus_gps_switch(handle, !blocked); | 1070 | return asus_gps_switch(asus, !blocked); |
1071 | } | 1071 | } |
1072 | 1072 | ||
1073 | static const struct rfkill_ops asus_gps_rfkill_ops = { | 1073 | static const struct rfkill_ops asus_gps_rfkill_ops = { |
@@ -1094,7 +1094,7 @@ static int asus_rfkill_init(struct asus_laptop *asus) | |||
1094 | 1094 | ||
1095 | asus->gps_rfkill = rfkill_alloc("asus-gps", &asus->platform_device->dev, | 1095 | asus->gps_rfkill = rfkill_alloc("asus-gps", &asus->platform_device->dev, |
1096 | RFKILL_TYPE_GPS, | 1096 | RFKILL_TYPE_GPS, |
1097 | &asus_gps_rfkill_ops, NULL); | 1097 | &asus_gps_rfkill_ops, asus); |
1098 | if (!asus->gps_rfkill) | 1098 | if (!asus->gps_rfkill) |
1099 | return -EINVAL; | 1099 | return -EINVAL; |
1100 | 1100 | ||
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/wmi.c b/drivers/platform/x86/wmi.c index b2978a04317f..677783475d84 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c | |||
@@ -801,7 +801,7 @@ static bool guid_already_parsed(const char *guid_string) | |||
801 | wblock = list_entry(p, struct wmi_block, list); | 801 | wblock = list_entry(p, struct wmi_block, list); |
802 | gblock = &wblock->gblock; | 802 | gblock = &wblock->gblock; |
803 | 803 | ||
804 | if (strncmp(gblock->guid, guid_string, 16) == 0) | 804 | if (memcmp(gblock->guid, guid_string, 16) == 0) |
805 | return true; | 805 | return true; |
806 | } | 806 | } |
807 | return false; | 807 | return false; |