From: David Wu Date: Tue, 31 Mar 2015 04:05:32 +0000 (+0800) Subject: rk3368: thermal: add suspend judeg X-Git-Tag: firefly_0821_release~4158^2~252 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=624fc16c681ab1f88bfb9be45f48b876f5b605a6;p=firefly-linux-kernel-4.4.55.git rk3368: thermal: add suspend judeg Signed-off-by: David Wu --- diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c index 1532783c2f4b..5a435bf4f701 100755 --- a/drivers/thermal/rockchip_thermal.c +++ b/drivers/thermal/rockchip_thermal.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "../../arch/arm/mach-rockchip/efuse.h" #if 0 @@ -119,6 +120,7 @@ struct rockchip_thermal_data { int gpu_temp_adjust; int cpu_temp; bool logout; + bool b_suspend; void __iomem *regs; @@ -849,7 +851,10 @@ int rockchip_tsadc_get_temp(int chn, int voltage) } else { - return rockchip_thermal_user_mode_get_temp(thermal, chn, voltage); + if(thermal->b_suspend) + return INVALID_TEMP; + else + return rockchip_thermal_user_mode_get_temp(thermal, chn, voltage); } } EXPORT_SYMBOL(rockchip_tsadc_get_temp); @@ -1138,6 +1143,7 @@ static int __maybe_unused rockchip_thermal_suspend(struct device *dev) struct rockchip_thermal_data *thermal = platform_get_drvdata(pdev); int i; + thermal->b_suspend = true; if (thermal->chip->mode == TSADC_AUTO_MODE) { for (i = 0; i < ARRAY_SIZE(thermal->sensors); i++) @@ -1185,6 +1191,8 @@ static int __maybe_unused rockchip_thermal_resume(struct device *dev) for (i = 0; i < ARRAY_SIZE(thermal->sensors); i++) rockchip_thermal_toggle_sensor(&thermal->sensors[i], true); } + + thermal->b_suspend = false; return 0; }