diff options
Diffstat (limited to 'drivers/thermal/step_wise.c')
-rw-r--r-- | drivers/thermal/step_wise.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/thermal/step_wise.c b/drivers/thermal/step_wise.c index 5a0f12d08e8b..04f4d21dcda7 100644 --- a/drivers/thermal/step_wise.c +++ b/drivers/thermal/step_wise.c @@ -81,9 +81,20 @@ static unsigned long get_target_state(struct thermal_instance *instance, if (!throttle) next_target = THERMAL_NO_TARGET; } else { +#ifdef CONFIG_THERMAL_STEP_WISE_FREQUENCY_CAPPING + if (!throttle) { + next_target = cur_state - 1; + if (next_target > instance->upper) + next_target = instance->upper; + } + else + next_target = cur_state > instance->upper ? + instance->upper : cur_state; +#else next_target = cur_state - 1; if (next_target > instance->upper) next_target = instance->upper; +#endif } break; case THERMAL_TREND_DROP_FULL: |