diff options
author | Len Brown <len.brown@intel.com> | 2007-08-24 22:26:19 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-08-24 22:26:19 -0400 |
commit | 519ef1af47bb7379c4c06aeba2d78073df92c151 (patch) | |
tree | 252d5f5a3b8b9209bb2b6b022a44f1597329dedb | |
parent | b7011d538625dd89f6b0785d9225c5726550f6f1 (diff) | |
parent | 2db9ccba8d4bb8e3aa6d0cd8e7544c5736963bbc (diff) |
Pull thermal into release branch
-rw-r--r-- | Documentation/kernel-parameters.txt | 4 | ||||
-rw-r--r-- | drivers/acpi/thermal.c | 47 |
2 files changed, 44 insertions, 7 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 17770b456310..b41cde31d112 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -1823,6 +1823,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1823 | -1: disable all active trip points in all thermal zones | 1823 | -1: disable all active trip points in all thermal zones |
1824 | <degrees C>: override all lowest active trip points | 1824 | <degrees C>: override all lowest active trip points |
1825 | 1825 | ||
1826 | thermal.crt= [HW,ACPI] | ||
1827 | -1: disable all critical trip points in all thermal zones | ||
1828 | <degrees C>: lower all critical trip points | ||
1829 | |||
1826 | thermal.nocrt= [HW,ACPI] | 1830 | thermal.nocrt= [HW,ACPI] |
1827 | Set to disable actions on ACPI thermal zone | 1831 | Set to disable actions on ACPI thermal zone |
1828 | critical and hot trip points. | 1832 | critical and hot trip points. |
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 1e06159fd9c4..7e8f48b7f9af 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -77,23 +77,27 @@ MODULE_LICENSE("GPL"); | |||
77 | 77 | ||
78 | static int act; | 78 | static int act; |
79 | module_param(act, int, 0644); | 79 | module_param(act, int, 0644); |
80 | MODULE_PARM_DESC(act, "Disable or override all lowest active trip points.\n"); | 80 | MODULE_PARM_DESC(act, "Disable or override all lowest active trip points."); |
81 | |||
82 | static int crt; | ||
83 | module_param(crt, int, 0644); | ||
84 | MODULE_PARM_DESC(crt, "Disable or lower all critical trip points."); | ||
81 | 85 | ||
82 | static int tzp; | 86 | static int tzp; |
83 | module_param(tzp, int, 0444); | 87 | module_param(tzp, int, 0444); |
84 | MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n"); | 88 | MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds."); |
85 | 89 | ||
86 | static int nocrt; | 90 | static int nocrt; |
87 | module_param(nocrt, int, 0); | 91 | module_param(nocrt, int, 0); |
88 | MODULE_PARM_DESC(nocrt, "Set to disable action on ACPI thermal zone critical and hot trips.\n"); | 92 | MODULE_PARM_DESC(nocrt, "Set to take no action upon ACPI thermal zone critical trips points."); |
89 | 93 | ||
90 | static int off; | 94 | static int off; |
91 | module_param(off, int, 0); | 95 | module_param(off, int, 0); |
92 | MODULE_PARM_DESC(off, "Set to disable ACPI thermal support.\n"); | 96 | MODULE_PARM_DESC(off, "Set to disable ACPI thermal support."); |
93 | 97 | ||
94 | static int psv; | 98 | static int psv; |
95 | module_param(psv, int, 0644); | 99 | module_param(psv, int, 0644); |
96 | MODULE_PARM_DESC(psv, "Disable or override all passive trip points.\n"); | 100 | MODULE_PARM_DESC(psv, "Disable or override all passive trip points."); |
97 | 101 | ||
98 | static int acpi_thermal_add(struct acpi_device *device); | 102 | static int acpi_thermal_add(struct acpi_device *device); |
99 | static int acpi_thermal_remove(struct acpi_device *device, int type); | 103 | static int acpi_thermal_remove(struct acpi_device *device, int type); |
@@ -340,6 +344,20 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) | |||
340 | tz->trips.critical.temperature)); | 344 | tz->trips.critical.temperature)); |
341 | } | 345 | } |
342 | 346 | ||
347 | if (tz->trips.critical.flags.valid == 1) { | ||
348 | if (crt == -1) { | ||
349 | tz->trips.critical.flags.valid = 0; | ||
350 | } else if (crt > 0) { | ||
351 | unsigned long crt_k = CELSIUS_TO_KELVIN(crt); | ||
352 | |||
353 | /* | ||
354 | * Allow override to lower critical threshold | ||
355 | */ | ||
356 | if (crt_k < tz->trips.critical.temperature) | ||
357 | tz->trips.critical.temperature = crt_k; | ||
358 | } | ||
359 | } | ||
360 | |||
343 | /* Critical Sleep (optional) */ | 361 | /* Critical Sleep (optional) */ |
344 | 362 | ||
345 | status = | 363 | status = |
@@ -1067,9 +1085,9 @@ static int acpi_thermal_add_fs(struct acpi_device *device) | |||
1067 | entry->owner = THIS_MODULE; | 1085 | entry->owner = THIS_MODULE; |
1068 | } | 1086 | } |
1069 | 1087 | ||
1070 | /* 'trip_points' [R/W] */ | 1088 | /* 'trip_points' [R] */ |
1071 | entry = create_proc_entry(ACPI_THERMAL_FILE_TRIP_POINTS, | 1089 | entry = create_proc_entry(ACPI_THERMAL_FILE_TRIP_POINTS, |
1072 | S_IFREG | S_IRUGO | S_IWUSR, | 1090 | S_IRUGO, |
1073 | acpi_device_dir(device)); | 1091 | acpi_device_dir(device)); |
1074 | if (!entry) | 1092 | if (!entry) |
1075 | return -ENODEV; | 1093 | return -ENODEV; |
@@ -1339,6 +1357,13 @@ static int thermal_act(struct dmi_system_id *d) { | |||
1339 | } | 1357 | } |
1340 | return 0; | 1358 | return 0; |
1341 | } | 1359 | } |
1360 | static int thermal_nocrt(struct dmi_system_id *d) { | ||
1361 | |||
1362 | printk(KERN_NOTICE "ACPI: %s detected: " | ||
1363 | "disabling all critical thermal trip point actions.\n", d->ident); | ||
1364 | nocrt = 1; | ||
1365 | return 0; | ||
1366 | } | ||
1342 | static int thermal_tzp(struct dmi_system_id *d) { | 1367 | static int thermal_tzp(struct dmi_system_id *d) { |
1343 | 1368 | ||
1344 | if (tzp == 0) { | 1369 | if (tzp == 0) { |
@@ -1387,6 +1412,14 @@ static struct dmi_system_id thermal_dmi_table[] __initdata = { | |||
1387 | DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), | 1412 | DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), |
1388 | }, | 1413 | }, |
1389 | }, | 1414 | }, |
1415 | { | ||
1416 | .callback = thermal_nocrt, | ||
1417 | .ident = "Gigabyte GA-7ZX", | ||
1418 | .matches = { | ||
1419 | DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co., Ltd."), | ||
1420 | DMI_MATCH(DMI_BOARD_NAME, "7ZX"), | ||
1421 | }, | ||
1422 | }, | ||
1390 | {} | 1423 | {} |
1391 | }; | 1424 | }; |
1392 | #endif /* CONFIG_DMI */ | 1425 | #endif /* CONFIG_DMI */ |