Skip to content

Commit 826951d

Browse files
committed
clk: samsung: exynos4: do not define number of clocks in bindings
Number of clocks supported by Linux drivers might vary - sometimes we add new clocks, not exposed previously. Therefore these numbers of clocks should not be in the bindings, as that prevents changing them. Define number of clocks per each clock controller inside the driver directly. Reviewed-by: Alim Akhtar <[email protected]> Reviewed-by: Chanwoo Choi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Kozlowski <[email protected]>
1 parent ec01691 commit 826951d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

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

0 commit comments

Comments
 (0)