Skip to content

Commit a69f946

Browse files
Frank Oltmannswens
authored andcommitted
clk: sunxi-ng: nkm: Prefer current parent rate
Similar to ccu_mp, if the current parent rate allows getting the ideal rate, prefer to not change the parent clock's rate. Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Frank Oltmanns <frank@oltmanns.dev> Link: https://lore.kernel.org/r/20230807-pll-mipi_set_rate_parent-v6-11-f173239a4b59@oltmanns.dev Signed-off-by: Chen-Yu Tsai <wens@csie.org>
1 parent bf8eb12 commit a69f946

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/clk/sunxi-ng/ccu_nkm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ static unsigned long ccu_nkm_find_best_with_parent_adj(struct ccu_common *common
3434

3535
tmp_rate = tmp_parent * _n * _k / _m;
3636

37-
if (ccu_is_better_rate(common, rate, tmp_rate, best_rate)) {
37+
if (ccu_is_better_rate(common, rate, tmp_rate, best_rate) ||
38+
(tmp_parent == *parent && tmp_rate == best_rate)) {
3839
best_rate = tmp_rate;
3940
best_parent_rate = tmp_parent;
4041
best_n = _n;

0 commit comments

Comments
 (0)