diff options
author | Jernej Škrabec <jernej.skrabec@siol.net> | 2017-07-30 18:41:50 +0200 |
---|---|---|
committer | Chen-Yu Tsai <wens@csie.org> | 2017-08-01 10:18:23 +0800 |
commit | 1d42460a49347af4d1db345197e5d1277336b312 (patch) | |
tree | 498fbed490863e0f21f0fea82658cca448ce45bf /drivers/clk/sunxi-ng/ccu_mult.c | |
parent | b655f36e2071a9a380477e2f07893c31cbf88f59 (diff) |
clk: sunxi-ng: Wait for lock when using fractional mode
Currently ccu_frac_helper_set_rate() doesn't wait for a lock bit to be
set before returning. Because of that, unstable clock may be used.
Add a wait for lock in the helper function.
Fixes: 89a3dfb78707 ("clk: sunxi-ng: Add fractional lib")
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Diffstat (limited to 'drivers/clk/sunxi-ng/ccu_mult.c')
-rw-r--r-- | drivers/clk/sunxi-ng/ccu_mult.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/clk/sunxi-ng/ccu_mult.c b/drivers/clk/sunxi-ng/ccu_mult.c index ee5e96222cb2..12e0783caee6 100644 --- a/drivers/clk/sunxi-ng/ccu_mult.c +++ b/drivers/clk/sunxi-ng/ccu_mult.c @@ -114,7 +114,8 @@ static int ccu_mult_set_rate(struct clk_hw *hw, unsigned long rate, if (ccu_frac_helper_has_rate(&cm->common, &cm->frac, rate)) { ccu_frac_helper_enable(&cm->common, &cm->frac); - return ccu_frac_helper_set_rate(&cm->common, &cm->frac, rate); + return ccu_frac_helper_set_rate(&cm->common, &cm->frac, + rate, cm->lock); } else { ccu_frac_helper_disable(&cm->common, &cm->frac); } |