]> git.baikalelectronics.ru Git - kernel.git/commitdiff
clk: ingenic: support PLLs with no bypass bit
authorPaul Cercueil <paul@crapouillou.net>
Tue, 16 Jan 2018 15:47:53 +0000 (16:47 +0100)
committerJames Hogan <jhogan@kernel.org>
Thu, 18 Jan 2018 22:05:13 +0000 (22:05 +0000)
The second PLL of the JZ4770 does not have a bypass bit.
This commit makes it possible to support it with the current common CGU
code.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Maarten ter Huurne <maarten@treewalker.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/18479/
Signed-off-by: James Hogan <jhogan@kernel.org>
drivers/clk/ingenic/cgu.c
drivers/clk/ingenic/cgu.h

index a2e73a6d60fddc232fe3d4974707eacad6983835..381c4a17a1fcf6d4aaa66d29b8769a55ca87a419 100644 (file)
@@ -100,7 +100,8 @@ ingenic_pll_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
        n += pll_info->n_offset;
        od_enc = ctl >> pll_info->od_shift;
        od_enc &= GENMASK(pll_info->od_bits - 1, 0);
-       bypass = !!(ctl & BIT(pll_info->bypass_bit));
+       bypass = !pll_info->no_bypass_bit &&
+                !!(ctl & BIT(pll_info->bypass_bit));
        enable = !!(ctl & BIT(pll_info->enable_bit));
 
        if (bypass)
index f1527cf75b3f1e2a62292ee4d2a325664fd35872..9da34910bd800f8d11954a6c58ef5a7e4256c06a 100644 (file)
@@ -48,6 +48,7 @@
  * @bypass_bit: the index of the bypass bit in the PLL control register
  * @enable_bit: the index of the enable bit in the PLL control register
  * @stable_bit: the index of the stable bit in the PLL control register
+ * @no_bypass_bit: if set, the PLL has no bypass functionality
  */
 struct ingenic_cgu_pll_info {
        unsigned reg;
@@ -58,6 +59,7 @@ struct ingenic_cgu_pll_info {
        u8 bypass_bit;
        u8 enable_bit;
        u8 stable_bit;
+       bool no_bypass_bit;
 };
 
 /**