summaryrefslogtreecommitdiff
path: root/drivers/clk/rockchip/clk.c
diff options
context:
space:
mode:
authorFinley Xiao <finley.xiao@rock-chips.com>2018-03-05 16:15:15 +0800
committerTao Huang <huangtao@rock-chips.com>2018-06-25 09:39:24 +0800
commit421e14f3bc5c3c3bc1fbcfd88c96f26427d9b094 (patch)
treecfeed0a0941d2a715d09f02781ef30646476ff68 /drivers/clk/rockchip/clk.c
parentba98e189b68be0fe123deb04ebe669d3948f8f61 (diff)
clk: rockchip: add a COMPOSITE_DIV_OFFSET clock-type
The div offset of some clocks are different from their mux offset and the COMPOSITE clock-type require that div and mux offset are the same, so add a new COMPOSITE_DIV_OFFSET clock-type to handle that. Change-Id: I7d541e29328f37d2ad806b3b6e5ab35b5513b345 Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Diffstat (limited to 'drivers/clk/rockchip/clk.c')
-rw-r--r--drivers/clk/rockchip/clk.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c
index 9fbcc8bc861b..b187fae83991 100644
--- a/drivers/clk/rockchip/clk.c
+++ b/drivers/clk/rockchip/clk.c
@@ -45,7 +45,7 @@
static struct clk *rockchip_clk_register_branch(const char *name,
const char *const *parent_names, u8 num_parents, void __iomem *base,
int muxdiv_offset, u8 mux_shift, u8 mux_width, u8 mux_flags,
- u8 div_shift, u8 div_width, u8 div_flags,
+ int div_offset, u8 div_shift, u8 div_width, u8 div_flags,
struct clk_div_table *div_table, int gate_offset,
u8 gate_shift, u8 gate_flags, unsigned long flags,
spinlock_t *lock)
@@ -89,7 +89,10 @@ static struct clk *rockchip_clk_register_branch(const char *name,
goto err_div;
div->flags = div_flags;
- div->reg = base + muxdiv_offset;
+ if (div_offset)
+ div->reg = base + div_offset;
+ else
+ div->reg = base + muxdiv_offset;
div->shift = div_shift;
div->width = div_width;
div->lock = lock;
@@ -538,7 +541,7 @@ void __init rockchip_clk_register_branches(
list->parent_names, list->num_parents,
ctx->reg_base, list->muxdiv_offset, list->mux_shift,
list->mux_width, list->mux_flags,
- list->div_shift, list->div_width,
+ list->div_offset, list->div_shift, list->div_width,
list->div_flags, list->div_table,
list->gate_offset, list->gate_shift,
list->gate_flags, flags, &ctx->lock);