Skip to content

Commit

Permalink
clk: fractional-divider: support for divider bypassing
Browse files Browse the repository at this point in the history
If the divider or multiplier values are 0 in the register, bypassing the
divider and returning the parent clock rate in clk_fd_recalc_rate().

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
[mturquette@linaro.org: fixed commitlog typo]
  • Loading branch information
Heikki Krogerus authored and bebarino committed Mar 12, 2015
1 parent 496eadf commit 6b54783
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/clk/clk-fractional-divider.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ static unsigned long clk_fd_recalc_rate(struct clk_hw *hw,
m = (val & fd->mmask) >> fd->mshift;
n = (val & fd->nmask) >> fd->nshift;

if (!n || !m)
return parent_rate;

ret = (u64)parent_rate * m;
do_div(ret, n);

Expand Down

0 comments on commit 6b54783

Please sign in to comment.