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

4  * Copyright (C) 2002 - 2012 Paul Mundt
7 * Clock framework bits from arch/avr32/mach-at32ap/cpufreq.c
9 * Copyright (C) 2004-2007 Atmel Corporation
34 unsigned int freq; member
45 struct cpufreq_policy *policy = target->policy; in __sh_cpufreq_target()
46 int cpu = policy->cpu; in __sh_cpufreq_target()
50 long freq; in __sh_cpufreq_target() local
53 return -ENODEV; in __sh_cpufreq_target()
58 freq = clk_round_rate(cpuclk, target->freq * 1000); in __sh_cpufreq_target()
60 if (freq < (policy->min * 1000) || freq > (policy->max * 1000)) in __sh_cpufreq_target()
61 return -EINVAL; in __sh_cpufreq_target()
63 dev_dbg(dev, "requested frequency %u Hz\n", target->freq * 1000); in __sh_cpufreq_target()
66 freqs.new = (freq + 500) / 1000; in __sh_cpufreq_target()
69 cpufreq_freq_transition_begin(target->policy, &freqs); in __sh_cpufreq_target()
70 clk_set_rate(cpuclk, freq); in __sh_cpufreq_target()
71 cpufreq_freq_transition_end(target->policy, &freqs, 0); in __sh_cpufreq_target()
73 dev_dbg(dev, "set frequency %lu Hz\n", freq); in __sh_cpufreq_target()
84 struct cpufreq_target data = { .policy = policy, .freq = target_freq }; in sh_cpufreq_target()
86 return work_on_cpu(policy->cpu, __sh_cpufreq_target, &data); in sh_cpufreq_target()
91 struct clk *cpuclk = &per_cpu(sh_cpuclk, policy->cpu); in sh_cpufreq_verify()
94 freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; in sh_cpufreq_verify()
100 policy->min = (clk_round_rate(cpuclk, 1) + 500) / 1000; in sh_cpufreq_verify()
101 policy->max = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; in sh_cpufreq_verify()
109 unsigned int cpu = policy->cpu; in sh_cpufreq_cpu_init()
122 freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; in sh_cpufreq_cpu_init()
124 policy->freq_table = freq_table; in sh_cpufreq_cpu_init()
129 policy->min = policy->cpuinfo.min_freq = in sh_cpufreq_cpu_init()
131 policy->max = policy->cpuinfo.max_freq = in sh_cpufreq_cpu_init()
140 unsigned int cpu = policy->cpu; in sh_cpufreq_cpu_exit()
171 MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>");