[PATCH] thermal: power_allocate: add upper and lower limits

Michael Kao
2020-04-24T07:16:25Z

The upper and lower limits of thermal throttle state in the
device tree do not apply to the power_allocate governor.
Add the upper and lower limits to the power_allocate governor.

Signed-off-by: Michael Kao <michael.kao@mediatek.com>
---
drivers/thermal/thermal_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 9a321dc548c8..f6feed2265bd 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -598,7 +598,7 @@ int power_actor_set_power(struct thermal_cooling_device *cdev,
if (ret)
return ret;

- instance->target = state;
+ instance->target = clamp_val(state, instance->lower, instance->upper);
mutex_lock(&cdev->lock);
cdev->updated = false;
mutex_unlock(&cdev->lock);
--
2.18.0