thermal/drivers/int340x: Improve the tcc offset saving for suspend/resume
authorAntoine Tenart <atenart@kernel.org>
Thu, 9 Sep 2021 08:56:13 +0000 (10:56 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 21 Oct 2021 09:46:24 +0000 (11:46 +0200)
commitc4fcf1ada4ae63e0aab6afd19ca2e7d16833302c
tree112d8e46e70caa641a0f52289e965154a67348a5
parentfb6de59d3967f87fe4cae4b08f55cbe0d5a30b77
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>
drivers/thermal/intel/int340x_thermal/int3401_thermal.c
drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
drivers/thermal/intel/int340x_thermal/processor_thermal_device.h
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci_legacy.c