acerhdf: added critical trip point
authorPeter Feuerer <peter@piie.net>
Fri, 28 Nov 2014 14:20:51 +0000 (15:20 +0100)
committerDarren Hart <dvhart@linux.intel.com>
Thu, 4 Dec 2014 11:24:55 +0000 (03:24 -0800)
added critical trip point which represents the temperature limit.
Added return -EINVAL in case wrong trip point is provided.

Cc: platform-driver-x86@vger.kernel.org
Cc: Darren Hart <dvhart@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andreas Mohr <andi@lisas.de>
Cc: Borislav Petkov <bp@suse.de>
Cc: Javi Merino <javi.merino@arm.com>
Signed-off-by: Peter Feuerer <peter@piie.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
drivers/platform/x86/acerhdf.c

index 7fe7dbf2f4ef2644c352f1bd1d279074df97da8a..91b16c8a45bd818ca33d23a3c4a17a8112a7bbf6 100644 (file)
@@ -443,6 +443,10 @@ static int acerhdf_get_trip_type(struct thermal_zone_device *thermal, int trip,
 {
        if (trip == 0)
                *type = THERMAL_TRIP_ACTIVE;
+       else if (trip == 1)
+               *type = THERMAL_TRIP_CRITICAL;
+       else
+               return -EINVAL;
 
        return 0;
 }
@@ -463,6 +467,10 @@ static int acerhdf_get_trip_temp(struct thermal_zone_device *thermal, int trip,
 {
        if (trip == 0)
                *temp = fanon;
+       else if (trip == 1)
+               *temp = ACERHDF_TEMP_CRIT;
+       else
+               return -EINVAL;
 
        return 0;
 }
@@ -713,7 +721,7 @@ static int acerhdf_register_thermal(void)
        if (IS_ERR(cl_dev))
                return -EINVAL;
 
-       thz_dev = thermal_zone_device_register("acerhdf", 1, 0, NULL,
+       thz_dev = thermal_zone_device_register("acerhdf", 2, 0, NULL,
                                              &acerhdf_dev_ops,
                                              &acerhdf_zone_params, 0,
                                              (kernelmode) ? interval*1000 : 0);
This page took 0.025384 seconds and 5 git commands to generate.