]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ACPI: thermal: create "thermal.act=" to disable or override active trip point
authorLen Brown <len.brown@intel.com>
Sun, 12 Aug 2007 04:12:54 +0000 (00:12 -0400)
committerLen Brown <len.brown@intel.com>
Sun, 12 Aug 2007 04:12:54 +0000 (00:12 -0400)
thermal.act=-1 disables all active trip points
in all ACPI thermal zones.

thermal.act=C, where C > 0, overrides all lowest temperature
active trip points in all thermal zones to C degrees Celsius.
Raising this trip-point may allow you to keep your system silent
up to a higher temperature.  However, it will not allow you to
raise the lowest temperature trip point above the next higher
trip point (if there is one).  Lowering this trip point may
kick in the fan sooner.

Note that overriding this trip-point will disable any BIOS attempts
to implement hysteresis around the lowest temperature trip point.
This may result in the fan starting and stopping frequently
if temperature frequently crosses C.

WARNING: raising trip points above the manufacturer's defaults
may cause the system to run at higher temperature and shorten
its life.

Signed-off-by: Len Brown <len.brown@intel.com>
Documentation/kernel-parameters.txt
drivers/acpi/thermal.c

index 4c7d2774d2a40e9cc5aa516dd5ae78cede1a7883..06db892b558a7339f4e11007a9d8a684b3d0ba01 100644 (file)
@@ -1820,6 +1820,10 @@ and is between 256 and 4096 characters. It is defined in the file
        thash_entries=  [KNL,NET]
                        Set number of hash buckets for TCP connection
 
+       thermal.act=    [HW,ACPI]
+                       -1: disable all active trip points in all thermal zones
+                       <degrees C>: override all lowest active trip points
+
        thermal.nocrt=  [HW,ACPI]
                        Set to disable actions on ACPI thermal zone
                        critical and hot trip points.
index 57d05ff44dd1a4c1a0b72aaec3f43c2e730e160e..3521c37bbd3390c3a74e7c5fa2efb77eb5ffb4ee 100644 (file)
@@ -74,6 +74,10 @@ MODULE_AUTHOR("Paul Diefenbaugh");
 MODULE_DESCRIPTION("ACPI Thermal Zone Driver");
 MODULE_LICENSE("GPL");
 
+static int act;
+module_param(act, int, 0644);
+MODULE_PARM_DESC(act, "Disable or override all lowest active trip points.\n");
+
 static int tzp;
 module_param(tzp, int, 0444);
 MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n");
@@ -405,11 +409,33 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
 
                char name[5] = { '_', 'A', 'C', ('0' + i), '\0' };
 
-               status =
-                   acpi_evaluate_integer(tz->device->handle, name, NULL,
-                                         &tz->trips.active[i].temperature);
-               if (ACPI_FAILURE(status))
+               if (act == -1)
+                       break;  /* disable all active trip points */
+
+               status = acpi_evaluate_integer(tz->device->handle,
+                       name, NULL, &tz->trips.active[i].temperature);
+
+               if (ACPI_FAILURE(status)) {
+                       if (i == 0)     /* no active trip points */
+                               break;
+                       if (act <= 0)   /* no override requested */
+                               break;
+                       if (i == 1) {   /* 1 trip point */
+                               tz->trips.active[0].temperature =
+                                       CELSIUS_TO_KELVIN(act);
+                       } else {        /* multiple trips */
+                               /*
+                                * Don't allow override higher than
+                                * the next higher trip point
+                                */
+                               tz->trips.active[i - 1].temperature =
+                                   (tz->trips.active[i - 2].temperature <
+                                       CELSIUS_TO_KELVIN(act) ?
+                                       tz->trips.active[i - 2].temperature :
+                                       CELSIUS_TO_KELVIN(act));
+                       }
                        break;
+               }
 
                name[2] = 'L';
                status =