Lines Matching +full:clk +full:- +full:out +full:- +full:frequency
1 // SPDX-License-Identifier: GPL-2.0-only
14 #include <linux/clk.h>
58 old_freq = clk_get_rate(policy->clk) / 1000; in s3c64xx_cpufreq_set_target()
59 new_freq = s3c64xx_freq_table[index].frequency; in s3c64xx_cpufreq_set_target()
65 dvfs->vddarm_min, in s3c64xx_cpufreq_set_target()
66 dvfs->vddarm_max); in s3c64xx_cpufreq_set_target()
75 ret = clk_set_rate(policy->clk, new_freq * 1000); in s3c64xx_cpufreq_set_target()
85 dvfs->vddarm_min, in s3c64xx_cpufreq_set_target()
86 dvfs->vddarm_max); in s3c64xx_cpufreq_set_target()
90 if (clk_set_rate(policy->clk, old_freq * 1000) < 0) in s3c64xx_cpufreq_set_target()
98 pr_debug("Set actual frequency %lukHz\n", in s3c64xx_cpufreq_set_target()
99 clk_get_rate(policy->clk) / 1000); in s3c64xx_cpufreq_set_target()
117 goto out; in s3c64xx_cpufreq_config_regulator()
120 dvfs = &s3c64xx_dvfs_table[freq->driver_data]; in s3c64xx_cpufreq_config_regulator()
125 if (v >= dvfs->vddarm_min && v <= dvfs->vddarm_max) in s3c64xx_cpufreq_config_regulator()
131 freq->frequency); in s3c64xx_cpufreq_config_regulator()
132 freq->frequency = CPUFREQ_ENTRY_INVALID; in s3c64xx_cpufreq_config_regulator()
136 out: in s3c64xx_cpufreq_config_regulator()
147 if (policy->cpu != 0) in s3c64xx_cpufreq_driver_init()
148 return -EINVAL; in s3c64xx_cpufreq_driver_init()
150 policy->clk = clk_get(NULL, "armclk"); in s3c64xx_cpufreq_driver_init()
151 if (IS_ERR(policy->clk)) { in s3c64xx_cpufreq_driver_init()
153 PTR_ERR(policy->clk)); in s3c64xx_cpufreq_driver_init()
154 return PTR_ERR(policy->clk); in s3c64xx_cpufreq_driver_init()
161 pr_err("Only frequency scaling available\n"); in s3c64xx_cpufreq_driver_init()
172 r = clk_round_rate(policy->clk, freq->frequency * 1000); in s3c64xx_cpufreq_driver_init()
174 if (r != freq->frequency) { in s3c64xx_cpufreq_driver_init()
176 freq->frequency); in s3c64xx_cpufreq_driver_init()
177 freq->frequency = CPUFREQ_ENTRY_INVALID; in s3c64xx_cpufreq_driver_init()
181 * frequency is the maximum we can support. */ in s3c64xx_cpufreq_driver_init()
182 if (!vddarm && freq->frequency > clk_get_rate(policy->clk) / 1000) in s3c64xx_cpufreq_driver_init()
183 freq->frequency = CPUFREQ_ENTRY_INVALID; in s3c64xx_cpufreq_driver_init()