14
14
#include "clk-pll.h"
15
15
16
16
/**
17
- * struct samsung_clk_provider: information about clock provider
18
- * @reg_base: virtual address for the register base.
19
- * @dev: clock provider device needed for runtime PM.
20
- * @lock: maintains exclusion between callbacks for a given clock-provider.
21
- * @clk_data: holds clock related data like clk_hw* and number of clocks.
17
+ * struct samsung_clk_provider - information about clock provider
18
+ * @reg_base: virtual address for the register base
19
+ * @dev: clock provider device needed for runtime PM
20
+ * @lock: maintains exclusion between callbacks for a given clock-provider
21
+ * @clk_data: holds clock related data like clk_hw* and number of clocks
22
22
*/
23
23
struct samsung_clk_provider {
24
24
void __iomem * reg_base ;
@@ -29,10 +29,10 @@ struct samsung_clk_provider {
29
29
};
30
30
31
31
/**
32
- * struct samsung_clock_alias: information about mux clock
33
- * @id: platform specific id of the clock.
34
- * @dev_name: name of the device to which this clock belongs.
35
- * @alias: optional clock alias name to be assigned to this clock.
32
+ * struct samsung_clock_alias - information about mux clock
33
+ * @id: platform specific id of the clock
34
+ * @dev_name: name of the device to which this clock belongs
35
+ * @alias: optional clock alias name to be assigned to this clock
36
36
*/
37
37
struct samsung_clock_alias {
38
38
unsigned int id ;
@@ -50,12 +50,12 @@ struct samsung_clock_alias {
50
50
#define MHZ (1000 * 1000)
51
51
52
52
/**
53
- * struct samsung_fixed_rate_clock: information about fixed-rate clock
54
- * @id: platform specific id of the clock.
55
- * @name: name of this fixed-rate clock.
56
- * @parent_name: optional parent clock name.
57
- * @flags: optional fixed-rate clock flags.
58
- * @fixed-rate : fixed clock rate of this clock.
53
+ * struct samsung_fixed_rate_clock - information about fixed-rate clock
54
+ * @id: platform specific id of the clock
55
+ * @name: name of this fixed-rate clock
56
+ * @parent_name: optional parent clock name
57
+ * @flags: optional fixed-rate clock flags
58
+ * @fixed_rate : fixed clock rate of this clock
59
59
*/
60
60
struct samsung_fixed_rate_clock {
61
61
unsigned int id ;
@@ -74,14 +74,14 @@ struct samsung_fixed_rate_clock {
74
74
.fixed_rate = frate, \
75
75
}
76
76
77
- /*
78
- * struct samsung_fixed_factor_clock: information about fixed-factor clock
79
- * @id: platform specific id of the clock.
80
- * @name: name of this fixed-factor clock.
81
- * @parent_name: parent clock name.
82
- * @mult: fixed multiplication factor.
83
- * @div: fixed division factor.
84
- * @flags: optional fixed-factor clock flags.
77
+ /**
78
+ * struct samsung_fixed_factor_clock - information about fixed-factor clock
79
+ * @id: platform specific id of the clock
80
+ * @name: name of this fixed-factor clock
81
+ * @parent_name: parent clock name
82
+ * @mult: fixed multiplication factor
83
+ * @div: fixed division factor
84
+ * @flags: optional fixed-factor clock flags
85
85
*/
86
86
struct samsung_fixed_factor_clock {
87
87
unsigned int id ;
@@ -103,16 +103,16 @@ struct samsung_fixed_factor_clock {
103
103
}
104
104
105
105
/**
106
- * struct samsung_mux_clock: information about mux clock
107
- * @id: platform specific id of the clock.
108
- * @name: name of this mux clock.
109
- * @parent_names: array of pointer to parent clock names.
110
- * @num_parents: number of parents listed in @parent_names.
111
- * @flags: optional flags for basic clock.
112
- * @offset: offset of the register for configuring the mux.
113
- * @shift: starting bit location of the mux control bit-field in @reg.
114
- * @width: width of the mux control bit-field in @reg.
115
- * @mux_flags: flags for mux-type clock.
106
+ * struct samsung_mux_clock - information about mux clock
107
+ * @id: platform specific id of the clock
108
+ * @name: name of this mux clock
109
+ * @parent_names: array of pointer to parent clock names
110
+ * @num_parents: number of parents listed in @parent_names
111
+ * @flags: optional flags for basic clock
112
+ * @offset: offset of the register for configuring the mux
113
+ * @shift: starting bit location of the mux control bit-field in @reg
114
+ * @width: width of the mux control bit-field in @reg
115
+ * @mux_flags: flags for mux-type clock
116
116
*/
117
117
struct samsung_mux_clock {
118
118
unsigned int id ;
@@ -146,14 +146,16 @@ struct samsung_mux_clock {
146
146
__MUX(_id, cname, pnames, o, s, w, f, mf)
147
147
148
148
/**
149
- * @id: platform specific id of the clock.
150
- * struct samsung_div_clock: information about div clock
151
- * @name: name of this div clock.
152
- * @parent_name: name of the parent clock.
153
- * @flags: optional flags for basic clock.
154
- * @offset: offset of the register for configuring the div.
155
- * @shift: starting bit location of the div control bit-field in @reg.
156
- * @div_flags: flags for div-type clock.
149
+ * struct samsung_div_clock - information about div clock
150
+ * @id: platform specific id of the clock
151
+ * @name: name of this div clock
152
+ * @parent_name: name of the parent clock
153
+ * @flags: optional flags for basic clock
154
+ * @offset: offset of the register for configuring the div
155
+ * @shift: starting bit location of the div control bit-field in @reg
156
+ * @width: width of the bitfield
157
+ * @div_flags: flags for div-type clock
158
+ * @table: array of divider/value pairs ending with a div set to 0
157
159
*/
158
160
struct samsung_div_clock {
159
161
unsigned int id ;
@@ -190,14 +192,14 @@ struct samsung_div_clock {
190
192
__DIV(_id, cname, pname, o, s, w, 0, 0, t)
191
193
192
194
/**
193
- * struct samsung_gate_clock: information about gate clock
194
- * @id: platform specific id of the clock.
195
- * @name: name of this gate clock.
196
- * @parent_name: name of the parent clock.
197
- * @flags: optional flags for basic clock.
198
- * @offset: offset of the register for configuring the gate.
199
- * @bit_idx: bit index of the gate control bit-field in @reg.
200
- * @gate_flags: flags for gate-type clock.
195
+ * struct samsung_gate_clock - information about gate clock
196
+ * @id: platform specific id of the clock
197
+ * @name: name of this gate clock
198
+ * @parent_name: name of the parent clock
199
+ * @flags: optional flags for basic clock
200
+ * @offset: offset of the register for configuring the gate
201
+ * @bit_idx: bit index of the gate control bit-field in @reg
202
+ * @gate_flags: flags for gate-type clock
201
203
*/
202
204
struct samsung_gate_clock {
203
205
unsigned int id ;
@@ -226,24 +228,25 @@ struct samsung_gate_clock {
226
228
#define PNAME (x ) static const char * const x[] __initconst
227
229
228
230
/**
229
- * struct samsung_clk_reg_dump: register dump of clock controller registers.
230
- * @offset: clock register offset from the controller base address.
231
- * @value: the value to be register at offset.
231
+ * struct samsung_clk_reg_dump - register dump of clock controller registers
232
+ * @offset: clock register offset from the controller base address
233
+ * @value: the value to be register at offset
232
234
*/
233
235
struct samsung_clk_reg_dump {
234
236
u32 offset ;
235
237
u32 value ;
236
238
};
237
239
238
240
/**
239
- * struct samsung_pll_clock: information about pll clock
240
- * @id: platform specific id of the clock.
241
- * @name: name of this pll clock.
242
- * @parent_name: name of the parent clock.
243
- * @flags: optional flags for basic clock.
244
- * @con_offset: offset of the register for configuring the PLL.
245
- * @lock_offset: offset of the register for locking the PLL.
246
- * @type: Type of PLL to be registered.
241
+ * struct samsung_pll_clock - information about pll clock
242
+ * @id: platform specific id of the clock
243
+ * @name: name of this pll clock
244
+ * @parent_name: name of the parent clock
245
+ * @flags: optional flags for basic clock
246
+ * @con_offset: offset of the register for configuring the PLL
247
+ * @lock_offset: offset of the register for locking the PLL
248
+ * @type: type of PLL to be registered
249
+ * @rate_table: array of PLL settings for possible PLL rates
247
250
*/
248
251
struct samsung_pll_clock {
249
252
unsigned int id ;
@@ -302,39 +305,51 @@ struct samsung_clock_reg_cache {
302
305
unsigned int rsuspend_num ;
303
306
};
304
307
308
+ /**
309
+ * struct samsung_cmu_info - all clocks information needed for CMU registration
310
+ * @pll_clks: list of PLL clocks
311
+ * @nr_pll_clks: count of clocks in @pll_clks
312
+ * @mux_clks: list of mux clocks
313
+ * @nr_mux_clks: count of clocks in @mux_clks
314
+ * @div_clks: list of div clocks
315
+ * @nr_div_clks: count of clocks in @div_clks
316
+ * @gate_clks: list of gate clocks
317
+ * @nr_gate_clks: count of clocks in @gate_clks
318
+ * @fixed_clks: list of fixed clocks
319
+ * @nr_fixed_clks: count clocks in @fixed_clks
320
+ * @fixed_factor_clks: list of fixed factor clocks
321
+ * @nr_fixed_factor_clks: count of clocks in @fixed_factor_clks
322
+ * @nr_clk_ids: total number of clocks with IDs assigned
323
+ * @cpu_clks: list of CPU clocks
324
+ * @nr_cpu_clks: count of clocks in @cpu_clks
325
+ * @clk_regs: list of clock registers
326
+ * @nr_clk_regs: count of clock registers in @clk_regs
327
+ * @suspend_regs: list of clock registers to set before suspend
328
+ * @nr_suspend_regs: count of clock registers in @suspend_regs
329
+ * @clk_name: name of the parent clock needed for CMU register access
330
+ */
305
331
struct samsung_cmu_info {
306
- /* list of pll clocks and respective count */
307
332
const struct samsung_pll_clock * pll_clks ;
308
333
unsigned int nr_pll_clks ;
309
- /* list of mux clocks and respective count */
310
334
const struct samsung_mux_clock * mux_clks ;
311
335
unsigned int nr_mux_clks ;
312
- /* list of div clocks and respective count */
313
336
const struct samsung_div_clock * div_clks ;
314
337
unsigned int nr_div_clks ;
315
- /* list of gate clocks and respective count */
316
338
const struct samsung_gate_clock * gate_clks ;
317
339
unsigned int nr_gate_clks ;
318
- /* list of fixed clocks and respective count */
319
340
const struct samsung_fixed_rate_clock * fixed_clks ;
320
341
unsigned int nr_fixed_clks ;
321
- /* list of fixed factor clocks and respective count */
322
342
const struct samsung_fixed_factor_clock * fixed_factor_clks ;
323
343
unsigned int nr_fixed_factor_clks ;
324
- /* total number of clocks with IDs assigned*/
325
344
unsigned int nr_clk_ids ;
326
- /* list of cpu clocks and respective count */
327
345
const struct samsung_cpu_clock * cpu_clks ;
328
346
unsigned int nr_cpu_clks ;
329
347
330
- /* list and number of clocks registers */
331
348
const unsigned long * clk_regs ;
332
349
unsigned int nr_clk_regs ;
333
350
334
- /* list and number of clocks registers to set before suspend */
335
351
const struct samsung_clk_reg_dump * suspend_regs ;
336
352
unsigned int nr_suspend_regs ;
337
- /* name of the parent clock needed for CMU register access */
338
353
const char * clk_name ;
339
354
};
340
355
0 commit comments