diff options
author | Antoine Tenart <atenart@kernel.org> | 2021-09-09 10:56:13 +0200 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2021-10-21 11:46:24 +0200 |
commit | c4fcf1ada4ae63e0aab6afd19ca2e7d16833302c (patch) | |
tree | 112d8e46e70caa641a0f52289e965154a67348a5 /drivers/thermal/intel/int340x_thermal/int3401_thermal.c | |
parent | fb6de59d3967f87fe4cae4b08f55cbe0d5a30b77 (diff) | |
download | linux-c4fcf1ada4ae63e0aab6afd19ca2e7d16833302c.tar.gz linux-c4fcf1ada4ae63e0aab6afd19ca2e7d16833302c.tar.bz2 linux-c4fcf1ada4ae63e0aab6afd19ca2e7d16833302c.zip |
thermal/drivers/int340x: Improve the tcc offset saving for suspend/resume
When the driver resumes, the tcc offset is set back to its previous
value. But this only works if the value was user defined as otherwise
the offset isn't saved. This asymmetric logic is harder to maintain and
introduced some issues.
Improve the logic by saving the tcc offset in a suspend op, so the right
value is always restored after a resume.
Signed-off-by: Antoine Tenart <atenart@kernel.org>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tested-by: Srinivas Pandruvada <srinivas.pI andruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20210909085613.5577-3-atenart@kernel.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/thermal/intel/int340x_thermal/int3401_thermal.c')
-rw-r--r-- | drivers/thermal/intel/int340x_thermal/int3401_thermal.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/thermal/intel/int340x_thermal/int3401_thermal.c b/drivers/thermal/intel/int340x_thermal/int3401_thermal.c index acebc8ba94e2..217786fba185 100644 --- a/drivers/thermal/intel/int340x_thermal/int3401_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3401_thermal.c @@ -44,15 +44,21 @@ static int int3401_remove(struct platform_device *pdev) } #ifdef CONFIG_PM_SLEEP +static int int3401_thermal_suspend(struct device *dev) +{ + return proc_thermal_suspend(dev); +} static int int3401_thermal_resume(struct device *dev) { return proc_thermal_resume(dev); } #else +#define int3401_thermal_suspend NULL #define int3401_thermal_resume NULL #endif -static SIMPLE_DEV_PM_OPS(int3401_proc_thermal_pm, NULL, int3401_thermal_resume); +static SIMPLE_DEV_PM_OPS(int3401_proc_thermal_pm, int3401_thermal_suspend, + int3401_thermal_resume); static struct platform_driver int3401_driver = { .probe = int3401_add, |