Skip to content

Commit 268db07

Browse files
pcercueiamalon
authored andcommitted
clk: ingenic: support PLLs with no bypass bit
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>
1 parent e6cfa64 commit 268db07

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

drivers/clk/ingenic/cgu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ ingenic_pll_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
100100
n += pll_info->n_offset;
101101
od_enc = ctl >> pll_info->od_shift;
102102
od_enc &= GENMASK(pll_info->od_bits - 1, 0);
103-
bypass = !!(ctl & BIT(pll_info->bypass_bit));
103+
bypass = !pll_info->no_bypass_bit &&
104+
!!(ctl & BIT(pll_info->bypass_bit));
104105
enable = !!(ctl & BIT(pll_info->enable_bit));
105106

106107
if (bypass)

drivers/clk/ingenic/cgu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
* @bypass_bit: the index of the bypass bit in the PLL control register
4949
* @enable_bit: the index of the enable bit in the PLL control register
5050
* @stable_bit: the index of the stable bit in the PLL control register
51+
* @no_bypass_bit: if set, the PLL has no bypass functionality
5152
*/
5253
struct ingenic_cgu_pll_info {
5354
unsigned reg;
@@ -58,6 +59,7 @@ struct ingenic_cgu_pll_info {
5859
u8 bypass_bit;
5960
u8 enable_bit;
6061
u8 stable_bit;
62+
bool no_bypass_bit;
6163
};
6264

6365
/**

0 commit comments

Comments
 (0)