Lines Matching +full:max +full:- +full:clk +full:- +full:rate +full:- +full:hz
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
26 #include <linux/clk.h>
30 static DEFINE_PER_CPU(struct clk, sh_cpuclk);
45 struct cpufreq_policy *policy = target->policy;
46 int cpu = policy->cpu;
47 struct clk *cpuclk = &per_cpu(sh_cpuclk, cpu);
53 return -ENODEV;
57 /* Convert target_freq from kHz to Hz */
58 freq = clk_round_rate(cpuclk, target->freq * 1000);
60 if (freq < (policy->min * 1000) || freq > (policy->max * 1000))
61 return -EINVAL;
63 dev_dbg(dev, "requested frequency %u Hz\n", target->freq * 1000);
69 cpufreq_freq_transition_begin(target->policy, &freqs);
71 cpufreq_freq_transition_end(target->policy, &freqs, 0);
73 dev_dbg(dev, "set frequency %lu Hz\n", freq);
86 return work_on_cpu(policy->cpu, __sh_cpufreq_target, &data);
91 struct clk *cpuclk = &per_cpu(sh_cpuclk, policy->cpu);
94 freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL;
100 policy->min = (clk_round_rate(cpuclk, 1) + 500) / 1000;
101 policy->max = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000;
109 unsigned int cpu = policy->cpu;
110 struct clk *cpuclk = &per_cpu(sh_cpuclk, cpu);
118 dev_err(dev, "couldn't get CPU clk\n");
122 freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL;
124 policy->freq_table = freq_table;
127 "to rate rounding.\n");
129 policy->min = policy->cpuinfo.min_freq =
131 policy->max = policy->cpuinfo.max_freq =
140 unsigned int cpu = policy->cpu;
141 struct clk *cpuclk = &per_cpu(sh_cpuclk, cpu);
170 MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>");