struct acpi_cpufreq_data *data = policy->driver_data;
struct acpi_processor_performance *perf;
struct cpufreq_frequency_table *entry;
- unsigned int next_perf_state, next_freq, freq;
+ unsigned int next_perf_state, next_freq, index;
/*
* Find the closest frequency above target_freq.
- *
- * The table is sorted in the reverse order with respect to the
- * frequency and all of the entries are valid (see the initialization).
*/
- entry = policy->freq_table;
- do {
- entry++;
- freq = entry->frequency;
- } while (freq >= target_freq && freq != CPUFREQ_TABLE_END);
- entry--;
+ index = cpufreq_table_find_index_dl(policy, target_freq);
+
+ entry = &policy->freq_table[index];
next_freq = entry->frequency;
next_perf_state = entry->driver_data;
else {
unsigned int index;
- index = cpufreq_frequency_table_target(policy,
- policy->cur - 1, CPUFREQ_RELATION_H);
+ index = cpufreq_table_find_index_h(policy,
+ policy->cur - 1);
freq_next = policy->freq_table[index].frequency;
}
freq_avg = freq_req - freq_reduc;
/* Find freq bounds for freq_avg in freq_table */
- index = cpufreq_frequency_table_target(policy, freq_avg,
- CPUFREQ_RELATION_H);
+ index = cpufreq_table_find_index_h(policy, freq_avg);
freq_lo = freq_table[index].frequency;
- index = cpufreq_frequency_table_target(policy, freq_avg,
- CPUFREQ_RELATION_L);
+ index = cpufreq_table_find_index_l(policy, freq_avg);
freq_hi = freq_table[index].frequency;
/* Find out how long we have to be in hi and lo freqs */
struct cpufreq_policy policy;
cpufreq_get_policy(&policy, cpu);
- index = cpufreq_frequency_table_target(&policy, policy.cur,
- CPUFREQ_RELATION_C);
+ index = cpufreq_table_find_index_c(&policy, policy.cur);
powernv_cpufreq_target_index(&policy, index);
cpumask_andnot(&mask, &mask, policy.cpus);
}
new_freq = s5pv210_freq_table[index].frequency;
/* Finding current running level index */
- priv_index = cpufreq_frequency_table_target(policy, old_freq,
- CPUFREQ_RELATION_H);
+ priv_index = cpufreq_table_find_index_h(policy, old_freq);
arm_volt = dvs_conf[index].arm_volt;
int_volt = dvs_conf[index].int_volt;