From: David Wu Date: Thu, 26 Mar 2015 14:29:24 +0000 (+0800) Subject: rk3368: thermal: add adjust temp from efuse X-Git-Tag: firefly_0821_release~4158^2~277 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d3c60c74df795c73e66bfbb311b118de04182cbe;p=firefly-linux-kernel-4.4.55.git rk3368: thermal: add adjust temp from efuse Signed-off-by: David Wu --- diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c index 158d48212980..15e15255430a 100755 --- a/drivers/thermal/rockchip_thermal.c +++ b/drivers/thermal/rockchip_thermal.c @@ -27,6 +27,7 @@ #include #include #include +#include "../../arch/arm/mach-rockchip/efuse.h" #if 0 #define thermal_dbg(dev, format, arg...) \ @@ -826,7 +827,7 @@ static int rockchip_thermal_user_mode_get_temp(struct rockchip_thermal_data *the #ifdef TSADC_CPU_GATE temp_cpu = rk_tsadcv3_code_to_temp((val_cpu * voltage + 500000) / 1000000) / 1000; - temp_cpu = temp_cpu + thermal->cpu_temp_adjust; + temp_cpu = temp_cpu - thermal->cpu_temp_adjust; thermal->cpu_temp = temp_cpu; if(thermal->logout) printk("cpu[%d, %d], voltage: %d\n" @@ -1040,7 +1041,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev) error); goto err_disable_pclk; } - + thermal->cpu_temp_adjust = rockchip_get_temp(0); if (thermal->chip->mode == TSADC_AUTO_MODE) { thermal->chip->initialize(thermal->regs, thermal->tshut_polarity);