diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/clk/rockchip/clk.c | 9 | ||||
| -rw-r--r-- | drivers/clk/rockchip/clk.h | 23 |
2 files changed, 29 insertions, 3 deletions
diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c index c3ad92965823..0ea8e8080d1a 100644 --- a/drivers/clk/rockchip/clk.c +++ b/drivers/clk/rockchip/clk.c | |||
| @@ -46,7 +46,7 @@ static struct clk *rockchip_clk_register_branch(const char *name, | |||
| 46 | const char *const *parent_names, u8 num_parents, | 46 | const char *const *parent_names, u8 num_parents, |
| 47 | void __iomem *base, | 47 | void __iomem *base, |
| 48 | int muxdiv_offset, u8 mux_shift, u8 mux_width, u8 mux_flags, | 48 | int muxdiv_offset, u8 mux_shift, u8 mux_width, u8 mux_flags, |
| 49 | u8 div_shift, u8 div_width, u8 div_flags, | 49 | int div_offset, u8 div_shift, u8 div_width, u8 div_flags, |
| 50 | struct clk_div_table *div_table, int gate_offset, | 50 | struct clk_div_table *div_table, int gate_offset, |
| 51 | u8 gate_shift, u8 gate_flags, unsigned long flags, | 51 | u8 gate_shift, u8 gate_flags, unsigned long flags, |
| 52 | spinlock_t *lock) | 52 | spinlock_t *lock) |
| @@ -95,7 +95,10 @@ static struct clk *rockchip_clk_register_branch(const char *name, | |||
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | div->flags = div_flags; | 97 | div->flags = div_flags; |
| 98 | div->reg = base + muxdiv_offset; | 98 | if (div_offset) |
| 99 | div->reg = base + div_offset; | ||
| 100 | else | ||
| 101 | div->reg = base + muxdiv_offset; | ||
| 99 | div->shift = div_shift; | 102 | div->shift = div_shift; |
| 100 | div->width = div_width; | 103 | div->width = div_width; |
| 101 | div->lock = lock; | 104 | div->lock = lock; |
| @@ -516,7 +519,7 @@ void __init rockchip_clk_register_branches( | |||
| 516 | ctx->reg_base, list->muxdiv_offset, | 519 | ctx->reg_base, list->muxdiv_offset, |
| 517 | list->mux_shift, | 520 | list->mux_shift, |
| 518 | list->mux_width, list->mux_flags, | 521 | list->mux_width, list->mux_flags, |
| 519 | list->div_shift, list->div_width, | 522 | list->div_offset, list->div_shift, list->div_width, |
| 520 | list->div_flags, list->div_table, | 523 | list->div_flags, list->div_table, |
| 521 | list->gate_offset, list->gate_shift, | 524 | list->gate_offset, list->gate_shift, |
| 522 | list->gate_flags, flags, &ctx->lock); | 525 | list->gate_flags, flags, &ctx->lock); |
diff --git a/drivers/clk/rockchip/clk.h b/drivers/clk/rockchip/clk.h index 6b53fff4cc96..1b5270755431 100644 --- a/drivers/clk/rockchip/clk.h +++ b/drivers/clk/rockchip/clk.h | |||
| @@ -407,6 +407,7 @@ struct rockchip_clk_branch { | |||
| 407 | u8 mux_shift; | 407 | u8 mux_shift; |
| 408 | u8 mux_width; | 408 | u8 mux_width; |
| 409 | u8 mux_flags; | 409 | u8 mux_flags; |
| 410 | int div_offset; | ||
| 410 | u8 div_shift; | 411 | u8 div_shift; |
| 411 | u8 div_width; | 412 | u8 div_width; |
| 412 | u8 div_flags; | 413 | u8 div_flags; |
| @@ -438,6 +439,28 @@ struct rockchip_clk_branch { | |||
| 438 | .gate_flags = gf, \ | 439 | .gate_flags = gf, \ |
| 439 | } | 440 | } |
| 440 | 441 | ||
| 442 | #define COMPOSITE_DIV_OFFSET(_id, cname, pnames, f, mo, ms, mw, \ | ||
| 443 | mf, do, ds, dw, df, go, gs, gf) \ | ||
| 444 | { \ | ||
| 445 | .id = _id, \ | ||
| 446 | .branch_type = branch_composite, \ | ||
| 447 | .name = cname, \ | ||
| 448 | .parent_names = pnames, \ | ||
| 449 | .num_parents = ARRAY_SIZE(pnames), \ | ||
| 450 | .flags = f, \ | ||
| 451 | .muxdiv_offset = mo, \ | ||
| 452 | .mux_shift = ms, \ | ||
| 453 | .mux_width = mw, \ | ||
| 454 | .mux_flags = mf, \ | ||
| 455 | .div_offset = do, \ | ||
| 456 | .div_shift = ds, \ | ||
| 457 | .div_width = dw, \ | ||
| 458 | .div_flags = df, \ | ||
| 459 | .gate_offset = go, \ | ||
| 460 | .gate_shift = gs, \ | ||
| 461 | .gate_flags = gf, \ | ||
| 462 | } | ||
| 463 | |||
| 441 | #define COMPOSITE_NOMUX(_id, cname, pname, f, mo, ds, dw, df, \ | 464 | #define COMPOSITE_NOMUX(_id, cname, pname, f, mo, ds, dw, df, \ |
| 442 | go, gs, gf) \ | 465 | go, gs, gf) \ |
| 443 | { \ | 466 | { \ |
