diff options
author | Marcin Niestroj <m.niestroj@grinn-global.com> | 2019-06-28 17:33:50 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-07-02 12:35:31 +0200 |
commit | d5e22fcca70a5b2ed51981516cfe13103122cc98 (patch) | |
tree | 0cc87d28035c73509e52921a987c77e793d1e1cc /include/linux | |
parent | b75025a39c77d4a7f408e56d44863bb98f1201f1 (diff) | |
download | barebox-d5e22fcca70a5b2ed51981516cfe13103122cc98.tar.gz barebox-d5e22fcca70a5b2ed51981516cfe13103122cc98.tar.xz |
clk: divider: Make generic for usage elsewhere
commit bca9690b942654f668ffb5124b2bbd0ba0f007bb Linux upstream adjusted
to current Barebox codebase.
clk: divider: Make generic for usage elsewhere
Some devices don't use mmio to interact with dividers. Split out the
logic from the register read/write parts so that we can reuse the
division logic elsewhere.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Tested-by: Kenneth Westfield <kwestfie@codeaurora.org>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/clk.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h index b9c5e0ab04..ed78ffe46c 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -354,6 +354,14 @@ unsigned long divider_recalc_rate(struct clk *clk, unsigned long parent_rate, const struct clk_div_table *table, unsigned long flags, unsigned long width); +long divider_round_rate(struct clk *clk, unsigned long rate, + unsigned long *prate, const struct clk_div_table *table, + u8 width, unsigned long flags); + +int divider_get_val(unsigned long rate, unsigned long parent_rate, + const struct clk_div_table *table, u8 width, + unsigned long flags); + struct clk *clk_divider_alloc(const char *name, const char *parent, unsigned clk_flags, void __iomem *reg, u8 shift, u8 width, unsigned div_flags); |