Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: renesas: rzv2h: Add instance field to struct pll

Add a two-bit "instance" member to struct pll and extend the PLL_PACK()
macro to accept an instance parameter. Initialize all existing PLL
definitions with instance 0 to preserve legacy behavior. This change
enables support for SoCs with multiple PLL instances (for example,
RZ/G3E we have two PLL DSIs).

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20251015192611.241920-2-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

authored by

Lad Prabhakar and committed by
Geert Uytterhoeven
36a23904 3a866087

+7 -4
+7 -4
drivers/clk/renesas/rzv2h-cpg.h
··· 16 16 * 17 17 * @offset: STBY register offset 18 18 * @has_clkn: Flag to indicate if CLK1/2 are accessible or not 19 + * @instance: PLL instance number 19 20 */ 20 21 struct pll { 21 22 unsigned int offset:9; 22 23 unsigned int has_clkn:1; 24 + unsigned int instance:2; 23 25 }; 24 26 25 - #define PLL_PACK(_offset, _has_clkn) \ 27 + #define PLL_PACK(_offset, _has_clkn, _instance) \ 26 28 ((struct pll){ \ 27 29 .offset = _offset, \ 28 - .has_clkn = _has_clkn \ 30 + .has_clkn = _has_clkn, \ 31 + .instance = _instance \ 29 32 }) 30 33 31 - #define PLLCA55 PLL_PACK(0x60, 1) 32 - #define PLLGPU PLL_PACK(0x120, 1) 34 + #define PLLCA55 PLL_PACK(0x60, 1, 0) 35 + #define PLLGPU PLL_PACK(0x120, 1, 0) 33 36 34 37 /** 35 38 * struct ddiv - Structure for dynamic switching divider