Skip to content

Commit 360387a

Browse files
prabhakarladgeertu
authored andcommitted
clk: renesas: rzv2h: Rename PLL field macros for consistency
Rename PLL field extraction macros to include the associated register name (`CPG_PLL_CLK1` or `CPG_PLL_CLK2`) to maintain consistency with other PLL register macros. Update all corresponding macro references accordingly. Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent fea942b commit 360387a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/clk/renesas/rzv2h-cpg.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@
4848
#define CPG_PLL_STBY_RESETB BIT(0)
4949
#define CPG_PLL_STBY_RESETB_WEN BIT(16)
5050
#define CPG_PLL_CLK1(x) ((x) + 0x004)
51-
#define KDIV(val) ((s16)FIELD_GET(GENMASK(31, 16), (val)))
52-
#define MDIV(val) FIELD_GET(GENMASK(15, 6), (val))
53-
#define PDIV(val) FIELD_GET(GENMASK(5, 0), (val))
51+
#define CPG_PLL_CLK1_KDIV(x) ((s16)FIELD_GET(GENMASK(31, 16), (x)))
52+
#define CPG_PLL_CLK1_MDIV(x) FIELD_GET(GENMASK(15, 6), (x))
53+
#define CPG_PLL_CLK1_PDIV(x) FIELD_GET(GENMASK(5, 0), (x))
5454
#define CPG_PLL_CLK2(x) ((x) + 0x008)
55-
#define SDIV(val) FIELD_GET(GENMASK(2, 0), (val))
55+
#define CPG_PLL_CLK2_SDIV(x) FIELD_GET(GENMASK(2, 0), (x))
5656
#define CPG_PLL_MON(x) ((x) + 0x010)
5757
#define CPG_PLL_MON_RESETB BIT(0)
5858
#define CPG_PLL_MON_LOCK BIT(4)
@@ -210,10 +210,10 @@ static unsigned long rzv2h_cpg_pll_clk_recalc_rate(struct clk_hw *hw,
210210
clk1 = readl(priv->base + CPG_PLL_CLK1(pll.offset));
211211
clk2 = readl(priv->base + CPG_PLL_CLK2(pll.offset));
212212

213-
rate = mul_u64_u32_shr(parent_rate, (MDIV(clk1) << 16) + KDIV(clk1),
214-
16 + SDIV(clk2));
213+
rate = mul_u64_u32_shr(parent_rate, (CPG_PLL_CLK1_MDIV(clk1) << 16) +
214+
CPG_PLL_CLK1_KDIV(clk1), 16 + CPG_PLL_CLK2_SDIV(clk2));
215215

216-
return DIV_ROUND_CLOSEST_ULL(rate, PDIV(clk1));
216+
return DIV_ROUND_CLOSEST_ULL(rate, CPG_PLL_CLK1_PDIV(clk1));
217217
}
218218

219219
static const struct clk_ops rzv2h_cpg_pll_ops = {

0 commit comments

Comments
 (0)