drivers: thermal: Reprogram the thresholds for the set_trips callback

With virtual thermal zones monitoring the same sensor, there could be a
case where two thermal zones can look for the same trip threshold. The
sensor driver when notifying the thermal core for the trip threshold,
there is a possibility that by the time the second zone reads the
temperature, the temperature might have gone below the trip threshold
because of the mitigation from first thermal zone. In that case, the
second thermal zone will re-program the same trip thresholds. The
current optimization in the set_trips callback will optimize this by not
programming the trip thresholds again. But for sensor drivers working
with multiple thermal-zones can expect the same threshold be configured
again.

Remove the optimization in the set_trips to skip the threshold
programming if it the same as previous threshold. The optimzation will
make more sense in the sensor driver to skip the new thresholds if they
are same as the current active thresholds.

Change-Id: I812eb2c1303a23cd9aa33442e9fff332e71ec4ec
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
2 files changed