Skip to content

Commit aa34d0f

Browse files
Elaine Zhangrkhuangtao
authored andcommitted
clk: rockchip: Modify uart frac divider rule
Because uart does not have high requirements for the clk Jitter, the fractional frequency divider does not need to meet the 20-fold relationship. (If uart clk rate < 24M,Use 24M as the fractional clock source.) Change-Id: I3f55f8a4ba5dc4c950c2742dc914c41e7b6e4ee6 Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
1 parent 49c8309 commit aa34d0f

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

  • drivers/clk/rockchip

drivers/clk/rockchip/clk.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,19 @@ static void rockchip_fractional_approximation(struct clk_hw *hw,
179179
u32 div;
180180

181181
p_rate = clk_hw_get_rate(clk_hw_get_parent(hw));
182+
183+
if (strstr(clk_hw_get_name(hw), "uart")) {
184+
if (rate <= 24000000) {
185+
*parent_rate = 24000000;
186+
} else {
187+
if (fd->max_prate)
188+
*parent_rate = fd->max_prate;
189+
else
190+
*parent_rate = 480000000;
191+
}
192+
goto frac_ration;
193+
}
194+
182195
if (((rate * 20 > p_rate) && (p_rate % rate != 0)) ||
183196
(fd->max_prate && fd->max_prate < p_rate)) {
184197
p_parent = clk_hw_get_parent(clk_hw_get_parent(hw));
@@ -203,6 +216,7 @@ static void rockchip_fractional_approximation(struct clk_hw *hw,
203216
}
204217
}
205218

219+
frac_ration:
206220
/*
207221
* Get rate closer to *parent_rate to guarantee there is no overflow
208222
* for m and n. In the result it will be the nearest rate left shifted

0 commit comments

Comments
 (0)