From 7e8b6d737da9c684f02d315e312110be21fbf992 Mon Sep 17 00:00:00 2001 From: Peter Feuerer Date: Fri, 28 Nov 2014 15:20:51 +0100 Subject: [PATCH] acerhdf: added critical trip point 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 Cc: Andrew Morton Cc: Andreas Mohr Cc: Borislav Petkov Cc: Javi Merino Signed-off-by: Peter Feuerer Signed-off-by: Darren Hart --- drivers/platform/x86/acerhdf.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c index 7fe7dbf2f4ef..91b16c8a45bd 100644 --- a/drivers/platform/x86/acerhdf.c +++ b/drivers/platform/x86/acerhdf.c @@ -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); -- 2.34.1