* [PATCH v2 1/4] clk: mmp2: Move number of clocks to driver source
2023-08-12 10:02 [PATCH v2 0/4] clk: marvell: Move number of clocks to driver source Duje Mihanović
@ 2023-08-12 10:02 ` Duje Mihanović
2023-08-22 21:14 ` Stephen Boyd
2023-08-12 10:02 ` [PATCH v2 2/4] clk: pxa168: " Duje Mihanović
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Duje Mihanović @ 2023-08-12 10:02 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-clk, linux-kernel, devicetree, Duje Mihanović
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>
---
drivers/clk/mmp/clk-audio.c | 6 ++++--
drivers/clk/mmp/clk-of-mmp2.c | 4 +++-
include/dt-bindings/clock/marvell,mmp2-audio.h | 1 -
include/dt-bindings/clock/marvell,mmp2.h | 1 -
4 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/mmp/clk-audio.c b/drivers/clk/mmp/clk-audio.c
index 6fb1aa9487b5..ae521aaf8cdc 100644
--- a/drivers/clk/mmp/clk-audio.c
+++ b/drivers/clk/mmp/clk-audio.c
@@ -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;
diff --git a/drivers/clk/mmp/clk-of-mmp2.c b/drivers/clk/mmp/clk-of-mmp2.c
index bcf60f43aa13..eaad36ee323d 100644
--- a/drivers/clk/mmp/clk-of-mmp2.c
+++ b/drivers/clk/mmp/clk-of-mmp2.c
@@ -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);
diff --git a/include/dt-bindings/clock/marvell,mmp2-audio.h b/include/dt-bindings/clock/marvell,mmp2-audio.h
index 20664776f497..9653e04dedc3 100644
--- a/include/dt-bindings/clock/marvell,mmp2-audio.h
+++ b/include/dt-bindings/clock/marvell,mmp2-audio.h
@@ -6,5 +6,4 @@
#define MMP2_CLK_AUDIO_SSPA0 1
#define MMP2_CLK_AUDIO_SSPA1 2
-#define MMP2_CLK_AUDIO_NR_CLKS 3
#endif
diff --git a/include/dt-bindings/clock/marvell,mmp2.h b/include/dt-bindings/clock/marvell,mmp2.h
index f0819d66b230..88c2d716476f 100644
--- a/include/dt-bindings/clock/marvell,mmp2.h
+++ b/include/dt-bindings/clock/marvell,mmp2.h
@@ -91,5 +91,4 @@
#define MMP3_CLK_SDH4 126
#define MMP2_CLK_AUDIO 127
-#define MMP2_NR_CLKS 200
#endif
--
2.41.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH v2 2/4] clk: pxa168: Move number of clocks to driver source
2023-08-12 10:02 [PATCH v2 0/4] clk: marvell: Move number of clocks to driver source Duje Mihanović
2023-08-12 10:02 ` [PATCH v2 1/4] clk: mmp2: " Duje Mihanović
@ 2023-08-12 10:02 ` Duje Mihanović
2023-08-22 21:14 ` Stephen Boyd
2023-08-12 10:02 ` [PATCH v2 3/4] clk: pxa1928: " Duje Mihanović
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Duje Mihanović @ 2023-08-12 10:02 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-clk, linux-kernel, devicetree, Duje Mihanović
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>
---
drivers/clk/mmp/clk-of-pxa168.c | 4 +++-
include/dt-bindings/clock/marvell,pxa168.h | 1 -
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/mmp/clk-of-pxa168.c b/drivers/clk/mmp/clk-of-pxa168.c
index 130d1a723879..fb0df64cf053 100644
--- a/drivers/clk/mmp/clk-of-pxa168.c
+++ b/drivers/clk/mmp/clk-of-pxa168.c
@@ -62,6 +62,8 @@
#define APMU_EPD 0x104
#define MPMU_UART_PLL 0x14
+#define NR_CLKS 200
+
struct pxa168_clk_unit {
struct mmp_clk_unit unit;
void __iomem *mpmu_base;
@@ -321,7 +323,7 @@ static void __init pxa168_clk_init(struct device_node *np)
return;
}
- mmp_clk_init(np, &pxa_unit->unit, PXA168_NR_CLKS);
+ mmp_clk_init(np, &pxa_unit->unit, NR_CLKS);
pxa168_pll_init(pxa_unit);
diff --git a/include/dt-bindings/clock/marvell,pxa168.h b/include/dt-bindings/clock/marvell,pxa168.h
index c92d969ae941..d1bb59187e1d 100644
--- a/include/dt-bindings/clock/marvell,pxa168.h
+++ b/include/dt-bindings/clock/marvell,pxa168.h
@@ -63,5 +63,4 @@
#define PXA168_CLK_SDH01_AXI 111
#define PXA168_CLK_SDH23_AXI 112
-#define PXA168_NR_CLKS 200
#endif
--
2.41.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH v2 3/4] clk: pxa1928: Move number of clocks to driver source
2023-08-12 10:02 [PATCH v2 0/4] clk: marvell: Move number of clocks to driver source Duje Mihanović
2023-08-12 10:02 ` [PATCH v2 1/4] clk: mmp2: " Duje Mihanović
2023-08-12 10:02 ` [PATCH v2 2/4] clk: pxa168: " Duje Mihanović
@ 2023-08-12 10:02 ` Duje Mihanović
2023-08-22 21:15 ` Stephen Boyd
2023-08-12 10:02 ` [PATCH v2 4/4] clk: pxa910: " Duje Mihanović
2023-08-13 9:45 ` [PATCH v2 0/4] clk: marvell: " Conor Dooley
4 siblings, 1 reply; 10+ messages in thread
From: Duje Mihanović @ 2023-08-12 10:02 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-clk, linux-kernel, devicetree, Duje Mihanović
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>
---
drivers/clk/mmp/clk-of-pxa1928.c | 7 +++++--
include/dt-bindings/clock/marvell,pxa1928.h | 3 ---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/mmp/clk-of-pxa1928.c b/drivers/clk/mmp/clk-of-pxa1928.c
index 2508a0d795f8..9def4b5f10e9 100644
--- a/drivers/clk/mmp/clk-of-pxa1928.c
+++ b/drivers/clk/mmp/clk-of-pxa1928.c
@@ -22,6 +22,9 @@
#define MPMU_UART_PLL 0x14
+#define APBC_NR_CLKS 48
+#define APMU_NR_CLKS 96
+
struct pxa1928_clk_unit {
struct mmp_clk_unit unit;
void __iomem *mpmu_base;
@@ -235,7 +238,7 @@ static void __init pxa1928_apmu_clk_init(struct device_node *np)
return;
}
- mmp_clk_init(np, &pxa_unit->unit, PXA1928_APMU_NR_CLKS);
+ mmp_clk_init(np, &pxa_unit->unit, APMU_NR_CLKS);
pxa1928_axi_periph_clk_init(pxa_unit);
}
@@ -256,7 +259,7 @@ static void __init pxa1928_apbc_clk_init(struct device_node *np)
return;
}
- mmp_clk_init(np, &pxa_unit->unit, PXA1928_APBC_NR_CLKS);
+ mmp_clk_init(np, &pxa_unit->unit, APBC_NR_CLKS);
pxa1928_apb_periph_clk_init(pxa_unit);
pxa1928_clk_reset_init(np, pxa_unit);
diff --git a/include/dt-bindings/clock/marvell,pxa1928.h b/include/dt-bindings/clock/marvell,pxa1928.h
index 5dca4820297f..0c708d3d3314 100644
--- a/include/dt-bindings/clock/marvell,pxa1928.h
+++ b/include/dt-bindings/clock/marvell,pxa1928.h
@@ -36,7 +36,6 @@
#define PXA1928_CLK_THSENS_CPU 0x26
#define PXA1928_CLK_THSENS_VPU 0x27
#define PXA1928_CLK_THSENS_GC 0x28
-#define PXA1928_APBC_NR_CLKS 0x30
/* axi peripherals */
@@ -53,6 +52,4 @@
#define PXA1928_CLK_GC3D 0x5d
#define PXA1928_CLK_GC2D 0x5f
-#define PXA1928_APMU_NR_CLKS 0x60
-
#endif
--
2.41.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH v2 4/4] clk: pxa910: Move number of clocks to driver source
2023-08-12 10:02 [PATCH v2 0/4] clk: marvell: Move number of clocks to driver source Duje Mihanović
` (2 preceding siblings ...)
2023-08-12 10:02 ` [PATCH v2 3/4] clk: pxa1928: " Duje Mihanović
@ 2023-08-12 10:02 ` Duje Mihanović
2023-08-22 21:15 ` Stephen Boyd
2023-08-13 9:45 ` [PATCH v2 0/4] clk: marvell: " Conor Dooley
4 siblings, 1 reply; 10+ messages in thread
From: Duje Mihanović @ 2023-08-12 10:02 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-clk, linux-kernel, devicetree, Duje Mihanović
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>
---
drivers/clk/mmp/clk-of-pxa910.c | 4 +++-
include/dt-bindings/clock/marvell,pxa910.h | 1 -
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/mmp/clk-of-pxa910.c b/drivers/clk/mmp/clk-of-pxa910.c
index 4d15bac987eb..7a38c424782e 100644
--- a/drivers/clk/mmp/clk-of-pxa910.c
+++ b/drivers/clk/mmp/clk-of-pxa910.c
@@ -44,6 +44,8 @@
#define APMU_DFC 0x60
#define MPMU_UART_PLL 0x14
+#define NR_CLKS 200
+
struct pxa910_clk_unit {
struct mmp_clk_unit unit;
void __iomem *mpmu_base;
@@ -296,7 +298,7 @@ static void __init pxa910_clk_init(struct device_node *np)
goto unmap_apbc_region;
}
- mmp_clk_init(np, &pxa_unit->unit, PXA910_NR_CLKS);
+ mmp_clk_init(np, &pxa_unit->unit, NR_CLKS);
pxa910_pll_init(pxa_unit);
diff --git a/include/dt-bindings/clock/marvell,pxa910.h b/include/dt-bindings/clock/marvell,pxa910.h
index c9018ab354d0..6caa231de0c1 100644
--- a/include/dt-bindings/clock/marvell,pxa910.h
+++ b/include/dt-bindings/clock/marvell,pxa910.h
@@ -55,5 +55,4 @@
#define PXA910_CLK_CCIC0_PHY 108
#define PXA910_CLK_CCIC0_SPHY 109
-#define PXA910_NR_CLKS 200
#endif
--
2.41.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH v2 0/4] clk: marvell: Move number of clocks to driver source
2023-08-12 10:02 [PATCH v2 0/4] clk: marvell: Move number of clocks to driver source Duje Mihanović
` (3 preceding siblings ...)
2023-08-12 10:02 ` [PATCH v2 4/4] clk: pxa910: " Duje Mihanović
@ 2023-08-13 9:45 ` Conor Dooley
4 siblings, 0 replies; 10+ messages in thread
From: Conor Dooley @ 2023-08-13 9:45 UTC (permalink / raw)
To: Duje Mihanović
Cc: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-clk, linux-kernel, devicetree
[-- Attachment #1: Type: text/plain, Size: 1924 bytes --]
On Sat, Aug 12, 2023 at 12:02:55PM +0200, Duje Mihanović wrote:
> Hi,
>
> In v4 of my PXA1908 series, Conor suggested that the NR_CLKS variables
> in dt bindings should be moved to the respective driver source files
> because these are not used by the device trees and so are needlessly
> added to the ABI. This series does that for the rest of the Marvell
> PXA/MMP SoCs.
>
> Link: https://lore.kernel.org/r/20230808-produce-thievish-3ce1b86a114b@spud/
> Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Thanks,
conor.
> ---
> Changes in v2:
> - Fix clk-audio.c compile error
> - Reword mmp2 commit to match other commits
> - Link to v1: https://lore.kernel.org/r/20230809-mmp-nr-clks-v1-0-5f3cdbbb89b8@skole.hr
>
> ---
> Duje Mihanović (4):
> clk: mmp2: Move number of clocks to driver source
> clk: pxa168: Move number of clocks to driver source
> clk: pxa1928: Move number of clocks to driver source
> clk: pxa910: Move number of clocks to driver source
>
> drivers/clk/mmp/clk-audio.c | 6 ++++--
> drivers/clk/mmp/clk-of-mmp2.c | 4 +++-
> drivers/clk/mmp/clk-of-pxa168.c | 4 +++-
> drivers/clk/mmp/clk-of-pxa1928.c | 7 +++++--
> drivers/clk/mmp/clk-of-pxa910.c | 4 +++-
> include/dt-bindings/clock/marvell,mmp2-audio.h | 1 -
> include/dt-bindings/clock/marvell,mmp2.h | 1 -
> include/dt-bindings/clock/marvell,pxa168.h | 1 -
> include/dt-bindings/clock/marvell,pxa1928.h | 3 ---
> include/dt-bindings/clock/marvell,pxa910.h | 1 -
> 10 files changed, 18 insertions(+), 14 deletions(-)
> ---
> base-commit: 52a93d39b17dc7eb98b6aa3edb93943248e03b2f
> change-id: 20230809-mmp-nr-clks-7c80e416e6bf
>
> Best regards,
> --
> Duje Mihanović <duje.mihanovic@skole.hr>
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread