diff options
author | Ben Dooks <ben@simtec.co.uk> | 2009-07-30 18:23:22 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-07-30 18:22:51 -0400 |
commit | ea5fe9aedf512d20b75b7dcfd54ab99ae5c0934b (patch) | |
tree | 6333ce1d0727ebdac0471c862bf3531e8ad3f451 /arch/arm/plat-s3c | |
parent | 2e4ea6e8209e0c1d93c69c34c32002337b3f747e (diff) |
ARM: S3C: CPUFREQ: Documentation for cpufreq header
Update arch/arm/plat-s3c/include/plat/cpu-freq.h to include kerneldoc
style documentation.
Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c')
-rw-r--r-- | arch/arm/plat-s3c/include/plat/cpu-freq.h | 91 |
1 files changed, 81 insertions, 10 deletions
diff --git a/arch/arm/plat-s3c/include/plat/cpu-freq.h b/arch/arm/plat-s3c/include/plat/cpu-freq.h index c86a13307e90..0ba7670fd075 100644 --- a/arch/arm/plat-s3c/include/plat/cpu-freq.h +++ b/arch/arm/plat-s3c/include/plat/cpu-freq.h | |||
@@ -17,6 +17,21 @@ struct s3c_cpufreq_info; | |||
17 | struct s3c_cpufreq_board; | 17 | struct s3c_cpufreq_board; |
18 | struct s3c_iotimings; | 18 | struct s3c_iotimings; |
19 | 19 | ||
20 | /** | ||
21 | * struct s3c_freq - frequency information (mainly for core drivers) | ||
22 | * @fclk: The FCLK frequency in Hz. | ||
23 | * @armclk: The ARMCLK frequency in Hz. | ||
24 | * @hclk_tns: HCLK cycle time in 10ths of nano-seconds. | ||
25 | * @hclk: The HCLK frequency in Hz. | ||
26 | * @pclk: The PCLK frequency in Hz. | ||
27 | * | ||
28 | * This contains the frequency information about the current configuration | ||
29 | * mainly for the core drivers to ensure we do not end up passing about | ||
30 | * a large number of parameters. | ||
31 | * | ||
32 | * The @hclk_tns field is a useful cache for the parts of the drivers that | ||
33 | * need to calculate IO timings and suchlike. | ||
34 | */ | ||
20 | struct s3c_freq { | 35 | struct s3c_freq { |
21 | unsigned long fclk; | 36 | unsigned long fclk; |
22 | unsigned long armclk; | 37 | unsigned long armclk; |
@@ -25,33 +40,75 @@ struct s3c_freq { | |||
25 | unsigned long pclk; | 40 | unsigned long pclk; |
26 | }; | 41 | }; |
27 | 42 | ||
28 | /* wrapper 'struct cpufreq_freqs' so that any drivers receiving the | 43 | /** |
44 | * struct s3c_cpufreq_freqs - s3c cpufreq notification information. | ||
45 | * @freqs: The cpufreq setting information. | ||
46 | * @old: The old clock settings. | ||
47 | * @new: The new clock settings. | ||
48 | * @pll_changing: Set if the PLL is changing. | ||
49 | * | ||
50 | * Wrapper 'struct cpufreq_freqs' so that any drivers receiving the | ||
29 | * notification can use this information that is not provided by just | 51 | * notification can use this information that is not provided by just |
30 | * having the core frequency alone. | 52 | * having the core frequency alone. |
53 | * | ||
54 | * The pll_changing flag is used to indicate if the PLL itself is | ||
55 | * being set during this change. This is important as the clocks | ||
56 | * will temporarily be set to the XTAL clock during this time, so | ||
57 | * drivers may want to close down their output during this time. | ||
58 | * | ||
59 | * Note, this is not being used by any current drivers and therefore | ||
60 | * may be removed in the future. | ||
31 | */ | 61 | */ |
32 | |||
33 | struct s3c_cpufreq_freqs { | 62 | struct s3c_cpufreq_freqs { |
34 | struct cpufreq_freqs freqs; | 63 | struct cpufreq_freqs freqs; |
35 | struct s3c_freq old; | 64 | struct s3c_freq old; |
36 | struct s3c_freq new; | 65 | struct s3c_freq new; |
66 | |||
67 | unsigned int pll_changing:1; | ||
37 | }; | 68 | }; |
38 | 69 | ||
39 | #define to_s3c_cpufreq(_cf) container_of(_cf, struct s3c_cpufreq_freqs, freqs) | 70 | #define to_s3c_cpufreq(_cf) container_of(_cf, struct s3c_cpufreq_freqs, freqs) |
40 | 71 | ||
72 | /** | ||
73 | * struct s3c_clkdivs - clock divisor information | ||
74 | * @p_divisor: Divisor from FCLK to PCLK. | ||
75 | * @h_divisor: Divisor from FCLK to HCLK. | ||
76 | * @arm_divisor: Divisor from FCLK to ARMCLK (not all CPUs). | ||
77 | * @dvs: Non-zero if using DVS mode for ARMCLK. | ||
78 | * | ||
79 | * Divisor settings for the core clocks. | ||
80 | */ | ||
41 | struct s3c_clkdivs { | 81 | struct s3c_clkdivs { |
42 | int p_divisor; /* fclk / pclk */ | 82 | int p_divisor; |
43 | int h_divisor; /* fclk / hclk */ | 83 | int h_divisor; |
44 | int arm_divisor; /* not all cpus have this. */ | 84 | int arm_divisor; |
45 | unsigned char dvs; /* using dvs mode to arm. */ | 85 | unsigned char dvs; |
46 | }; | 86 | }; |
47 | 87 | ||
48 | #define PLLVAL(_m, _p, _s) (((_m) << 12) | ((_p) << 4) | (_s)) | 88 | #define PLLVAL(_m, _p, _s) (((_m) << 12) | ((_p) << 4) | (_s)) |
49 | 89 | ||
90 | /** | ||
91 | * struct s3c_pllval - PLL value entry. | ||
92 | * @freq: The frequency for this entry in Hz. | ||
93 | * @pll_reg: The PLL register setting for this PLL value. | ||
94 | */ | ||
50 | struct s3c_pllval { | 95 | struct s3c_pllval { |
51 | unsigned long freq; | 96 | unsigned long freq; |
52 | unsigned long pll_reg; | 97 | unsigned long pll_reg; |
53 | }; | 98 | }; |
54 | 99 | ||
100 | /** | ||
101 | * struct s3c_cpufreq_config - current cpu frequency configuration | ||
102 | * @freq: The current settings for the core clocks. | ||
103 | * @pll: The PLL table entry for the current PLL settings. | ||
104 | * @divs: The divisor settings for the core clocks. | ||
105 | * @info: The current core driver information. | ||
106 | * @board: The information for the board we are running on. | ||
107 | * | ||
108 | * This is for the core drivers that need to know information about | ||
109 | * the current settings and values. It should not be needed by any | ||
110 | * device drivers. | ||
111 | */ | ||
55 | struct s3c_cpufreq_config { | 112 | struct s3c_cpufreq_config { |
56 | struct s3c_freq freq; | 113 | struct s3c_freq freq; |
57 | struct s3c_pllval pll; | 114 | struct s3c_pllval pll; |
@@ -60,13 +117,27 @@ struct s3c_cpufreq_config { | |||
60 | struct s3c_cpufreq_board *board; | 117 | struct s3c_cpufreq_board *board; |
61 | }; | 118 | }; |
62 | 119 | ||
63 | /* s3c_cpufreq_board | 120 | /** |
121 | * struct s3c_cpufreq_board - per-board cpu frequency informatin | ||
122 | * @refresh: The SDRAM refresh period in nanoseconds. | ||
123 | * @auto_io: Set if the IO timing settings should be generated from the | ||
124 | * initialisation time hardware registers. | ||
125 | * @need_io: Set if the board has external IO on any of the chipselect | ||
126 | * lines that will require the hardware timing registers to be | ||
127 | * updated on a clock change. | ||
128 | * @max: The maxium frequency limits for the system. Any field that | ||
129 | * is left at zero will use the CPU's settings. | ||
130 | * | ||
131 | * This contains the board specific settings that affect how the CPU | ||
132 | * drivers chose settings. These include the memory refresh and IO | ||
133 | * timing information. | ||
64 | * | 134 | * |
65 | * per-board configuraton information, such as memory refresh and | 135 | * Registration depends on the driver being used, the ARMCLK only |
66 | * how to initialise IO timings. | 136 | * implementation does not currently need this but the older style |
137 | * driver requires this to be available. | ||
67 | */ | 138 | */ |
68 | struct s3c_cpufreq_board { | 139 | struct s3c_cpufreq_board { |
69 | unsigned int refresh; /* refresh period in ns */ | 140 | unsigned int refresh; |
70 | unsigned int auto_io:1; /* automatically init io timings. */ | 141 | unsigned int auto_io:1; /* automatically init io timings. */ |
71 | unsigned int need_io:1; /* set if needs io timing support. */ | 142 | unsigned int need_io:1; /* set if needs io timing support. */ |
72 | 143 | ||