Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172547
b: refs/heads/master
c: 43f1069
h: refs/heads/master
i:
  172545: 94387d5
  172543: ebc1ce3
v: v3
  • Loading branch information
Mark Brown authored and Ben Dooks committed Dec 1, 2009
1 parent bba2ed5 commit 5872d0e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 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: 383af9c2586e0c51e27ed4f186a2f23f8e889054
refs/heads/master: 43f1069ef9af9a0b1fa1a1d6b49b2b05e1efc998
20 changes: 13 additions & 7 deletions trunk/arch/arm/plat-s3c64xx/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

static struct clk *armclk;
static struct regulator *vddarm;
static unsigned long regulator_latency;

#ifdef CONFIG_CPU_S3C6410
struct s3c64xx_dvfs {
Expand Down Expand Up @@ -141,7 +142,7 @@ static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy,
}

#ifdef CONFIG_REGULATOR
static void __init s3c64xx_cpufreq_constrain_voltages(void)
static void __init s3c64xx_cpufreq_config_regulator(void)
{
int count, v, i, found;
struct cpufreq_frequency_table *freq;
Expand All @@ -150,11 +151,10 @@ static void __init s3c64xx_cpufreq_constrain_voltages(void)
count = regulator_count_voltages(vddarm);
if (count < 0) {
pr_err("cpufreq: Unable to check supported voltages\n");
return;
}

freq = s3c64xx_freq_table;
while (freq->frequency != CPUFREQ_TABLE_END) {
while (count > 0 && freq->frequency != CPUFREQ_TABLE_END) {
if (freq->frequency == CPUFREQ_ENTRY_INVALID)
continue;

Expand All @@ -175,6 +175,10 @@ static void __init s3c64xx_cpufreq_constrain_voltages(void)

freq++;
}

/* Guess based on having to do an I2C/SPI write; in future we
* will be able to query the regulator performance here. */
regulator_latency = 1 * 1000 * 1000;
}
#endif

Expand Down Expand Up @@ -206,7 +210,7 @@ static int __init s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
pr_err("cpufreq: Only frequency scaling available\n");
vddarm = NULL;
} else {
s3c64xx_cpufreq_constrain_voltages();
s3c64xx_cpufreq_config_regulator();
}
#endif

Expand All @@ -233,9 +237,11 @@ static int __init s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)

policy->cur = clk_get_rate(armclk) / 1000;

/* Pick a conservative guess in ns: we'll need ~1 I2C/SPI
* write plus clock reprogramming. */
policy->cpuinfo.transition_latency = 2 * 1000 * 1000;
/* Datasheet says PLL stabalisation time (if we were to use
* the PLLs, which we don't currently) is ~300us worst case,
* but add some fudge.
*/
policy->cpuinfo.transition_latency = (500 * 1000) + regulator_latency;

ret = cpufreq_frequency_table_cpuinfo(policy, s3c64xx_freq_table);
if (ret != 0) {
Expand Down

0 comments on commit 5872d0e

Please sign in to comment.