diff options
author | Heiko Stuebner <heiko@sntech.de> | 2011-10-14 10:08:57 +0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-10-14 10:15:52 +0400 |
commit | 866a1c8c354e613c2bf378a1cd562756d4a32e75 (patch) | |
tree | 2b3e9e37630ee93357b39e6aec8d1d62380996c9 /arch/arm/plat-s3c24xx | |
parent | f9f7c7503f7002deffe4cb8409ccada075a52522 (diff) | |
download | linux-866a1c8c354e613c2bf378a1cd562756d4a32e75.tar.xz |
ARM: S3C2443: Accommodate cpufreq frequency scheme in armdiv
Cpufreq uses frequencies in kHz and not Hz, so set_rate and round_rate
would be called with a frequency of 266666000 instead of 266666666 but
the clock functions check for rates smaller or equal to the targetrate.
As the armdiv does not support steps this small we can accommodate
this by simply also setting the last 3 digits of the calculated rate
to zero.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/plat-s3c24xx')
-rw-r--r-- | arch/arm/plat-s3c24xx/s3c2443-clock.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm/plat-s3c24xx/s3c2443-clock.c b/arch/arm/plat-s3c24xx/s3c2443-clock.c index 31f97f1bb363..40a87206400f 100644 --- a/arch/arm/plat-s3c24xx/s3c2443-clock.c +++ b/arch/arm/plat-s3c24xx/s3c2443-clock.c @@ -185,7 +185,8 @@ static unsigned long s3c2443_armclk_roundrate(struct clk *clk, for (ptr = 0; ptr < nr_armdiv; ptr++) { div = armdiv[ptr]; if (div) { - calc = parent / div; + /* cpufreq provides 266mhz as 266666000 not 266666666 */ + calc = (parent / div / 1000) * 1000; if (calc <= rate && div < best) best = div; } @@ -225,7 +226,8 @@ static int s3c2443_armclk_setrate(struct clk *clk, unsigned long rate) for (ptr = 0; ptr < nr_armdiv; ptr++) { div = armdiv[ptr]; if (div) { - calc = parent / div; + /* cpufreq provides 266mhz as 266666000 not 266666666 */ + calc = (parent / div / 1000) * 1000; if (calc <= rate && div < best) { best = div; val = ptr; |