Skip to content

Commit 037f1ff

Browse files
pcercueibebarino
authored andcommitted
clk: ingenic: Remove pll_info.no_bypass_bit
We can express that a PLL has no bypass bit by simply setting the .bypass_bit field to a negative value. Signed-off-by: Paul Cercueil <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-by: 周琰杰 (Zhou Yanjie)<[email protected]> # on CU1830-neo/X1830 Signed-off-by: Stephen Boyd <[email protected]>
1 parent 315a842 commit 037f1ff

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

drivers/clk/ingenic/cgu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ ingenic_pll_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
9999
od_enc = ctl >> pll_info->od_shift;
100100
od_enc &= GENMASK(pll_info->od_bits - 1, 0);
101101

102-
if (!pll_info->no_bypass_bit) {
102+
if (pll_info->bypass_bit >= 0) {
103103
ctl = readl(cgu->base + pll_info->bypass_reg);
104104

105105
bypass = !!(ctl & BIT(pll_info->bypass_bit));
@@ -226,7 +226,7 @@ static int ingenic_pll_enable(struct clk_hw *hw)
226226
u32 ctl;
227227

228228
spin_lock_irqsave(&cgu->lock, flags);
229-
if (!pll_info->no_bypass_bit) {
229+
if (pll_info->bypass_bit >= 0) {
230230
ctl = readl(cgu->base + pll_info->bypass_reg);
231231

232232
ctl &= ~BIT(pll_info->bypass_bit);

drivers/clk/ingenic/cgu.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939
* their encoded values in the PLL control register, or -1 for
4040
* unsupported values
4141
* @bypass_reg: the offset of the bypass control register within the CGU
42-
* @bypass_bit: the index of the bypass bit in the PLL control register
42+
* @bypass_bit: the index of the bypass bit in the PLL control register, or
43+
* -1 if there is no bypass bit
4344
* @enable_bit: the index of the enable bit in the PLL control register
4445
* @stable_bit: the index of the stable bit in the PLL control register
45-
* @no_bypass_bit: if set, the PLL has no bypass functionality
4646
*/
4747
struct ingenic_cgu_pll_info {
4848
unsigned reg;
@@ -52,10 +52,9 @@ struct ingenic_cgu_pll_info {
5252
u8 n_shift, n_bits, n_offset;
5353
u8 od_shift, od_bits, od_max;
5454
unsigned bypass_reg;
55-
u8 bypass_bit;
55+
s8 bypass_bit;
5656
u8 enable_bit;
5757
u8 stable_bit;
58-
bool no_bypass_bit;
5958
};
6059

6160
/**

drivers/clk/ingenic/jz4770-cgu.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ static const struct ingenic_cgu_clk_info jz4770_cgu_clocks[] = {
139139
.od_bits = 2,
140140
.od_max = 8,
141141
.od_encoding = pll_od_encoding,
142-
.bypass_reg = CGU_REG_CPPCR1,
143-
.no_bypass_bit = true,
142+
.bypass_bit = -1,
144143
.enable_bit = 7,
145144
.stable_bit = 6,
146145
},

0 commit comments

Comments
 (0)