diff options
Diffstat (limited to 'drivers/thermal/imx_thermal.c')
-rw-r--r-- | drivers/thermal/imx_thermal.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index a99c63152b8d..2c516f2eebed 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c | |||
@@ -306,7 +306,7 @@ static int imx_get_sensor_data(struct platform_device *pdev) | |||
306 | { | 306 | { |
307 | struct imx_thermal_data *data = platform_get_drvdata(pdev); | 307 | struct imx_thermal_data *data = platform_get_drvdata(pdev); |
308 | struct regmap *map; | 308 | struct regmap *map; |
309 | int t1, t2, n1, n2; | 309 | int t1, n1; |
310 | int ret; | 310 | int ret; |
311 | u32 val; | 311 | u32 val; |
312 | u64 temp64; | 312 | u64 temp64; |
@@ -333,14 +333,10 @@ static int imx_get_sensor_data(struct platform_device *pdev) | |||
333 | /* | 333 | /* |
334 | * Sensor data layout: | 334 | * Sensor data layout: |
335 | * [31:20] - sensor value @ 25C | 335 | * [31:20] - sensor value @ 25C |
336 | * [19:8] - sensor value of hot | ||
337 | * [7:0] - hot temperature value | ||
338 | * Use universal formula now and only need sensor value @ 25C | 336 | * Use universal formula now and only need sensor value @ 25C |
339 | * slope = 0.4297157 - (0.0015976 * 25C fuse) | 337 | * slope = 0.4297157 - (0.0015976 * 25C fuse) |
340 | */ | 338 | */ |
341 | n1 = val >> 20; | 339 | n1 = val >> 20; |
342 | n2 = (val & 0xfff00) >> 8; | ||
343 | t2 = val & 0xff; | ||
344 | t1 = 25; /* t1 always 25C */ | 340 | t1 = 25; /* t1 always 25C */ |
345 | 341 | ||
346 | /* | 342 | /* |
@@ -366,16 +362,16 @@ static int imx_get_sensor_data(struct platform_device *pdev) | |||
366 | data->c2 = n1 * data->c1 + 1000 * t1; | 362 | data->c2 = n1 * data->c1 + 1000 * t1; |
367 | 363 | ||
368 | /* | 364 | /* |
369 | * Set the default passive cooling trip point to 20 °C below the | 365 | * Set the default passive cooling trip point, |
370 | * maximum die temperature. Can be changed from userspace. | 366 | * can be changed from userspace. |
371 | */ | 367 | */ |
372 | data->temp_passive = 1000 * (t2 - 20); | 368 | data->temp_passive = IMX_TEMP_PASSIVE; |
373 | 369 | ||
374 | /* | 370 | /* |
375 | * The maximum die temperature is t2, let's give 5 °C cushion | 371 | * The maximum die temperature set to 20 C higher than |
376 | * for noise and possible temperature rise between measurements. | 372 | * IMX_TEMP_PASSIVE. |
377 | */ | 373 | */ |
378 | data->temp_critical = 1000 * (t2 - 5); | 374 | data->temp_critical = 1000 * 20 + data->temp_passive; |
379 | 375 | ||
380 | return 0; | 376 | return 0; |
381 | } | 377 | } |