diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2014-09-05 15:47:22 -0700 |
---|---|---|
committer | Andrey Konovalov <andrey.konovalov@linaro.org> | 2015-01-13 17:56:42 +0300 |
commit | 1e9d423a8818503391d17fe62f549684c2a89039 (patch) | |
tree | 50e2911f51682143ea865ba3f4631bbde8e4d27b /include | |
parent | 40b23eaff7000466d66c6cc11ac66361aaba7480 (diff) |
clk: Add __clk_mux_determine_rate_closest
Some clock drivers want to find the closest rate on the input of
a mux instead of a rate that's less than or equal to the desired
rate. Add a generic mux function to support this.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/clk-provider.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 2338efd232ab..e0da50fcc601 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -382,6 +382,8 @@ struct clk *clk_register_divider_table(struct device *dev, const char *name, * register, and mask of mux bits are in higher 16-bit of this register. * While setting the mux bits, higher 16-bit should also be updated to * indicate changing mux bits. + * CLK_MUX_ROUND_CLOSEST - Use the parent rate that is closest to the desired + * frequency. */ struct clk_mux { struct clk_hw hw; @@ -396,7 +398,8 @@ struct clk_mux { #define CLK_MUX_INDEX_ONE BIT(0) #define CLK_MUX_INDEX_BIT BIT(1) #define CLK_MUX_HIWORD_MASK BIT(2) -#define CLK_MUX_READ_ONLY BIT(3) /* mux setting cannot be changed */ +#define CLK_MUX_READ_ONLY BIT(3) /* mux can't be changed */ +#define CLK_MUX_ROUND_CLOSEST BIT(4) extern const struct clk_ops clk_mux_ops; extern const struct clk_ops clk_mux_ro_ops; @@ -559,7 +562,9 @@ struct clk *__clk_lookup(const char *name); long __clk_mux_determine_rate(struct clk_hw *hw, unsigned long rate, unsigned long *best_parent_rate, struct clk_hw **best_parent_p); - +long __clk_mux_determine_rate_closest(struct clk_hw *hw, unsigned long rate, + unsigned long *best_parent_rate, + struct clk_hw **best_parent_p); /* * FIXME clock api without lock protection */ |