diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2015-01-20 03:05:29 +0100 |
---|---|---|
committer | Michael Turquette <mturquette@linaro.org> | 2015-01-27 20:48:52 +0100 |
commit | bca9690b942654f668ffb5124b2bbd0ba0f007bb (patch) | |
tree | b0e4a32c3175916fbe680dbad1687ac9c7185221 /include | |
parent | clk: Add __clk_mux_determine_rate_closest (diff) | |
download | linux-bca9690b942654f668ffb5124b2bbd0ba0f007bb.tar.xz linux-bca9690b942654f668ffb5124b2bbd0ba0f007bb.zip |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/clk-provider.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index ba858e90d5de..0ed5bf2209ad 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -353,6 +353,17 @@ struct clk_divider { #define CLK_DIVIDER_READ_ONLY BIT(5) extern const struct clk_ops clk_divider_ops; + +unsigned long divider_recalc_rate(struct clk_hw *hw, unsigned long parent_rate, + unsigned int val, const struct clk_div_table *table, + unsigned long flags); +long divider_round_rate(struct clk_hw *hw, 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_register_divider(struct device *dev, const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 shift, u8 width, |