libceph: clear r_req_lru_item in __unregister_linger_request()
[linux/fpc-iii.git] / arch / arm / mach-imx / clk.h
blob4cdf8b6a74e8e7d8616400aa2a2c971a5d2d133a
1 #ifndef __MACH_IMX_CLK_H
2 #define __MACH_IMX_CLK_H
4 #include <linux/spinlock.h>
5 #include <linux/clk-provider.h>
7 extern spinlock_t imx_ccm_lock;
9 void imx_check_clocks(struct clk *clks[], unsigned int count);
11 extern void imx_cscmr1_fixup(u32 *val);
13 struct clk *imx_clk_pllv1(const char *name, const char *parent,
14 void __iomem *base);
16 struct clk *imx_clk_pllv2(const char *name, const char *parent,
17 void __iomem *base);
19 enum imx_pllv3_type {
20 IMX_PLLV3_GENERIC,
21 IMX_PLLV3_SYS,
22 IMX_PLLV3_USB,
23 IMX_PLLV3_AV,
24 IMX_PLLV3_ENET,
27 struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
28 const char *parent_name, void __iomem *base, u32 div_mask);
30 struct clk *clk_register_gate2(struct device *dev, const char *name,
31 const char *parent_name, unsigned long flags,
32 void __iomem *reg, u8 bit_idx,
33 u8 clk_gate_flags, spinlock_t *lock,
34 unsigned int *share_count);
36 struct clk * imx_obtain_fixed_clock(
37 const char *name, unsigned long rate);
39 struct clk *imx_clk_gate_exclusive(const char *name, const char *parent,
40 void __iomem *reg, u8 shift, u32 exclusive_mask);
42 static inline struct clk *imx_clk_gate2(const char *name, const char *parent,
43 void __iomem *reg, u8 shift)
45 return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg,
46 shift, 0, &imx_ccm_lock, NULL);
49 static inline struct clk *imx_clk_gate2_shared(const char *name,
50 const char *parent, void __iomem *reg, u8 shift,
51 unsigned int *share_count)
53 return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg,
54 shift, 0, &imx_ccm_lock, share_count);
57 struct clk *imx_clk_pfd(const char *name, const char *parent_name,
58 void __iomem *reg, u8 idx);
60 struct clk *imx_clk_busy_divider(const char *name, const char *parent_name,
61 void __iomem *reg, u8 shift, u8 width,
62 void __iomem *busy_reg, u8 busy_shift);
64 struct clk *imx_clk_busy_mux(const char *name, void __iomem *reg, u8 shift,
65 u8 width, void __iomem *busy_reg, u8 busy_shift,
66 const char **parent_names, int num_parents);
68 struct clk *imx_clk_fixup_divider(const char *name, const char *parent,
69 void __iomem *reg, u8 shift, u8 width,
70 void (*fixup)(u32 *val));
72 struct clk *imx_clk_fixup_mux(const char *name, void __iomem *reg,
73 u8 shift, u8 width, const char **parents,
74 int num_parents, void (*fixup)(u32 *val));
76 static inline struct clk *imx_clk_fixed(const char *name, int rate)
78 return clk_register_fixed_rate(NULL, name, NULL, CLK_IS_ROOT, rate);
81 static inline struct clk *imx_clk_divider(const char *name, const char *parent,
82 void __iomem *reg, u8 shift, u8 width)
84 return clk_register_divider(NULL, name, parent, CLK_SET_RATE_PARENT,
85 reg, shift, width, 0, &imx_ccm_lock);
88 static inline struct clk *imx_clk_divider_flags(const char *name,
89 const char *parent, void __iomem *reg, u8 shift, u8 width,
90 unsigned long flags)
92 return clk_register_divider(NULL, name, parent, flags,
93 reg, shift, width, 0, &imx_ccm_lock);
96 static inline struct clk *imx_clk_gate(const char *name, const char *parent,
97 void __iomem *reg, u8 shift)
99 return clk_register_gate(NULL, name, parent, CLK_SET_RATE_PARENT, reg,
100 shift, 0, &imx_ccm_lock);
103 static inline struct clk *imx_clk_gate_dis(const char *name, const char *parent,
104 void __iomem *reg, u8 shift)
106 return clk_register_gate(NULL, name, parent, CLK_SET_RATE_PARENT, reg,
107 shift, CLK_GATE_SET_TO_DISABLE, &imx_ccm_lock);
110 static inline struct clk *imx_clk_mux(const char *name, void __iomem *reg,
111 u8 shift, u8 width, const char **parents, int num_parents)
113 return clk_register_mux(NULL, name, parents, num_parents,
114 CLK_SET_RATE_NO_REPARENT, reg, shift,
115 width, 0, &imx_ccm_lock);
118 static inline struct clk *imx_clk_mux_flags(const char *name,
119 void __iomem *reg, u8 shift, u8 width, const char **parents,
120 int num_parents, unsigned long flags)
122 return clk_register_mux(NULL, name, parents, num_parents,
123 flags | CLK_SET_RATE_NO_REPARENT, reg, shift, width, 0,
124 &imx_ccm_lock);
127 static inline struct clk *imx_clk_fixed_factor(const char *name,
128 const char *parent, unsigned int mult, unsigned int div)
130 return clk_register_fixed_factor(NULL, name, parent,
131 CLK_SET_RATE_PARENT, mult, div);
134 #endif