diff options
author | Bai Ping <b51503@freescale.com> | 2015-10-14 02:46:13 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@nxp.com> | 2016-01-14 11:01:58 -0600 |
commit | 308b52ccc05bf2e7760d7ce09a71aff8a9fa74fc (patch) | |
tree | 41f25003bfd976e73b2d88813df6fedee11bdc87 /drivers/thermal | |
parent | 0565805e851828c694dc75cbba9915b44f3d8f74 (diff) |
MLK-11705 thermal: imx: make the critical trip temp changable for test
In order to test the critical trip point funtion, the
critical trip point temp should be writable from userspace.
Signed-off-by: Bai Ping <b51503@freescale.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/imx_thermal.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index 24678dcfc2d4..5cb0882b3079 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -453,15 +453,18 @@ 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 (data->socdata->version == TEMPMON_IMX6SX) + imx_set_panic_temp(data, temp); + } - imx_set_alarm_temp(data, temp); + if (trip == IMX_TRIP_PASSIVE) { + if (temp > IMX_TEMP_PASSIVE) + return -EINVAL; + data->temp_passive = temp; + imx_set_alarm_temp(data, temp); + } return 0; } @@ -818,7 +821,7 @@ static int imx_thermal_probe(struct platform_device *pdev) mutex_init(&data->mutex); 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); |