[PATCH 0/3] clk: renesas: rzg2l: Unify SAM PLL configuration macros

Biju posted 3 patches 1 month, 1 week ago
There is a newer version of this series
drivers/clk/renesas/r9a07g043-cpg.c |  2 +-
drivers/clk/renesas/r9a07g044-cpg.c |  2 +-
drivers/clk/renesas/r9a08g045-cpg.c |  5 +---
drivers/clk/renesas/r9a08g046-cpg.c |  7 ++---
drivers/clk/renesas/r9a09g011-cpg.c |  7 +----
drivers/clk/renesas/rzg2l-cpg.c     | 41 +++++++++++++++--------------
drivers/clk/renesas/rzg2l-cpg.h     |  7 ++---
7 files changed, 29 insertions(+), 42 deletions(-)
[PATCH 0/3] clk: renesas: rzg2l: Unify SAM PLL configuration macros
Posted by Biju 1 month, 1 week ago
From: Biju Das <biju.das.jz@bp.renesas.com>

This series cleans up and unifies the SAM PLL configuration macros across
the RZ/G2L, RZ/G3S, RZ/G3L, and RZ/V2M CPG drivers.

Currently, each SoC family defines its own local macro for encoding PLL
register offsets into a conf field (PLL146_CONF, G3S_PLL146_CONF,
G3L_PLL1467_CONF, PLL4_CONF), and the driver uses separate decode macros
(GET_REG_SAMPLL_CLK1, GET_REG_SAMPLL_CLK2, GET_REG_SAMPLL_SETTING) to
retrieve register offsets at runtime. This leads to duplicated logic and
implicit coupling between PLL index and register layout.

The series introduces a pair of shared macros, CPG_SAM_PLL_CONF(stby) and
CPG_PLL_CONF(stby, setting), that encode only the standby offset and
optional setting field. CLK1/CLK2 register offsets are then derived from
the standby offset using fixed +0x4/+0x8 deltas via new CPG_PLL_*_OFFSET()
helpers, removing the need for separate CLK1/CLK2 fields in the conf value.

Finally, the RZG3L-prefixed STBY/MON macros are renamed to CPG-prefixed
equivalents to reflect their shared nature across SoC families.

This patch series depend upon [1]
[1] https://lore.kernel.org/linux-renesas-soc/cover.1777562043.git.geert+renesas@glider.be/T/#t

Biju Das (3):
  clk: renesas: rzg2l: Simplify SAM PLL configuration macro
  clk: renesas: rzg3s/rzg3l: Simplify PLL configuration macro
  clk: renesas: rzg2l: Rename RZG3L-prefixed PLL macros to CPG-prefixed
    ones

 drivers/clk/renesas/r9a07g043-cpg.c |  2 +-
 drivers/clk/renesas/r9a07g044-cpg.c |  2 +-
 drivers/clk/renesas/r9a08g045-cpg.c |  5 +---
 drivers/clk/renesas/r9a08g046-cpg.c |  7 ++---
 drivers/clk/renesas/r9a09g011-cpg.c |  7 +----
 drivers/clk/renesas/rzg2l-cpg.c     | 41 +++++++++++++++--------------
 drivers/clk/renesas/rzg2l-cpg.h     |  7 ++---
 7 files changed, 29 insertions(+), 42 deletions(-)

-- 
2.43.0