]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
clk: sunxi-ng: Fix round_rate/set_rate multiplier minimum mismatch
authorChen-Yu Tsai <wens@csie.org>
Fri, 24 Mar 2017 08:33:06 +0000 (16:33 +0800)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Thu, 13 Apr 2017 12:09:28 +0000 (14:09 +0200)
In commit 2beaa601c849 ("clk: sunxi-ng: Implement minimum for
multipliers"), the multiplier minimums in the set_rate callback
for NM and NKMP style clocks were not updated.

This patch fixes them to match their round_rate callbacks.

Fixes: 2beaa601c849 ("clk: sunxi-ng: Implement minimum for multipliers")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/clk/sunxi-ng/ccu_nkmp.c
drivers/clk/sunxi-ng/ccu_nm.c

index c9d47dbff912f95f96f28956650bd766dcca6cb1..0f80e5e498bb2631ee792ec884dfc3b3a487942b 100644 (file)
@@ -138,9 +138,9 @@ static int ccu_nkmp_set_rate(struct clk_hw *hw, unsigned long rate,
        unsigned long flags;
        u32 reg;
 
-       _nkmp.min_n = 1;
+       _nkmp.min_n = nkmp->n.min ?: 1;
        _nkmp.max_n = nkmp->n.max ?: 1 << nkmp->n.width;
-       _nkmp.min_k = 1;
+       _nkmp.min_k = nkmp->k.min ?: 1;
        _nkmp.max_k = nkmp->k.max ?: 1 << nkmp->k.width;
        _nkmp.min_m = 1;
        _nkmp.max_m = nkmp->m.max ?: 1 << nkmp->m.width;
index f312c92f2a21d72460c06bf83b7a3c6e44dd4cbf..5e5e90a4a50c8bd80a9ca0ea1fc91ccee9a3428e 100644 (file)
@@ -122,7 +122,7 @@ static int ccu_nm_set_rate(struct clk_hw *hw, unsigned long rate,
        else
                ccu_frac_helper_disable(&nm->common, &nm->frac);
 
-       _nm.min_n = 1;
+       _nm.min_n = nm->n.min ?: 1;
        _nm.max_n = nm->n.max ?: 1 << nm->n.width;
        _nm.min_m = 1;
        _nm.max_m = nm->m.max ?: 1 << nm->m.width;