mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
clk: frac-divider: fix up some frac clk freq setting error
ie: clk_i2s set rate 11289600(get rate = 11289600) clk_i2s set rate 8192000(get rate = 8192000) clk_i2s set rate 11289600(get rate = 11214954) Change-Id: I042d2acdd22b56b5d8571921f63702aabffcacdd Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
This commit is contained in:
@@ -77,13 +77,16 @@ static long clk_fd_round_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long m, n;
|
||||
u64 ret;
|
||||
|
||||
if (!rate || rate >= *parent_rate)
|
||||
if (!rate)
|
||||
return *parent_rate;
|
||||
|
||||
if (fd->approximation)
|
||||
if (fd->approximation) {
|
||||
fd->approximation(hw, rate, parent_rate, &m, &n);
|
||||
else
|
||||
} else {
|
||||
if (rate >= *parent_rate)
|
||||
return *parent_rate;
|
||||
clk_fd_general_approximation(hw, rate, parent_rate, &m, &n);
|
||||
}
|
||||
|
||||
ret = (u64)*parent_rate * m;
|
||||
do_div(ret, n);
|
||||
|
||||
Reference in New Issue
Block a user