• Home
  • Raw
  • Download

Lines Matching +full:max +full:- +full:freq

1 /* SPDX-License-Identifier: GPL-2.0-only */
6 * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de>
26 * Maximum transition latency is in nanoseconds - if it's unknown,
30 #define CPUFREQ_ETERNAL (-1)
47 /* in 10^(-9) s = nanoseconds */
65 unsigned int max; /* in kHz */ member
68 unsigned int restore_freq; /* = policy->cur before transition */
69 unsigned int suspend_freq; /* freq to set during suspend */
93 * - Any routine that wants to read from the policy structure will
95 * - Any routine that will write to the policy structure and/or may take away
103 * - fast_switch_possible should be set by the driver if it can
106 * - fast_switch_enabled is to be set by governors that support fast
144 /* cpufreq-stats */
158 * Used for passing new cpufreq policy data to the cpufreq driver's ->verify()
160 * and max values, if necessary, and specifically it must not update the
168 unsigned int max; /* in kHz */ member
181 #define CPUFREQ_SHARED_TYPE_ALL (2) /* All dependent CPUs should set freq */
182 #define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/
202 return cpumask_empty(policy->cpus); in policy_is_inactive()
207 return cpumask_weight(policy->cpus) > 1; in policy_is_shared()
318 * On failure, should always restore frequency to policy->restore_freq
319 * (i.e. old freq).
330 * Caches and returns the lowest driver-supported frequency greater than
351 * In that case core will directly call ->target_index().
386 /* driver isn't removed even if all ->init() calls failed */
396 * This should be set by platforms having multiple clock-domains, i.e.
404 * Driver will do POSTCHANGE notifications from outside of their ->target()
405 * routine and so must set cpufreq_driver->flags with this flag, so that core
412 * frequency present in freq-table exposed by the driver. For these drivers if
413 * CPU is found running at an out of table freq, we will try to set it to a freq
434 * the diver if the target frequency does not change, but the policy min or max
449 (drv->flags & CPUFREQ_IS_COOLING_DEV); in cpufreq_thermal_control_enabled()
454 unsigned int max) in cpufreq_verify_within_limits() argument
456 if (policy->min < min) in cpufreq_verify_within_limits()
457 policy->min = min; in cpufreq_verify_within_limits()
458 if (policy->max < min) in cpufreq_verify_within_limits()
459 policy->max = min; in cpufreq_verify_within_limits()
460 if (policy->min > max) in cpufreq_verify_within_limits()
461 policy->min = max; in cpufreq_verify_within_limits()
462 if (policy->max > max) in cpufreq_verify_within_limits()
463 policy->max = max; in cpufreq_verify_within_limits()
464 if (policy->min > policy->max) in cpufreq_verify_within_limits()
465 policy->min = policy->max; in cpufreq_verify_within_limits()
472 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, in cpufreq_verify_within_cpu_limits()
473 policy->cpuinfo.max_freq); in cpufreq_verify_within_cpu_limits()
523 * cpufreq_scale - "old * mult / div" calculation for large values (32-bit-arch
553 * If (cpufreq_driver->target) exists, the ->governor decides what frequency
554 * within the limits is used. If (cpufreq_driver->setpolicy> exists, these
578 unsigned int freq);
629 if (policy->max < policy->cur) in cpufreq_policy_apply_limits()
630 __cpufreq_driver_target(policy, policy->max, CPUFREQ_RELATION_H); in cpufreq_policy_apply_limits()
631 else if (policy->min > policy->cur) in cpufreq_policy_apply_limits()
632 __cpufreq_driver_target(policy, policy->min, CPUFREQ_RELATION_L); in cpufreq_policy_apply_limits()
671 unsigned int frequency; /* kHz - doesn't need to be in ascending
685 return -EINVAL; in dev_pm_opp_init_cpufreq_table()
696 * cpufreq_for_each_entry - iterate over a cpufreq_frequency_table
702 for (pos = table; pos->frequency != CPUFREQ_TABLE_END; pos++)
705 * cpufreq_for_each_entry_idx - iterate over a cpufreq_frequency_table
713 for (pos = table, idx = 0; pos->frequency != CPUFREQ_TABLE_END; \
717 * cpufreq_for_each_valid_entry - iterate over a cpufreq_frequency_table
724 for (pos = table; pos->frequency != CPUFREQ_TABLE_END; pos++) \
725 if (pos->frequency == CPUFREQ_ENTRY_INVALID) \
730 * cpufreq_for_each_valid_entry_idx - iterate with index over a cpufreq
739 if (pos->frequency == CPUFREQ_ENTRY_INVALID) \
755 unsigned int freq);
765 /* Find lowest freq at or above target in a table in ascending order */
769 struct cpufreq_frequency_table *table = policy->freq_table; in cpufreq_table_find_index_al()
771 unsigned int freq; in cpufreq_table_find_index_al() local
772 int idx, best = -1; in cpufreq_table_find_index_al()
775 freq = pos->frequency; in cpufreq_table_find_index_al()
777 if (freq >= target_freq) in cpufreq_table_find_index_al()
786 /* Find lowest freq at or above target in a table in descending order */
790 struct cpufreq_frequency_table *table = policy->freq_table; in cpufreq_table_find_index_dl()
792 unsigned int freq; in cpufreq_table_find_index_dl() local
793 int idx, best = -1; in cpufreq_table_find_index_dl()
796 freq = pos->frequency; in cpufreq_table_find_index_dl()
798 if (freq == target_freq) in cpufreq_table_find_index_dl()
801 if (freq > target_freq) { in cpufreq_table_find_index_dl()
806 /* No freq found above target_freq */ in cpufreq_table_find_index_dl()
807 if (best == -1) in cpufreq_table_find_index_dl()
816 /* Works only on sorted freq-tables */
820 target_freq = clamp_val(target_freq, policy->min, policy->max); in cpufreq_table_find_index_l()
822 if (policy->freq_table_sorted == CPUFREQ_TABLE_SORTED_ASCENDING) in cpufreq_table_find_index_l()
828 /* Find highest freq at or below target in a table in ascending order */
832 struct cpufreq_frequency_table *table = policy->freq_table; in cpufreq_table_find_index_ah()
834 unsigned int freq; in cpufreq_table_find_index_ah() local
835 int idx, best = -1; in cpufreq_table_find_index_ah()
838 freq = pos->frequency; in cpufreq_table_find_index_ah()
840 if (freq == target_freq) in cpufreq_table_find_index_ah()
843 if (freq < target_freq) { in cpufreq_table_find_index_ah()
848 /* No freq found below target_freq */ in cpufreq_table_find_index_ah()
849 if (best == -1) in cpufreq_table_find_index_ah()
858 /* Find highest freq at or below target in a table in descending order */
862 struct cpufreq_frequency_table *table = policy->freq_table; in cpufreq_table_find_index_dh()
864 unsigned int freq; in cpufreq_table_find_index_dh() local
865 int idx, best = -1; in cpufreq_table_find_index_dh()
868 freq = pos->frequency; in cpufreq_table_find_index_dh()
870 if (freq <= target_freq) in cpufreq_table_find_index_dh()
879 /* Works only on sorted freq-tables */
883 target_freq = clamp_val(target_freq, policy->min, policy->max); in cpufreq_table_find_index_h()
885 if (policy->freq_table_sorted == CPUFREQ_TABLE_SORTED_ASCENDING) in cpufreq_table_find_index_h()
891 /* Find closest freq to target in a table in ascending order */
895 struct cpufreq_frequency_table *table = policy->freq_table; in cpufreq_table_find_index_ac()
897 unsigned int freq; in cpufreq_table_find_index_ac() local
898 int idx, best = -1; in cpufreq_table_find_index_ac()
901 freq = pos->frequency; in cpufreq_table_find_index_ac()
903 if (freq == target_freq) in cpufreq_table_find_index_ac()
906 if (freq < target_freq) { in cpufreq_table_find_index_ac()
911 /* No freq found below target_freq */ in cpufreq_table_find_index_ac()
912 if (best == -1) in cpufreq_table_find_index_ac()
915 /* Choose the closest freq */ in cpufreq_table_find_index_ac()
916 if (target_freq - table[best].frequency > freq - target_freq) in cpufreq_table_find_index_ac()
925 /* Find closest freq to target in a table in descending order */
929 struct cpufreq_frequency_table *table = policy->freq_table; in cpufreq_table_find_index_dc()
931 unsigned int freq; in cpufreq_table_find_index_dc() local
932 int idx, best = -1; in cpufreq_table_find_index_dc()
935 freq = pos->frequency; in cpufreq_table_find_index_dc()
937 if (freq == target_freq) in cpufreq_table_find_index_dc()
940 if (freq > target_freq) { in cpufreq_table_find_index_dc()
945 /* No freq found above target_freq */ in cpufreq_table_find_index_dc()
946 if (best == -1) in cpufreq_table_find_index_dc()
949 /* Choose the closest freq */ in cpufreq_table_find_index_dc()
950 if (table[best].frequency - target_freq > target_freq - freq) in cpufreq_table_find_index_dc()
959 /* Works only on sorted freq-tables */
963 target_freq = clamp_val(target_freq, policy->min, policy->max); in cpufreq_table_find_index_c()
965 if (policy->freq_table_sorted == CPUFREQ_TABLE_SORTED_ASCENDING) in cpufreq_table_find_index_c()
975 if (unlikely(policy->freq_table_sorted == CPUFREQ_TABLE_UNSORTED)) in cpufreq_frequency_table_target()
997 if (unlikely(!policy->freq_table)) in cpufreq_table_count_valid_entries()
1000 cpufreq_for_each_valid_entry(pos, policy->freq_table) in cpufreq_table_count_valid_entries()
1017 return -EINVAL; in cpufreq_enable_boost_support()