Skip to content

Commit e5546e9

Browse files
committed
Merge tag 'samsung-clk-6.6' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into clk-samsung
Pull Samsung SoC clock drivers changes from Krzysztof Kozlowski: Remove from the bindings the #defines with number of clocks supported by each clock controller driver. This number can vary, e.g. when we implement more clocks in the driver. Having the number in the bindings prevents changing it. Instead, this should be just a #define inside the driver. * tag 'samsung-clk-6.6' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: dt-bindings: clock: samsung: remove define with number of clocks clk: samsung: exynoautov9: do not define number of clocks in bindings clk: samsung: exynos850: do not define number of clocks in bindings clk: samsung: exynos7885: do not define number of clocks in bindings clk: samsung: exynos5433: do not define number of clocks in bindings clk: samsung: exynos5420: do not define number of clocks in bindings clk: samsung: exynos5410: do not define number of clocks in bindings clk: samsung: exynos5260: do not define number of clocks in bindings clk: samsung: exynos5250: do not define number of clocks in bindings clk: samsung: exynos4: do not define number of clocks in bindings clk: samsung: exynos3250: do not define number of clocks in bindings
2 parents 06c2afb + b3f9581 commit e5546e9

21 files changed

+154
-196
lines changed

drivers/clk/samsung/clk-exynos3250.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@
100100
#define PWR_CTRL1_USE_CORE1_WFI (1 << 1)
101101
#define PWR_CTRL1_USE_CORE0_WFI (1 << 0)
102102

103+
/* NOTE: Must be equal to the last clock ID increased by one */
104+
#define CLKS_NR_MAIN (CLK_SCLK_MMC2 + 1)
105+
#define CLKS_NR_DMC (CLK_DIV_DMCD + 1)
106+
#define CLKS_NR_ISP (CLK_SCLK_MPWM_ISP + 1)
107+
103108
static const unsigned long exynos3250_cmu_clk_regs[] __initconst = {
104109
SRC_LEFTBUS,
105110
DIV_LEFTBUS,
@@ -807,7 +812,7 @@ static const struct samsung_cmu_info cmu_info __initconst = {
807812
.nr_fixed_factor_clks = ARRAY_SIZE(fixed_factor_clks),
808813
.cpu_clks = exynos3250_cpu_clks,
809814
.nr_cpu_clks = ARRAY_SIZE(exynos3250_cpu_clks),
810-
.nr_clk_ids = CLK_NR_CLKS,
815+
.nr_clk_ids = CLKS_NR_MAIN,
811816
.clk_regs = exynos3250_cmu_clk_regs,
812817
.nr_clk_regs = ARRAY_SIZE(exynos3250_cmu_clk_regs),
813818
};
@@ -923,7 +928,7 @@ static const struct samsung_cmu_info dmc_cmu_info __initconst = {
923928
.nr_mux_clks = ARRAY_SIZE(dmc_mux_clks),
924929
.div_clks = dmc_div_clks,
925930
.nr_div_clks = ARRAY_SIZE(dmc_div_clks),
926-
.nr_clk_ids = NR_CLKS_DMC,
931+
.nr_clk_ids = CLKS_NR_DMC,
927932
.clk_regs = exynos3250_cmu_dmc_clk_regs,
928933
.nr_clk_regs = ARRAY_SIZE(exynos3250_cmu_dmc_clk_regs),
929934
};
@@ -1067,7 +1072,7 @@ static const struct samsung_cmu_info isp_cmu_info __initconst = {
10671072
.nr_div_clks = ARRAY_SIZE(isp_div_clks),
10681073
.gate_clks = isp_gate_clks,
10691074
.nr_gate_clks = ARRAY_SIZE(isp_gate_clks),
1070-
.nr_clk_ids = NR_CLKS_ISP,
1075+
.nr_clk_ids = CLKS_NR_ISP,
10711076
};
10721077

10731078
static int __init exynos3250_cmu_isp_probe(struct platform_device *pdev)

drivers/clk/samsung/clk-exynos4.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@
135135
#define PWR_CTRL1_USE_CORE1_WFI (1 << 1)
136136
#define PWR_CTRL1_USE_CORE0_WFI (1 << 0)
137137

138+
/* NOTE: Must be equal to the last clock ID increased by one */
139+
#define CLKS_NR (CLK_DIV_CORE2 + 1)
140+
138141
/* the exynos4 soc type */
139142
enum exynos4_soc {
140143
EXYNOS4210,
@@ -1275,7 +1278,7 @@ static void __init exynos4_clk_init(struct device_node *np,
12751278
if (!reg_base)
12761279
panic("%s: failed to map registers\n", __func__);
12771280

1278-
ctx = samsung_clk_init(NULL, reg_base, CLK_NR_CLKS);
1281+
ctx = samsung_clk_init(NULL, reg_base, CLKS_NR);
12791282
hws = ctx->clk_data.hws;
12801283

12811284
samsung_clk_of_register_fixed_ext(ctx, exynos4_fixed_rate_ext_clks,

drivers/clk/samsung/clk-exynos4412-isp.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
#define E4X12_GATE_ISP0 0x0800
2323
#define E4X12_GATE_ISP1 0x0804
2424

25+
/* NOTE: Must be equal to the last clock ID increased by one */
26+
#define CLKS_NR_ISP (CLK_ISP_DIV_MCUISP1 + 1)
27+
2528
/*
2629
* Support for CMU save/restore across system suspends
2730
*/
@@ -121,7 +124,7 @@ static int __init exynos4x12_isp_clk_probe(struct platform_device *pdev)
121124
if (!exynos4x12_save_isp)
122125
return -ENOMEM;
123126

124-
ctx = samsung_clk_init(dev, reg_base, CLK_NR_ISP_CLKS);
127+
ctx = samsung_clk_init(dev, reg_base, CLKS_NR_ISP);
125128

126129
platform_set_drvdata(pdev, ctx);
127130

drivers/clk/samsung/clk-exynos5250.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@
100100
#define PWR_CTRL2_CORE2_UP_RATIO (1 << 4)
101101
#define PWR_CTRL2_CORE1_UP_RATIO (1 << 0)
102102

103+
/* NOTE: Must be equal to the last clock ID increased by one */
104+
#define CLKS_NR (CLK_MOUT_VPLLSRC + 1)
105+
103106
/* list of PLLs to be registered */
104107
enum exynos5250_plls {
105108
apll, mpll, cpll, epll, vpll, gpll, bpll,
@@ -797,7 +800,7 @@ static void __init exynos5250_clk_init(struct device_node *np)
797800
panic("%s: unable to determine soc\n", __func__);
798801
}
799802

800-
ctx = samsung_clk_init(NULL, reg_base, CLK_NR_CLKS);
803+
ctx = samsung_clk_init(NULL, reg_base, CLKS_NR);
801804
hws = ctx->clk_data.hws;
802805

803806
samsung_clk_of_register_fixed_ext(ctx, exynos5250_fixed_rate_ext_clks,

drivers/clk/samsung/clk-exynos5260.c

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,21 @@
1515

1616
#include <dt-bindings/clock/exynos5260-clk.h>
1717

18+
/* NOTE: Must be equal to the last clock ID increased by one */
19+
#define CLKS_NR_TOP (PHYCLK_USBDRD30_UDRD30_PHYCLOCK + 1)
20+
#define CLKS_NR_EGL (EGL_DOUT_EGL1 + 1)
21+
#define CLKS_NR_KFC (KFC_DOUT_KFC1 + 1)
22+
#define CLKS_NR_MIF (MIF_SCLK_LPDDR3PHY_WRAP_U0 + 1)
23+
#define CLKS_NR_G3D (G3D_CLK_G3D + 1)
24+
#define CLKS_NR_AUD (AUD_SCLK_I2S + 1)
25+
#define CLKS_NR_MFC (MFC_CLK_SMMU2_MFCM0 + 1)
26+
#define CLKS_NR_GSCL (GSCL_SCLK_CSIS0_WRAP + 1)
27+
#define CLKS_NR_FSYS (FSYS_PHYCLK_USBHOST20 + 1)
28+
#define CLKS_NR_PERI (PERI_SCLK_PCM1 + 1)
29+
#define CLKS_NR_DISP (DISP_MOUT_HDMI_PHY_PIXEL_USER + 1)
30+
#define CLKS_NR_G2D (G2D_CLK_SMMU3_G2D + 1)
31+
#define CLKS_NR_ISP (ISP_SCLK_UART_EXT + 1)
32+
1833
/*
1934
* Applicable for all 2550 Type PLLS for Exynos5260, listed below
2035
* DISP_PLL, EGL_PLL, KFC_PLL, MEM_PLL, BUS_PLL, MEDIA_PLL, G3D_PLL.
@@ -135,7 +150,7 @@ static const struct samsung_cmu_info aud_cmu __initconst = {
135150
.nr_div_clks = ARRAY_SIZE(aud_div_clks),
136151
.gate_clks = aud_gate_clks,
137152
.nr_gate_clks = ARRAY_SIZE(aud_gate_clks),
138-
.nr_clk_ids = AUD_NR_CLK,
153+
.nr_clk_ids = CLKS_NR_AUD,
139154
.clk_regs = aud_clk_regs,
140155
.nr_clk_regs = ARRAY_SIZE(aud_clk_regs),
141156
};
@@ -325,7 +340,7 @@ static const struct samsung_cmu_info disp_cmu __initconst = {
325340
.nr_div_clks = ARRAY_SIZE(disp_div_clks),
326341
.gate_clks = disp_gate_clks,
327342
.nr_gate_clks = ARRAY_SIZE(disp_gate_clks),
328-
.nr_clk_ids = DISP_NR_CLK,
343+
.nr_clk_ids = CLKS_NR_DISP,
329344
.clk_regs = disp_clk_regs,
330345
.nr_clk_regs = ARRAY_SIZE(disp_clk_regs),
331346
};
@@ -389,7 +404,7 @@ static const struct samsung_cmu_info egl_cmu __initconst = {
389404
.nr_mux_clks = ARRAY_SIZE(egl_mux_clks),
390405
.div_clks = egl_div_clks,
391406
.nr_div_clks = ARRAY_SIZE(egl_div_clks),
392-
.nr_clk_ids = EGL_NR_CLK,
407+
.nr_clk_ids = CLKS_NR_EGL,
393408
.clk_regs = egl_clk_regs,
394409
.nr_clk_regs = ARRAY_SIZE(egl_clk_regs),
395410
};
@@ -489,7 +504,7 @@ static const struct samsung_cmu_info fsys_cmu __initconst = {
489504
.nr_mux_clks = ARRAY_SIZE(fsys_mux_clks),
490505
.gate_clks = fsys_gate_clks,
491506
.nr_gate_clks = ARRAY_SIZE(fsys_gate_clks),
492-
.nr_clk_ids = FSYS_NR_CLK,
507+
.nr_clk_ids = CLKS_NR_FSYS,
493508
.clk_regs = fsys_clk_regs,
494509
.nr_clk_regs = ARRAY_SIZE(fsys_clk_regs),
495510
};
@@ -580,7 +595,7 @@ static const struct samsung_cmu_info g2d_cmu __initconst = {
580595
.nr_div_clks = ARRAY_SIZE(g2d_div_clks),
581596
.gate_clks = g2d_gate_clks,
582597
.nr_gate_clks = ARRAY_SIZE(g2d_gate_clks),
583-
.nr_clk_ids = G2D_NR_CLK,
598+
.nr_clk_ids = CLKS_NR_G2D,
584599
.clk_regs = g2d_clk_regs,
585600
.nr_clk_regs = ARRAY_SIZE(g2d_clk_regs),
586601
};
@@ -643,7 +658,7 @@ static const struct samsung_cmu_info g3d_cmu __initconst = {
643658
.nr_div_clks = ARRAY_SIZE(g3d_div_clks),
644659
.gate_clks = g3d_gate_clks,
645660
.nr_gate_clks = ARRAY_SIZE(g3d_gate_clks),
646-
.nr_clk_ids = G3D_NR_CLK,
661+
.nr_clk_ids = CLKS_NR_G3D,
647662
.clk_regs = g3d_clk_regs,
648663
.nr_clk_regs = ARRAY_SIZE(g3d_clk_regs),
649664
};
@@ -776,7 +791,7 @@ static const struct samsung_cmu_info gscl_cmu __initconst = {
776791
.nr_div_clks = ARRAY_SIZE(gscl_div_clks),
777792
.gate_clks = gscl_gate_clks,
778793
.nr_gate_clks = ARRAY_SIZE(gscl_gate_clks),
779-
.nr_clk_ids = GSCL_NR_CLK,
794+
.nr_clk_ids = CLKS_NR_GSCL,
780795
.clk_regs = gscl_clk_regs,
781796
.nr_clk_regs = ARRAY_SIZE(gscl_clk_regs),
782797
};
@@ -895,7 +910,7 @@ static const struct samsung_cmu_info isp_cmu __initconst = {
895910
.nr_div_clks = ARRAY_SIZE(isp_div_clks),
896911
.gate_clks = isp_gate_clks,
897912
.nr_gate_clks = ARRAY_SIZE(isp_gate_clks),
898-
.nr_clk_ids = ISP_NR_CLK,
913+
.nr_clk_ids = CLKS_NR_ISP,
899914
.clk_regs = isp_clk_regs,
900915
.nr_clk_regs = ARRAY_SIZE(isp_clk_regs),
901916
};
@@ -959,7 +974,7 @@ static const struct samsung_cmu_info kfc_cmu __initconst = {
959974
.nr_mux_clks = ARRAY_SIZE(kfc_mux_clks),
960975
.div_clks = kfc_div_clks,
961976
.nr_div_clks = ARRAY_SIZE(kfc_div_clks),
962-
.nr_clk_ids = KFC_NR_CLK,
977+
.nr_clk_ids = CLKS_NR_KFC,
963978
.clk_regs = kfc_clk_regs,
964979
.nr_clk_regs = ARRAY_SIZE(kfc_clk_regs),
965980
};
@@ -1015,7 +1030,7 @@ static const struct samsung_cmu_info mfc_cmu __initconst = {
10151030
.nr_div_clks = ARRAY_SIZE(mfc_div_clks),
10161031
.gate_clks = mfc_gate_clks,
10171032
.nr_gate_clks = ARRAY_SIZE(mfc_gate_clks),
1018-
.nr_clk_ids = MFC_NR_CLK,
1033+
.nr_clk_ids = CLKS_NR_MFC,
10191034
.clk_regs = mfc_clk_regs,
10201035
.nr_clk_regs = ARRAY_SIZE(mfc_clk_regs),
10211036
};
@@ -1164,7 +1179,7 @@ static const struct samsung_cmu_info mif_cmu __initconst = {
11641179
.nr_div_clks = ARRAY_SIZE(mif_div_clks),
11651180
.gate_clks = mif_gate_clks,
11661181
.nr_gate_clks = ARRAY_SIZE(mif_gate_clks),
1167-
.nr_clk_ids = MIF_NR_CLK,
1182+
.nr_clk_ids = CLKS_NR_MIF,
11681183
.clk_regs = mif_clk_regs,
11691184
.nr_clk_regs = ARRAY_SIZE(mif_clk_regs),
11701185
};
@@ -1370,7 +1385,7 @@ static const struct samsung_cmu_info peri_cmu __initconst = {
13701385
.nr_div_clks = ARRAY_SIZE(peri_div_clks),
13711386
.gate_clks = peri_gate_clks,
13721387
.nr_gate_clks = ARRAY_SIZE(peri_gate_clks),
1373-
.nr_clk_ids = PERI_NR_CLK,
1388+
.nr_clk_ids = CLKS_NR_PERI,
13741389
.clk_regs = peri_clk_regs,
13751390
.nr_clk_regs = ARRAY_SIZE(peri_clk_regs),
13761391
};
@@ -1826,7 +1841,7 @@ static const struct samsung_cmu_info top_cmu __initconst = {
18261841
.nr_gate_clks = ARRAY_SIZE(top_gate_clks),
18271842
.fixed_clks = fixed_rate_clks,
18281843
.nr_fixed_clks = ARRAY_SIZE(fixed_rate_clks),
1829-
.nr_clk_ids = TOP_NR_CLK,
1844+
.nr_clk_ids = CLKS_NR_TOP,
18301845
.clk_regs = top_clk_regs,
18311846
.nr_clk_regs = ARRAY_SIZE(top_clk_regs),
18321847
};

drivers/clk/samsung/clk-exynos5410.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
#define SRC_KFC 0x28200
5757
#define DIV_KFC0 0x28500
5858

59+
/* NOTE: Must be equal to the last clock ID increased by one */
60+
#define CLKS_NR 512
61+
5962
/* list of PLLs */
6063
enum exynos5410_plls {
6164
apll, cpll, epll, mpll,
@@ -260,7 +263,7 @@ static const struct samsung_cmu_info cmu __initconst = {
260263
.nr_div_clks = ARRAY_SIZE(exynos5410_div_clks),
261264
.gate_clks = exynos5410_gate_clks,
262265
.nr_gate_clks = ARRAY_SIZE(exynos5410_gate_clks),
263-
.nr_clk_ids = CLK_NR_CLKS,
266+
.nr_clk_ids = CLKS_NR,
264267
};
265268

266269
/* register exynos5410 clocks */

drivers/clk/samsung/clk-exynos5420.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@
139139
#define SRC_KFC 0x28200
140140
#define DIV_KFC0 0x28500
141141

142+
/* NOTE: Must be equal to the last clock ID increased by one */
143+
#define CLKS_NR (CLK_DOUT_PCLK_DREX1 + 1)
144+
142145
/* Exynos5x SoC type */
143146
enum exynos5x_soc {
144147
EXYNOS5420,
@@ -1587,7 +1590,7 @@ static void __init exynos5x_clk_init(struct device_node *np,
15871590

15881591
exynos5x_soc = soc;
15891592

1590-
ctx = samsung_clk_init(NULL, reg_base, CLK_NR_CLKS);
1593+
ctx = samsung_clk_init(NULL, reg_base, CLKS_NR);
15911594
hws = ctx->clk_data.hws;
15921595

15931596
samsung_clk_of_register_fixed_ext(ctx, exynos5x_fixed_rate_ext_clks,

0 commit comments

Comments
 (0)