diff options
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r-- | drivers/acpi/thermal.c | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 2c9cfe297f73..bc6d5866ef98 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 = |
@@ -1075,9 +1093,9 @@ static int acpi_thermal_add_fs(struct acpi_device *device) | |||
1075 | entry->owner = THIS_MODULE; | 1093 | entry->owner = THIS_MODULE; |
1076 | } | 1094 | } |
1077 | 1095 | ||
1078 | /* 'trip_points' [R/W] */ | 1096 | /* 'trip_points' [R] */ |
1079 | entry = create_proc_entry(ACPI_THERMAL_FILE_TRIP_POINTS, | 1097 | entry = create_proc_entry(ACPI_THERMAL_FILE_TRIP_POINTS, |
1080 | S_IFREG | S_IRUGO | S_IWUSR, | 1098 | S_IRUGO, |
1081 | acpi_device_dir(device)); | 1099 | acpi_device_dir(device)); |
1082 | if (!entry) | 1100 | if (!entry) |
1083 | return -ENODEV; | 1101 | return -ENODEV; |
@@ -1351,6 +1369,13 @@ static int thermal_act(struct dmi_system_id *d) { | |||
1351 | } | 1369 | } |
1352 | return 0; | 1370 | return 0; |
1353 | } | 1371 | } |
1372 | static int thermal_nocrt(struct dmi_system_id *d) { | ||
1373 | |||
1374 | printk(KERN_NOTICE "ACPI: %s detected: " | ||
1375 | "disabling all critical thermal trip point actions.\n", d->ident); | ||
1376 | nocrt = 1; | ||
1377 | return 0; | ||
1378 | } | ||
1354 | static int thermal_tzp(struct dmi_system_id *d) { | 1379 | static int thermal_tzp(struct dmi_system_id *d) { |
1355 | 1380 | ||
1356 | if (tzp == 0) { | 1381 | if (tzp == 0) { |
@@ -1399,6 +1424,14 @@ static struct dmi_system_id thermal_dmi_table[] __initdata = { | |||
1399 | DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), | 1424 | DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), |
1400 | }, | 1425 | }, |
1401 | }, | 1426 | }, |
1427 | { | ||
1428 | .callback = thermal_nocrt, | ||
1429 | .ident = "Gigabyte GA-7ZX", | ||
1430 | .matches = { | ||
1431 | DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co., Ltd."), | ||
1432 | DMI_MATCH(DMI_BOARD_NAME, "7ZX"), | ||
1433 | }, | ||
1434 | }, | ||
1402 | {} | 1435 | {} |
1403 | }; | 1436 | }; |
1404 | #endif /* CONFIG_DMI */ | 1437 | #endif /* CONFIG_DMI */ |