+ ci->cd[core].freq_directions[freq_window_idx] = 0;
+
+ freq_window_idx++;
+ freq_window_idx = freq_window_idx & (FREQ_WINDOW_SIZE-1);
+ ci->cd[core].freq_window_idx = freq_window_idx;
+
+ up_count = 0;
+ for (i = 0; i < FREQ_WINDOW_SIZE; i++)
+ up_count += ci->cd[core].freq_directions[i];
+
+ if (up_count == 0) {
+ if (ci->cd[core].freq_state != FREQ_MIN) {
+ power_manager_scale_core_min(core);
+ ci->cd[core].freq_state = FREQ_MIN;
+ }
+ } else {
+ if (ci->cd[core].freq_state != FREQ_MAX) {
+ power_manager_scale_core_max(core);
+ ci->cd[core].freq_state = FREQ_MAX;
+ }
+ }