Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283501
b: refs/heads/master
c: a6a4341
h: refs/heads/master
i:
  283499: 14f698d
v: v3
  • Loading branch information
Mark Brown authored and Dave Jones committed Dec 9, 2011
1 parent 7e57f2b commit b35517c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b191c540297b00f09addea19588ae8c319aed3dc
refs/heads/master: a6a434124457fe64bb3980ceb2170505207db6e5
35 changes: 22 additions & 13 deletions trunk/drivers/cpufreq/s3c64xx-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* published by the Free Software Foundation.
*/

#define pr_fmt(fmt) "cpufreq: " fmt

#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/init.h>
Expand Down Expand Up @@ -91,7 +93,7 @@ static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy,
if (freqs.old == freqs.new)
return 0;

pr_debug("cpufreq: Transition %d-%dkHz\n", freqs.old, freqs.new);
pr_debug("Transition %d-%dkHz\n", freqs.old, freqs.new);

cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);

Expand All @@ -101,7 +103,7 @@ static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy,
dvfs->vddarm_min,
dvfs->vddarm_max);
if (ret != 0) {
pr_err("cpufreq: Failed to set VDDARM for %dkHz: %d\n",
pr_err("Failed to set VDDARM for %dkHz: %d\n",
freqs.new, ret);
goto err;
}
Expand All @@ -110,7 +112,7 @@ static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy,

ret = clk_set_rate(armclk, freqs.new * 1000);
if (ret < 0) {
pr_err("cpufreq: Failed to set rate %dkHz: %d\n",
pr_err("Failed to set rate %dkHz: %d\n",
freqs.new, ret);
goto err;
}
Expand All @@ -123,14 +125,14 @@ static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy,
dvfs->vddarm_min,
dvfs->vddarm_max);
if (ret != 0) {
pr_err("cpufreq: Failed to set VDDARM for %dkHz: %d\n",
pr_err("Failed to set VDDARM for %dkHz: %d\n",
freqs.new, ret);
goto err_clk;
}
}
#endif

pr_debug("cpufreq: Set actual frequency %lukHz\n",
pr_debug("Set actual frequency %lukHz\n",
clk_get_rate(armclk) / 1000);

return 0;
Expand All @@ -153,7 +155,7 @@ static void __init s3c64xx_cpufreq_config_regulator(void)

count = regulator_count_voltages(vddarm);
if (count < 0) {
pr_err("cpufreq: Unable to check supported voltages\n");
pr_err("Unable to check supported voltages\n");
}

freq = s3c64xx_freq_table;
Expand All @@ -171,7 +173,7 @@ static void __init s3c64xx_cpufreq_config_regulator(void)
}

if (!found) {
pr_debug("cpufreq: %dkHz unsupported by regulator\n",
pr_debug("%dkHz unsupported by regulator\n",
freq->frequency);
freq->frequency = CPUFREQ_ENTRY_INVALID;
}
Expand All @@ -194,13 +196,13 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
return -EINVAL;

if (s3c64xx_freq_table == NULL) {
pr_err("cpufreq: No frequency information for this CPU\n");
pr_err("No frequency information for this CPU\n");
return -ENODEV;
}

armclk = clk_get(NULL, "armclk");
if (IS_ERR(armclk)) {
pr_err("cpufreq: Unable to obtain ARMCLK: %ld\n",
pr_err("Unable to obtain ARMCLK: %ld\n",
PTR_ERR(armclk));
return PTR_ERR(armclk);
}
Expand All @@ -209,12 +211,19 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
vddarm = regulator_get(NULL, "vddarm");
if (IS_ERR(vddarm)) {
ret = PTR_ERR(vddarm);
pr_err("cpufreq: Failed to obtain VDDARM: %d\n", ret);
pr_err("cpufreq: Only frequency scaling available\n");
pr_err("Failed to obtain VDDARM: %d\n", ret);
pr_err("Only frequency scaling available\n");
vddarm = NULL;
} else {
s3c64xx_cpufreq_config_regulator();
}

vddint = regulator_get(NULL, "vddint");
if (IS_ERR(vddint)) {
ret = PTR_ERR(vddint);
pr_err("Failed to obtain VDDINT: %d\n", ret);
vddint = NULL;
}
#endif

freq = s3c64xx_freq_table;
Expand All @@ -225,7 +234,7 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
r = clk_round_rate(armclk, freq->frequency * 1000);
r /= 1000;
if (r != freq->frequency) {
pr_debug("cpufreq: %dkHz unsupported by clock\n",
pr_debug("%dkHz unsupported by clock\n",
freq->frequency);
freq->frequency = CPUFREQ_ENTRY_INVALID;
}
Expand All @@ -248,7 +257,7 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)

ret = cpufreq_frequency_table_cpuinfo(policy, s3c64xx_freq_table);
if (ret != 0) {
pr_err("cpufreq: Failed to configure frequency table: %d\n",
pr_err("Failed to configure frequency table: %d\n",
ret);
regulator_put(vddarm);
clk_put(armclk);
Expand Down

0 comments on commit b35517c

Please sign in to comment.