Commit 2bd1e256 authored by Chao Xie's avatar Chao Xie Committed by Michael Turquette

clk: mmp: add prefix "mmp" for structures defined for clk-frac

The structures defined for clk-frac will be used out side
of clk-frac.c.
To avoid conflicts, add prefix "mmp" for these structures'
name.
Signed-off-by: default avatarChao Xie <chao.xie@marvell.com>
Acked-by: default avatarHaojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: default avatarMichael Turquette <mturquette@linaro.org>
parent 206c5f60
...@@ -22,19 +22,19 @@ ...@@ -22,19 +22,19 @@
* numerator/denominator = Fin / (Fout * factor) * numerator/denominator = Fin / (Fout * factor)
*/ */
#define to_clk_factor(hw) container_of(hw, struct clk_factor, hw) #define to_clk_factor(hw) container_of(hw, struct mmp_clk_factor, hw)
struct clk_factor { struct mmp_clk_factor {
struct clk_hw hw; struct clk_hw hw;
void __iomem *base; void __iomem *base;
struct clk_factor_masks *masks; struct mmp_clk_factor_masks *masks;
struct clk_factor_tbl *ftbl; struct mmp_clk_factor_tbl *ftbl;
unsigned int ftbl_cnt; unsigned int ftbl_cnt;
}; };
static long clk_factor_round_rate(struct clk_hw *hw, unsigned long drate, static long clk_factor_round_rate(struct clk_hw *hw, unsigned long drate,
unsigned long *prate) unsigned long *prate)
{ {
struct clk_factor *factor = to_clk_factor(hw); struct mmp_clk_factor *factor = to_clk_factor(hw);
unsigned long rate = 0, prev_rate; unsigned long rate = 0, prev_rate;
int i; int i;
...@@ -58,8 +58,8 @@ static long clk_factor_round_rate(struct clk_hw *hw, unsigned long drate, ...@@ -58,8 +58,8 @@ static long clk_factor_round_rate(struct clk_hw *hw, unsigned long drate,
static unsigned long clk_factor_recalc_rate(struct clk_hw *hw, static unsigned long clk_factor_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) unsigned long parent_rate)
{ {
struct clk_factor *factor = to_clk_factor(hw); struct mmp_clk_factor *factor = to_clk_factor(hw);
struct clk_factor_masks *masks = factor->masks; struct mmp_clk_factor_masks *masks = factor->masks;
unsigned int val, num, den; unsigned int val, num, den;
val = readl_relaxed(factor->base); val = readl_relaxed(factor->base);
...@@ -81,8 +81,8 @@ static unsigned long clk_factor_recalc_rate(struct clk_hw *hw, ...@@ -81,8 +81,8 @@ static unsigned long clk_factor_recalc_rate(struct clk_hw *hw,
static int clk_factor_set_rate(struct clk_hw *hw, unsigned long drate, static int clk_factor_set_rate(struct clk_hw *hw, unsigned long drate,
unsigned long prate) unsigned long prate)
{ {
struct clk_factor *factor = to_clk_factor(hw); struct mmp_clk_factor *factor = to_clk_factor(hw);
struct clk_factor_masks *masks = factor->masks; struct mmp_clk_factor_masks *masks = factor->masks;
int i; int i;
unsigned long val; unsigned long val;
unsigned long prev_rate, rate = 0; unsigned long prev_rate, rate = 0;
...@@ -118,10 +118,11 @@ static struct clk_ops clk_factor_ops = { ...@@ -118,10 +118,11 @@ static struct clk_ops clk_factor_ops = {
struct clk *mmp_clk_register_factor(const char *name, const char *parent_name, struct clk *mmp_clk_register_factor(const char *name, const char *parent_name,
unsigned long flags, void __iomem *base, unsigned long flags, void __iomem *base,
struct clk_factor_masks *masks, struct clk_factor_tbl *ftbl, struct mmp_clk_factor_masks *masks,
struct mmp_clk_factor_tbl *ftbl,
unsigned int ftbl_cnt) unsigned int ftbl_cnt)
{ {
struct clk_factor *factor; struct mmp_clk_factor *factor;
struct clk_init_data init; struct clk_init_data init;
struct clk *clk; struct clk *clk;
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
static DEFINE_SPINLOCK(clk_lock); static DEFINE_SPINLOCK(clk_lock);
static struct clk_factor_masks uart_factor_masks = { static struct mmp_clk_factor_masks uart_factor_masks = {
.factor = 2, .factor = 2,
.num_mask = 0x1fff, .num_mask = 0x1fff,
.den_mask = 0x1fff, .den_mask = 0x1fff,
...@@ -62,7 +62,7 @@ static struct clk_factor_masks uart_factor_masks = { ...@@ -62,7 +62,7 @@ static struct clk_factor_masks uart_factor_masks = {
.den_shift = 0, .den_shift = 0,
}; };
static struct clk_factor_tbl uart_factor_tbl[] = { static struct mmp_clk_factor_tbl uart_factor_tbl[] = {
{.num = 14634, .den = 2165}, /*14.745MHZ */ {.num = 14634, .den = 2165}, /*14.745MHZ */
{.num = 3521, .den = 689}, /*19.23MHZ */ {.num = 3521, .den = 689}, /*19.23MHZ */
{.num = 9679, .den = 5728}, /*58.9824MHZ */ {.num = 9679, .den = 5728}, /*58.9824MHZ */
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
static DEFINE_SPINLOCK(clk_lock); static DEFINE_SPINLOCK(clk_lock);
static struct clk_factor_masks uart_factor_masks = { static struct mmp_clk_factor_masks uart_factor_masks = {
.factor = 2, .factor = 2,
.num_mask = 0x1fff, .num_mask = 0x1fff,
.den_mask = 0x1fff, .den_mask = 0x1fff,
...@@ -55,7 +55,7 @@ static struct clk_factor_masks uart_factor_masks = { ...@@ -55,7 +55,7 @@ static struct clk_factor_masks uart_factor_masks = {
.den_shift = 0, .den_shift = 0,
}; };
static struct clk_factor_tbl uart_factor_tbl[] = { static struct mmp_clk_factor_tbl uart_factor_tbl[] = {
{.num = 8125, .den = 1536}, /*14.745MHZ */ {.num = 8125, .den = 1536}, /*14.745MHZ */
}; };
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
static DEFINE_SPINLOCK(clk_lock); static DEFINE_SPINLOCK(clk_lock);
static struct clk_factor_masks uart_factor_masks = { static struct mmp_clk_factor_masks uart_factor_masks = {
.factor = 2, .factor = 2,
.num_mask = 0x1fff, .num_mask = 0x1fff,
.den_mask = 0x1fff, .den_mask = 0x1fff,
...@@ -53,7 +53,7 @@ static struct clk_factor_masks uart_factor_masks = { ...@@ -53,7 +53,7 @@ static struct clk_factor_masks uart_factor_masks = {
.den_shift = 0, .den_shift = 0,
}; };
static struct clk_factor_tbl uart_factor_tbl[] = { static struct mmp_clk_factor_tbl uart_factor_tbl[] = {
{.num = 8125, .den = 1536}, /*14.745MHZ */ {.num = 8125, .den = 1536}, /*14.745MHZ */
}; };
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#define APBC_NO_BUS_CTRL BIT(0) #define APBC_NO_BUS_CTRL BIT(0)
#define APBC_POWER_CTRL BIT(1) #define APBC_POWER_CTRL BIT(1)
struct clk_factor_masks { struct mmp_clk_factor_masks {
unsigned int factor; unsigned int factor;
unsigned int num_mask; unsigned int num_mask;
unsigned int den_mask; unsigned int den_mask;
...@@ -15,7 +15,7 @@ struct clk_factor_masks { ...@@ -15,7 +15,7 @@ struct clk_factor_masks {
unsigned int den_shift; unsigned int den_shift;
}; };
struct clk_factor_tbl { struct mmp_clk_factor_tbl {
unsigned int num; unsigned int num;
unsigned int den; unsigned int den;
}; };
...@@ -30,6 +30,6 @@ extern struct clk *mmp_clk_register_apmu(const char *name, ...@@ -30,6 +30,6 @@ extern struct clk *mmp_clk_register_apmu(const char *name,
spinlock_t *lock); spinlock_t *lock);
extern struct clk *mmp_clk_register_factor(const char *name, extern struct clk *mmp_clk_register_factor(const char *name,
const char *parent_name, unsigned long flags, const char *parent_name, unsigned long flags,
void __iomem *base, struct clk_factor_masks *masks, void __iomem *base, struct mmp_clk_factor_masks *masks,
struct clk_factor_tbl *ftbl, unsigned int ftbl_cnt); struct mmp_clk_factor_tbl *ftbl, unsigned int ftbl_cnt);
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment