clk: renesas: Use pre-defined offset for RPC clocks
authorHai Pham <hai.pham.ud@renesas.com>
Thu, 26 Jan 2023 20:02:04 +0000 (21:02 +0100)
committerMarek Vasut <marek.vasut+renesas@gmail.com>
Thu, 2 Feb 2023 00:49:20 +0000 (01:49 +0100)
Since commit f7b4e4c0949f ("clk: renesas: Synchronize R-Car Gen3 tables
with Linux 5.12"), the custom macros for RPC clocks were dropped.

Use pre-defined offset for RPC clocks, same as what Linux does, instead
of retrieving it from the macros

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
drivers/clk/renesas/clk-rcar-gen3.c
drivers/clk/renesas/rcar-gen3-cpg.h

index 3611bdb..8125804 100644 (file)
@@ -324,7 +324,7 @@ static u64 gen3_clk_get_rate64(struct clk *clk)
        case CLK_TYPE_GEN4_RPCD2:
                rate = gen3_clk_get_rate64(&parent);
 
-               value = readl(priv->base + core->offset);
+               value = readl(priv->base + CPG_RPCCKCR);
 
                prediv = (value >> CPG_RPC_PREDIV_OFFSET) &
                         CPG_RPC_PREDIV_MASK;
index a7074e2..007610b 100644 (file)
@@ -53,9 +53,6 @@ enum rcar_gen3_clk_types {
 #define DEF_GEN3_SD(_name, _id, _parent, _offset)      \
        DEF_BASE(_name, _id, CLK_TYPE_GEN3_SD, _parent, .offset = _offset)
 
-#define DEF_GEN3_RPCD2(_name, _id, _parent, _offset)   \
-       DEF_BASE(_name, _id, CLK_TYPE_GEN3_RPCD2, _parent, .offset = _offset)
-
 #define DEF_GEN3_MDSEL(_name, _id, _md, _parent0, _div0, _parent1, _div1) \
        DEF_BASE(_name, _id, CLK_TYPE_GEN3_MDSEL,       \
                 (_parent0) << 16 | (_parent1),         \