diff options
author | Soren Brinkmann <soren.brinkmann@xilinx.com> | 2013-04-02 18:36:56 -0400 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2013-04-03 15:56:30 -0400 |
commit | 056b205316cc3dcf8a67cf813a26ff8a72bf3cb9 (patch) | |
tree | 3d98f8d116d5e7541cf41eec72847b2d3673324a /drivers/clk/clk-divider.c | |
parent | f640c0fad698c0e4b07e05373681d3681125d6af (diff) |
clk: divider: Introduce CLK_DIVIDER_ALLOW_ZERO flag
Dividers which have CLK_DIVIDER_ONE_BASED set have a redundant state,
being a divider value of zero. Some hardware implementations allow a
zero divider which simply doesn't alter the frequency. I.e. it acts like
a divide by one or bypassing the divider.
This flag is used to handle such HW in the clk-divider model.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk/clk-divider.c')
-rw-r--r-- | drivers/clk/clk-divider.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c index 68b402101170..6d9674160430 100644 --- a/drivers/clk/clk-divider.c +++ b/drivers/clk/clk-divider.c | |||
@@ -109,8 +109,9 @@ static unsigned long clk_divider_recalc_rate(struct clk_hw *hw, | |||
109 | 109 | ||
110 | div = _get_div(divider, val); | 110 | div = _get_div(divider, val); |
111 | if (!div) { | 111 | if (!div) { |
112 | WARN(1, "%s: Invalid divisor for clock %s\n", __func__, | 112 | WARN(!(divider->flags & CLK_DIVIDER_ALLOW_ZERO), |
113 | __clk_get_name(hw->clk)); | 113 | "%s: Zero divisor and CLK_DIVIDER_ALLOW_ZERO not set\n", |
114 | __clk_get_name(hw->clk)); | ||
114 | return parent_rate; | 115 | return parent_rate; |
115 | } | 116 | } |
116 | 117 | ||