xref: /openbmc/linux/arch/m68k/include/asm/mcfclk.h (revision eb3fcf00)
1 /*
2  * mcfclk.h -- coldfire specific clock structure
3  */
4 
5 
6 #ifndef mcfclk_h
7 #define mcfclk_h
8 
9 struct clk;
10 
11 struct clk_ops {
12 	void (*enable)(struct clk *);
13 	void (*disable)(struct clk *);
14 };
15 
16 struct clk {
17 	const char *name;
18 	struct clk_ops *clk_ops;
19 	unsigned long rate;
20 	unsigned long enabled;
21 	u8 slot;
22 };
23 
24 extern struct clk *mcf_clks[];
25 
26 #ifdef MCFPM_PPMCR0
27 extern struct clk_ops clk_ops0;
28 #ifdef MCFPM_PPMCR1
29 extern struct clk_ops clk_ops1;
30 #endif /* MCFPM_PPMCR1 */
31 
32 #define DEFINE_CLK(clk_bank, clk_name, clk_slot, clk_rate) \
33 static struct clk __clk_##clk_bank##_##clk_slot = { \
34 	.name = clk_name, \
35 	.clk_ops = &clk_ops##clk_bank, \
36 	.rate = clk_rate, \
37 	.slot = clk_slot, \
38 }
39 
40 void __clk_init_enabled(struct clk *);
41 void __clk_init_disabled(struct clk *);
42 #else
43 #define DEFINE_CLK(clk_ref, clk_name, clk_rate) \
44         static struct clk clk_##clk_ref = { \
45                 .name = clk_name, \
46                 .rate = clk_rate, \
47         }
48 #endif /* MCFPM_PPMCR0 */
49 
50 #endif /* mcfclk_h */
51