aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-davinci/cpufreq.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/cpufreq.c b/arch/arm/mach-davinci/cpufreq.c
index bc8014279114..343de73161fa 100644
--- a/arch/arm/mach-davinci/cpufreq.c
+++ b/arch/arm/mach-davinci/cpufreq.c
@@ -34,6 +34,8 @@
34struct davinci_cpufreq { 34struct davinci_cpufreq {
35 struct device *dev; 35 struct device *dev;
36 struct clk *armclk; 36 struct clk *armclk;
37 struct clk *asyncclk;
38 unsigned long asyncrate;
37}; 39};
38static struct davinci_cpufreq cpufreq; 40static struct davinci_cpufreq cpufreq;
39 41
@@ -114,6 +116,12 @@ static int davinci_target(struct cpufreq_policy *policy,
114 if (ret) 116 if (ret)
115 goto out; 117 goto out;
116 118
119 if (cpufreq.asyncclk) {
120 ret = clk_set_rate(cpufreq.asyncclk, cpufreq.asyncrate);
121 if (ret)
122 goto out;
123 }
124
117 /* if moving to lower freq, lower the voltage after lowering freq */ 125 /* if moving to lower freq, lower the voltage after lowering freq */
118 if (pdata->set_voltage && freqs.new < freqs.old) 126 if (pdata->set_voltage && freqs.new < freqs.old)
119 pdata->set_voltage(idx); 127 pdata->set_voltage(idx);
@@ -191,6 +199,7 @@ static struct cpufreq_driver davinci_driver = {
191static int __init davinci_cpufreq_probe(struct platform_device *pdev) 199static int __init davinci_cpufreq_probe(struct platform_device *pdev)
192{ 200{
193 struct davinci_cpufreq_config *pdata = pdev->dev.platform_data; 201 struct davinci_cpufreq_config *pdata = pdev->dev.platform_data;
202 struct clk *asyncclk;
194 203
195 if (!pdata) 204 if (!pdata)
196 return -EINVAL; 205 return -EINVAL;
@@ -205,6 +214,12 @@ static int __init davinci_cpufreq_probe(struct platform_device *pdev)
205 return PTR_ERR(cpufreq.armclk); 214 return PTR_ERR(cpufreq.armclk);
206 } 215 }
207 216
217 asyncclk = clk_get(cpufreq.dev, "async");
218 if (!IS_ERR(asyncclk)) {
219 cpufreq.asyncclk = asyncclk;
220 cpufreq.asyncrate = clk_get_rate(asyncclk);
221 }
222
208 return cpufreq_register_driver(&davinci_driver); 223 return cpufreq_register_driver(&davinci_driver);
209} 224}
210 225
@@ -212,6 +227,9 @@ static int __exit davinci_cpufreq_remove(struct platform_device *pdev)
212{ 227{
213 clk_put(cpufreq.armclk); 228 clk_put(cpufreq.armclk);
214 229
230 if (cpufreq.asyncclk)
231 clk_put(cpufreq.asyncclk);
232
215 return cpufreq_unregister_driver(&davinci_driver); 233 return cpufreq_unregister_driver(&davinci_driver);
216} 234}
217 235