]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge tag 'sunxi-clk-for-4.12-2' of https://git.kernel.org/pub/scm/linux/kernel/git...
authorStephen Boyd <sboyd@codeaurora.org>
Sat, 22 Apr 2017 02:19:46 +0000 (19:19 -0700)
committerStephen Boyd <sboyd@codeaurora.org>
Sat, 22 Apr 2017 02:19:46 +0000 (19:19 -0700)
Pull Allwinner clock changes, take 2 from Maxime Ripard:

A few minor bug and comment fixes, plus some fixes for the PRCM CCU driver
merged in the prior pull request

* tag 'sunxi-clk-for-4.12-2' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  clk: sunxi-ng: a80: Fix audio PLL comment not matching actual code
  clk: sunxi-ng: Fix round_rate/set_rate multiplier minimum mismatch
  clk: sunxi-ng: use 1 as fallback for minimum multiplier
  clk: sunxi-ng: fix PRCM CCU CLK_NUMBER value
  clk: sunxi-ng: fix PRCM CCU ir clk parent

1  2 
drivers/clk/sunxi-ng/ccu_nkmp.c

index 488055ed944f2b9dff8ca1baa5059ea22879328b,0f80e5e498bb2631ee792ec884dfc3b3a487942b..e58c95787f94c7c6cb7c1ca96330d4680940bc74
@@@ -107,7 -107,7 +107,7 @@@ static unsigned long ccu_nkmp_recalc_ra
        p = reg >> nkmp->p.shift;
        p &= (1 << nkmp->p.width) - 1;
  
 -      return parent_rate * n * k >> p / m;
 +      return (parent_rate * n * k >> p) / m;
  }
  
  static long ccu_nkmp_round_rate(struct clk_hw *hw, unsigned long rate,
        struct ccu_nkmp *nkmp = hw_to_ccu_nkmp(hw);
        struct _ccu_nkmp _nkmp;
  
-       _nkmp.min_n = nkmp->n.min;
+       _nkmp.min_n = nkmp->n.min ?: 1;
        _nkmp.max_n = nkmp->n.max ?: 1 << nkmp->n.width;
-       _nkmp.min_k = nkmp->k.min;
+       _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;
@@@ -138,9 -138,9 +138,9 @@@ static int ccu_nkmp_set_rate(struct clk
        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;