diff options
author | Michael Turquette <mturquette@linaro.org> | 2014-11-24 17:45:33 -0800 |
---|---|---|
committer | Michael Turquette <mturquette@linaro.org> | 2014-11-24 17:45:33 -0800 |
commit | da57b46010dd8d93aabc4c3e8d11751ac617d914 (patch) | |
tree | 1fe26ac6679ea8e76276da87582fcb95210974ed /drivers/clk/clk-divider.c | |
parent | 7f615dd43ced8dc5424ad3fa95edd6b7fbbbc27c (diff) | |
parent | dcf3d458304aafda3d12413ade39fdf19740dbc3 (diff) | |
download | linux-stable-da57b46010dd8d93aabc4c3e8d11751ac617d914.tar.gz linux-stable-da57b46010dd8d93aabc4c3e8d11751ac617d914.tar.bz2 linux-stable-da57b46010dd8d93aabc4c3e8d11751ac617d914.zip |
Merge branch 'clk-fixes' into clk-next
Diffstat (limited to 'drivers/clk/clk-divider.c')
-rw-r--r-- | drivers/clk/clk-divider.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c index 18a9de29df0e..c0a842b335c5 100644 --- a/drivers/clk/clk-divider.c +++ b/drivers/clk/clk-divider.c @@ -263,6 +263,14 @@ static int clk_divider_bestdiv(struct clk_hw *hw, unsigned long rate, if (!rate) rate = 1; + /* if read only, just return current value */ + if (divider->flags & CLK_DIVIDER_READ_ONLY) { + bestdiv = readl(divider->reg) >> divider->shift; + bestdiv &= div_mask(divider); + bestdiv = _get_div(divider, bestdiv); + return bestdiv; + } + maxdiv = _get_maxdiv(divider); if (!(__clk_get_flags(hw->clk) & CLK_SET_RATE_PARENT)) { @@ -361,11 +369,6 @@ const struct clk_ops clk_divider_ops = { }; EXPORT_SYMBOL_GPL(clk_divider_ops); -const struct clk_ops clk_divider_ro_ops = { - .recalc_rate = clk_divider_recalc_rate, -}; -EXPORT_SYMBOL_GPL(clk_divider_ro_ops); - static struct clk *_register_divider(struct device *dev, const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 shift, u8 width, @@ -391,10 +394,7 @@ static struct clk *_register_divider(struct device *dev, const char *name, } init.name = name; - if (clk_divider_flags & CLK_DIVIDER_READ_ONLY) - init.ops = &clk_divider_ro_ops; - else - init.ops = &clk_divider_ops; + init.ops = &clk_divider_ops; init.flags = flags | CLK_IS_BASIC; init.parent_names = (parent_name ? &parent_name: NULL); init.num_parents = (parent_name ? 1 : 0); |