diff options
author | Frank Oltmanns <frank@oltmanns.dev> | 2023-08-07 14:43:44 +0200 |
---|---|---|
committer | Chen-Yu Tsai <wens@csie.org> | 2023-08-09 17:41:44 +0200 |
commit | a69f9463397e56666b113eebb2e99956aacf6929 (patch) | |
tree | c367fd0b1072625e522bfaa6f0a1abac40776e6a /drivers/clk/sunxi-ng/ccu_nkm.c | |
parent | clk: sunxi-ng: a64: select closest rate for pll-video0 (diff) | |
download | linux-a69f9463397e56666b113eebb2e99956aacf6929.tar.xz linux-a69f9463397e56666b113eebb2e99956aacf6929.zip |
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>
Diffstat (limited to 'drivers/clk/sunxi-ng/ccu_nkm.c')
-rw-r--r-- | drivers/clk/sunxi-ng/ccu_nkm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/clk/sunxi-ng/ccu_nkm.c b/drivers/clk/sunxi-ng/ccu_nkm.c index a714dcf0dfc1..eed64547ad42 100644 --- a/drivers/clk/sunxi-ng/ccu_nkm.c +++ b/drivers/clk/sunxi-ng/ccu_nkm.c @@ -34,7 +34,8 @@ static unsigned long ccu_nkm_find_best_with_parent_adj(struct ccu_common *common tmp_rate = tmp_parent * _n * _k / _m; - if (ccu_is_better_rate(common, rate, tmp_rate, best_rate)) { + if (ccu_is_better_rate(common, rate, tmp_rate, best_rate) || + (tmp_parent == *parent && tmp_rate == best_rate)) { best_rate = tmp_rate; best_parent_rate = tmp_parent; best_n = _n; |