mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
thermal: consider emul_temperature while computing trend
In case emulated temperature is in use, using the trend provided by driver layer can lead to bogus situation. In this case, debugger user would set a temperature value, but the trend would be from driver computation. To avoid this situation, this patch changes the get_tz_trend() to consider the emulated temperature whenever that is in use. Cc: Zhang Rui <[email protected]> Cc: Amit Daniel Kachhap <[email protected]> Cc: Durgadoss R <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Eduardo Valentin <[email protected]> Signed-off-by: Zhang Rui <[email protected]>
This commit is contained in:
parent
24c7a38172
commit
0c872507d8
1 changed files with 2 additions and 1 deletions
|
|
@ -155,7 +155,8 @@ int get_tz_trend(struct thermal_zone_device *tz, int trip)
|
|||
{
|
||||
enum thermal_trend trend;
|
||||
|
||||
if (!tz->ops->get_trend || tz->ops->get_trend(tz, trip, &trend)) {
|
||||
if (tz->emul_temperature || !tz->ops->get_trend ||
|
||||
tz->ops->get_trend(tz, trip, &trend)) {
|
||||
if (tz->temperature > tz->last_temperature)
|
||||
trend = THERMAL_TREND_RAISING;
|
||||
else if (tz->temperature < tz->last_temperature)
|
||||
|
|
|
|||
Loading…
Reference in a new issue