aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Xie <chao.xie@marvell.com>2014-10-30 22:13:44 -0400
committerMichael Turquette <mturquette@linaro.org>2014-11-12 19:33:48 -0500
commit3a2b2f84957d3c1e380640e23e438c40c730cfd1 (patch)
treeeb11616d1fcde1adaaf96bf65a4eb4f99a5152bd
parent0c4c11f3556b244469af32a7bc13485ecbbc77f9 (diff)
clk: mmp: move definiton of mmp_clk_frac to clk.h
Move the definition of structure of mmp_clk_frac to clk.h. So device tree support can use this structure. Signed-off-by: Chao Xie <chao.xie@marvell.com> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Michael Turquette <mturquette@linaro.org>
-rw-r--r--drivers/clk/mmp/clk-frac.c8
-rw-r--r--drivers/clk/mmp/clk.h32
2 files changed, 22 insertions, 18 deletions
diff --git a/drivers/clk/mmp/clk-frac.c b/drivers/clk/mmp/clk-frac.c
index 1876d2c94bd3..eeba52c2def6 100644
--- a/drivers/clk/mmp/clk-frac.c
+++ b/drivers/clk/mmp/clk-frac.c
@@ -23,14 +23,6 @@
23 */ 23 */
24 24
25#define to_clk_factor(hw) container_of(hw, struct mmp_clk_factor, hw) 25#define to_clk_factor(hw) container_of(hw, struct mmp_clk_factor, hw)
26struct mmp_clk_factor {
27 struct clk_hw hw;
28 void __iomem *base;
29 struct mmp_clk_factor_masks *masks;
30 struct mmp_clk_factor_tbl *ftbl;
31 unsigned int ftbl_cnt;
32 spinlock_t *lock;
33};
34 26
35static long clk_factor_round_rate(struct clk_hw *hw, unsigned long drate, 27static long clk_factor_round_rate(struct clk_hw *hw, unsigned long drate,
36 unsigned long *prate) 28 unsigned long *prate)
diff --git a/drivers/clk/mmp/clk.h b/drivers/clk/mmp/clk.h
index b71b717cdb24..d267639ece2b 100644
--- a/drivers/clk/mmp/clk.h
+++ b/drivers/clk/mmp/clk.h
@@ -7,12 +7,14 @@
7#define APBC_NO_BUS_CTRL BIT(0) 7#define APBC_NO_BUS_CTRL BIT(0)
8#define APBC_POWER_CTRL BIT(1) 8#define APBC_POWER_CTRL BIT(1)
9 9
10
11/* Clock type "factor" */
10struct mmp_clk_factor_masks { 12struct mmp_clk_factor_masks {
11 unsigned int factor; 13 unsigned int factor;
12 unsigned int num_mask; 14 unsigned int num_mask;
13 unsigned int den_mask; 15 unsigned int den_mask;
14 unsigned int num_shift; 16 unsigned int num_shift;
15 unsigned int den_shift; 17 unsigned int den_shift;
16}; 18};
17 19
18struct mmp_clk_factor_tbl { 20struct mmp_clk_factor_tbl {
@@ -20,6 +22,21 @@ struct mmp_clk_factor_tbl {
20 unsigned int den; 22 unsigned int den;
21}; 23};
22 24
25struct mmp_clk_factor {
26 struct clk_hw hw;
27 void __iomem *base;
28 struct mmp_clk_factor_masks *masks;
29 struct mmp_clk_factor_tbl *ftbl;
30 unsigned int ftbl_cnt;
31 spinlock_t *lock;
32};
33
34extern struct clk *mmp_clk_register_factor(const char *name,
35 const char *parent_name, unsigned long flags,
36 void __iomem *base, struct mmp_clk_factor_masks *masks,
37 struct mmp_clk_factor_tbl *ftbl, unsigned int ftbl_cnt,
38 spinlock_t *lock);
39
23extern struct clk *mmp_clk_register_pll2(const char *name, 40extern struct clk *mmp_clk_register_pll2(const char *name,
24 const char *parent_name, unsigned long flags); 41 const char *parent_name, unsigned long flags);
25extern struct clk *mmp_clk_register_apbc(const char *name, 42extern struct clk *mmp_clk_register_apbc(const char *name,
@@ -28,9 +45,4 @@ extern struct clk *mmp_clk_register_apbc(const char *name,
28extern struct clk *mmp_clk_register_apmu(const char *name, 45extern struct clk *mmp_clk_register_apmu(const char *name,
29 const char *parent_name, void __iomem *base, u32 enable_mask, 46 const char *parent_name, void __iomem *base, u32 enable_mask,
30 spinlock_t *lock); 47 spinlock_t *lock);
31extern struct clk *mmp_clk_register_factor(const char *name,
32 const char *parent_name, unsigned long flags,
33 void __iomem *base, struct mmp_clk_factor_masks *masks,
34 struct mmp_clk_factor_tbl *ftbl, unsigned int ftbl_cnt,
35 spinlock_t *lock);
36#endif 48#endif