summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorAnson Huang <b20788@freescale.com>2014-06-18 11:21:45 +0800
committerNitin Garg <nitin.garg@freescale.com>2015-09-17 08:58:10 -0500
commit2465547ba659722885718ab45104011ee5cd59f5 (patch)
tree1c99ccac8f6a09cda3de1a605e10594888869ec4 /drivers/thermal
parent7ed527c76eebe4586e3619080dcf8172737a0afd (diff)
ENGR00318913-2 thermal: imx: make thermal trip temp changeable
Make all thermal trips' temp changeable: 1. Different users may have different definitions about the trip temp; 2. For testing purpose, if we want to test cooling device's function, it is easy to change trip temp to cheat the cooling device to active, otherwise, need to test it using heating box which is very inconvenient Signed-off-by: Anson Huang <b20788@freescale.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/imx_thermal.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index fb66f578a6ed..135fa6b4d476 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -243,15 +243,16 @@ static int imx_set_trip_temp(struct thermal_zone_device *tz, int trip,
{
struct imx_thermal_data *data = tz->devdata;
- if (trip == IMX_TRIP_CRITICAL)
- return -EPERM;
-
if (temp > IMX_TEMP_PASSIVE)
return -EINVAL;
- data->temp_passive = temp;
+ if (trip == IMX_TRIP_CRITICAL)
+ data->temp_critical = temp;
+ if (trip == IMX_TRIP_PASSIVE)
+ data->temp_passive = temp;
- imx_set_alarm_temp(data, temp);
+ if (trip == IMX_TRIP_PASSIVE)
+ imx_set_alarm_temp(data, temp);
return 0;
}
@@ -460,7 +461,7 @@ static int imx_thermal_probe(struct platform_device *pdev)
data->tz = thermal_zone_device_register("imx_thermal_zone",
IMX_TRIP_NUM,
- BIT(IMX_TRIP_PASSIVE), data,
+ (1 << IMX_TRIP_NUM) - 1, data,
&imx_tz_ops, NULL,
IMX_PASSIVE_DELAY,
IMX_POLLING_DELAY);