diff --git a/drivers/thermal/power_allocator.c b/drivers/thermal/power_allocator.c index 3055f9a12a17..478862b4d258 100644 --- a/drivers/thermal/power_allocator.c +++ b/drivers/thermal/power_allocator.c @@ -19,6 +19,9 @@ #include #include +#ifdef CONFIG_ARCH_ROCKCHIP +#include +#endif #define CREATE_TRACE_POINTS #include @@ -530,6 +533,11 @@ static void allow_maximum_power(struct thermal_zone_device *tz) continue; instance->target = 0; +#ifdef CONFIG_ARCH_ROCKCHIP + rockchip_system_monitor_adjust_cdev_state(instance->cdev, + tz->temperature, + &instance->target); +#endif mutex_lock(&instance->cdev->lock); instance->cdev->updated = false; mutex_unlock(&instance->cdev->lock); diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 441778100887..cc83ac4ea98c 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -22,6 +22,9 @@ #include #include #include +#ifdef CONFIG_ARCH_ROCKCHIP +#include +#endif #define CREATE_TRACE_POINTS #include @@ -587,6 +590,15 @@ int power_actor_set_power(struct thermal_cooling_device *cdev, return -EINVAL; ret = cdev->ops->power2state(cdev, instance->tz, power, &state); +#ifdef CONFIG_ARCH_ROCKCHIP + if (ret) + state = THERMAL_CSTATE_INVALID; + rockchip_system_monitor_adjust_cdev_state(cdev, + instance->tz->temperature, + &state); + if (state == THERMAL_CSTATE_INVALID) + ret = -EINVAL; +#endif if (ret) return ret;