diff options
author | Maxime COQUELIN <maxime.coquelin@st.com> | 2014-01-29 17:24:07 +0100 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2014-04-30 11:51:26 -0700 |
commit | 774b514390b1eb8476bc759262790762bd1ef45a (patch) | |
tree | b283823eca82e2e5a71fbd90b203da950fd96764 /include/linux/clk-provider.h | |
parent | 874f224cc52d64c912087e68e3724be95ad80ee7 (diff) | |
download | lwn-774b514390b1eb8476bc759262790762bd1ef45a.tar.gz lwn-774b514390b1eb8476bc759262790762bd1ef45a.zip |
clk: divider: Add round to closest divider
In some cases, we want to be able to round the divider to the closest one,
instead than rounding up.
This patch adds a new CLK_DIVIDER_ROUND_CLOSEST flag to specify the divider
has to round to closest div, keeping rounding up as de default behaviour.
Signed-off-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'include/linux/clk-provider.h')
-rw-r--r-- | include/linux/clk-provider.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 511917416fb0..59e2eb58f555 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -312,6 +312,8 @@ struct clk_div_table { * of this register, and mask of divider bits are in higher 16-bit of this * register. While setting the divider bits, higher 16-bit should also be * updated to indicate changing divider bits. + * CLK_DIVIDER_ROUND_CLOSEST - Makes the best calculated divider to be rounded + * to the closest integer instead of the up one. */ struct clk_divider { struct clk_hw hw; @@ -327,6 +329,7 @@ struct clk_divider { #define CLK_DIVIDER_POWER_OF_TWO BIT(1) #define CLK_DIVIDER_ALLOW_ZERO BIT(2) #define CLK_DIVIDER_HIWORD_MASK BIT(3) +#define CLK_DIVIDER_ROUND_CLOSEST BIT(4) extern const struct clk_ops clk_divider_ops; struct clk *clk_register_divider(struct device *dev, const char *name, |