This source file includes following definitions.
- s3c2410_cpufreq_setrefresh
- s3c2410_set_fvco
1
2
3
4
5
6
7
8
9 #include <linux/kernel.h>
10 #include <linux/errno.h>
11 #include <linux/cpufreq.h>
12 #include <linux/io.h>
13 #include <linux/clk.h>
14
15 #include <mach/map.h>
16 #include <mach/regs-clock.h>
17
18 #include <plat/cpu-freq-core.h>
19
20 #include "regs-mem.h"
21
22
23
24
25
26
27
28
29 void s3c2410_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg)
30 {
31 struct s3c_cpufreq_board *board = cfg->board;
32 unsigned long refresh;
33 unsigned long refval;
34
35
36
37
38
39
40
41
42 refresh = (cfg->freq.hclk / 100) * (board->refresh / 10);
43 refresh = DIV_ROUND_UP(refresh, (1000 * 1000));
44 refresh = (1 << 11) + 1 - refresh;
45
46 s3c_freq_dbg("%s: refresh value %lu\n", __func__, refresh);
47
48 refval = __raw_readl(S3C2410_REFRESH);
49 refval &= ~((1 << 12) - 1);
50 refval |= refresh;
51 __raw_writel(refval, S3C2410_REFRESH);
52 }
53
54
55
56
57
58 void s3c2410_set_fvco(struct s3c_cpufreq_config *cfg)
59 {
60 if (!IS_ERR(cfg->mpll))
61 clk_set_rate(cfg->mpll, cfg->pll.frequency);
62 }