Skip to content

Commit

Permalink
clk: mmp: move definiton of mmp_clk_frac to clk.h
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chao Xie authored and Michael Turquette committed Nov 13, 2014
1 parent 0c4c11f commit 3a2b2f8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
8 changes: 0 additions & 8 deletions drivers/clk/mmp/clk-frac.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@
*/

#define to_clk_factor(hw) container_of(hw, struct mmp_clk_factor, hw)
struct mmp_clk_factor {
struct clk_hw hw;
void __iomem *base;
struct mmp_clk_factor_masks *masks;
struct mmp_clk_factor_tbl *ftbl;
unsigned int ftbl_cnt;
spinlock_t *lock;
};

static long clk_factor_round_rate(struct clk_hw *hw, unsigned long drate,
unsigned long *prate)
Expand Down
32 changes: 22 additions & 10 deletions drivers/clk/mmp/clk.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,36 @@
#define APBC_NO_BUS_CTRL BIT(0)
#define APBC_POWER_CTRL BIT(1)


/* Clock type "factor" */
struct mmp_clk_factor_masks {
unsigned int factor;
unsigned int num_mask;
unsigned int den_mask;
unsigned int num_shift;
unsigned int den_shift;
unsigned int factor;
unsigned int num_mask;
unsigned int den_mask;
unsigned int num_shift;
unsigned int den_shift;
};

struct mmp_clk_factor_tbl {
unsigned int num;
unsigned int den;
};

struct mmp_clk_factor {
struct clk_hw hw;
void __iomem *base;
struct mmp_clk_factor_masks *masks;
struct mmp_clk_factor_tbl *ftbl;
unsigned int ftbl_cnt;
spinlock_t *lock;
};

extern struct clk *mmp_clk_register_factor(const char *name,
const char *parent_name, unsigned long flags,
void __iomem *base, struct mmp_clk_factor_masks *masks,
struct mmp_clk_factor_tbl *ftbl, unsigned int ftbl_cnt,
spinlock_t *lock);

extern struct clk *mmp_clk_register_pll2(const char *name,
const char *parent_name, unsigned long flags);
extern struct clk *mmp_clk_register_apbc(const char *name,
Expand All @@ -28,9 +45,4 @@ extern struct clk *mmp_clk_register_apbc(const char *name,
extern struct clk *mmp_clk_register_apmu(const char *name,
const char *parent_name, void __iomem *base, u32 enable_mask,
spinlock_t *lock);
extern struct clk *mmp_clk_register_factor(const char *name,
const char *parent_name, unsigned long flags,
void __iomem *base, struct mmp_clk_factor_masks *masks,
struct mmp_clk_factor_tbl *ftbl, unsigned int ftbl_cnt,
spinlock_t *lock);
#endif

0 comments on commit 3a2b2f8

Please sign in to comment.