]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
clk: mmp2: Move number of clocks to driver source
authorDuje Mihanović <duje.mihanovic@skole.hr>
Sat, 12 Aug 2023 10:02:56 +0000 (12:02 +0200)
committerStephen Boyd <sboyd@kernel.org>
Tue, 22 Aug 2023 21:13:45 +0000 (14:13 -0700)
The number of clocks should not be in the dt binding as it is not used
by the respective device tree and thus needlessly bloats the ABI.

Move this number of clocks into the driver source.

Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>
Link: https://lore.kernel.org/r/20230812-mmp-nr-clks-v2-1-f9271bd7eaa5@skole.hr
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/mmp/clk-audio.c
drivers/clk/mmp/clk-of-mmp2.c
include/dt-bindings/clock/marvell,mmp2-audio.h
include/dt-bindings/clock/marvell,mmp2.h

index 6fb1aa9487b59c6bed4ff9ad8da8deb2eb298fba..ae521aaf8cdcf4039c77e3568f1e287ea4bd6b9f 100644 (file)
@@ -55,6 +55,8 @@
 #define SSPA_AUD_PLL_CTRL1_DIV_OCLK_PATTERN_MASK (0x7ff << 0)
 #define SSPA_AUD_PLL_CTRL1_DIV_OCLK_PATTERN(x) ((x) << 0)
 
+#define CLK_AUDIO_NR_CLKS                      3
+
 struct mmp2_audio_clk {
        void __iomem *mmio_base;
 
@@ -336,7 +338,7 @@ static int register_clocks(struct mmp2_audio_clk *priv, struct device *dev)
        priv->clk_data.hws[MMP2_CLK_AUDIO_SYSCLK] = &priv->sysclk_gate.hw;
        priv->clk_data.hws[MMP2_CLK_AUDIO_SSPA0] = &priv->sspa0_gate.hw;
        priv->clk_data.hws[MMP2_CLK_AUDIO_SSPA1] = &priv->sspa1_gate.hw;
-       priv->clk_data.num = MMP2_CLK_AUDIO_NR_CLKS;
+       priv->clk_data.num = CLK_AUDIO_NR_CLKS;
 
        return of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
                                      &priv->clk_data);
@@ -349,7 +351,7 @@ static int mmp2_audio_clk_probe(struct platform_device *pdev)
 
        priv = devm_kzalloc(&pdev->dev,
                            struct_size(priv, clk_data.hws,
-                                       MMP2_CLK_AUDIO_NR_CLKS),
+                                       CLK_AUDIO_NR_CLKS),
                            GFP_KERNEL);
        if (!priv)
                return -ENOMEM;
index bcf60f43aa133aac609756784ec80ae3361017b4..eaad36ee323d14ff3d0f61c917d57d1501359db1 100644 (file)
@@ -78,6 +78,8 @@
 #define MPMU_PLL_DIFF_CTRL     0x68
 #define MPMU_PLL2_CTRL1                0x414
 
+#define NR_CLKS                200
+
 enum mmp2_clk_model {
        CLK_MODEL_MMP2,
        CLK_MODEL_MMP3,
@@ -543,7 +545,7 @@ static void __init mmp2_clk_init(struct device_node *np)
 
        mmp2_pm_domain_init(np, pxa_unit);
 
-       mmp_clk_init(np, &pxa_unit->unit, MMP2_NR_CLKS);
+       mmp_clk_init(np, &pxa_unit->unit, NR_CLKS);
 
        mmp2_main_clk_init(pxa_unit);
 
index 20664776f49731f36ef87ab95248ca6f480783b1..9653e04dedc37123c7a9ac5b4013ee7ac3e2650f 100644 (file)
@@ -6,5 +6,4 @@
 #define MMP2_CLK_AUDIO_SSPA0           1
 #define MMP2_CLK_AUDIO_SSPA1           2
 
-#define MMP2_CLK_AUDIO_NR_CLKS         3
 #endif
index f0819d66b2306608e5c732b9ef2b64a22fb4a2ac..88c2d716476f4915a32e3ad652716c4c8a037874 100644 (file)
@@ -91,5 +91,4 @@
 #define MMP3_CLK_SDH4                  126
 #define MMP2_CLK_AUDIO                 127
 
-#define MMP2_NR_CLKS                   200
 #endif