Skip to content

Commit 7d4901d

Browse files
Will McVickerSylwester Nawrocki
authored andcommitted
clk: samsung: exynos5433: update apollo and atlas clock probing
Use the samsung common clk driver to initialize the apollo and atlas clocks. This removes their custom init functions and uses the samsung_cmu_register_one() instead. Signed-off-by: Will McVicker <[email protected]> Tested-by: Marek Szyprowski <[email protected]> Acked-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sylwester Nawrocki <[email protected]>
1 parent 3270ffe commit 7d4901d

File tree

1 file changed

+48
-72
lines changed

1 file changed

+48
-72
lines changed

drivers/clk/samsung/clk-exynos5433.c

Lines changed: 48 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -3675,44 +3675,32 @@ static const struct exynos_cpuclk_cfg_data exynos5433_apolloclk_d[] __initconst
36753675
{ 0 },
36763676
};
36773677

3678+
static const struct samsung_cpu_clock apollo_cpu_clks[] __initconst = {
3679+
CPU_CLK(CLK_SCLK_APOLLO, "apolloclk", CLK_MOUT_APOLLO_PLL,
3680+
CLK_MOUT_BUS_PLL_APOLLO_USER,
3681+
CLK_CPU_HAS_E5433_REGS_LAYOUT, 0x200,
3682+
exynos5433_apolloclk_d),
3683+
};
3684+
3685+
static const struct samsung_cmu_info apollo_cmu_info __initconst = {
3686+
.pll_clks = apollo_pll_clks,
3687+
.nr_pll_clks = ARRAY_SIZE(apollo_pll_clks),
3688+
.mux_clks = apollo_mux_clks,
3689+
.nr_mux_clks = ARRAY_SIZE(apollo_mux_clks),
3690+
.div_clks = apollo_div_clks,
3691+
.nr_div_clks = ARRAY_SIZE(apollo_div_clks),
3692+
.gate_clks = apollo_gate_clks,
3693+
.nr_gate_clks = ARRAY_SIZE(apollo_gate_clks),
3694+
.cpu_clks = apollo_cpu_clks,
3695+
.nr_cpu_clks = ARRAY_SIZE(apollo_cpu_clks),
3696+
.nr_clk_ids = APOLLO_NR_CLK,
3697+
.clk_regs = apollo_clk_regs,
3698+
.nr_clk_regs = ARRAY_SIZE(apollo_clk_regs),
3699+
};
3700+
36783701
static void __init exynos5433_cmu_apollo_init(struct device_node *np)
36793702
{
3680-
void __iomem *reg_base;
3681-
struct samsung_clk_provider *ctx;
3682-
struct clk_hw **hws;
3683-
3684-
reg_base = of_iomap(np, 0);
3685-
if (!reg_base) {
3686-
panic("%s: failed to map registers\n", __func__);
3687-
return;
3688-
}
3689-
3690-
ctx = samsung_clk_init(np, reg_base, APOLLO_NR_CLK);
3691-
if (!ctx) {
3692-
panic("%s: unable to allocate ctx\n", __func__);
3693-
return;
3694-
}
3695-
3696-
samsung_clk_register_pll(ctx, apollo_pll_clks,
3697-
ARRAY_SIZE(apollo_pll_clks), reg_base);
3698-
samsung_clk_register_mux(ctx, apollo_mux_clks,
3699-
ARRAY_SIZE(apollo_mux_clks));
3700-
samsung_clk_register_div(ctx, apollo_div_clks,
3701-
ARRAY_SIZE(apollo_div_clks));
3702-
samsung_clk_register_gate(ctx, apollo_gate_clks,
3703-
ARRAY_SIZE(apollo_gate_clks));
3704-
3705-
hws = ctx->clk_data.hws;
3706-
3707-
exynos_register_cpu_clock(ctx, CLK_SCLK_APOLLO, "apolloclk",
3708-
hws[CLK_MOUT_APOLLO_PLL], hws[CLK_MOUT_BUS_PLL_APOLLO_USER], 0x200,
3709-
exynos5433_apolloclk_d, ARRAY_SIZE(exynos5433_apolloclk_d),
3710-
CLK_CPU_HAS_E5433_REGS_LAYOUT);
3711-
3712-
samsung_clk_sleep_init(reg_base, apollo_clk_regs,
3713-
ARRAY_SIZE(apollo_clk_regs));
3714-
3715-
samsung_clk_of_add_provider(np, ctx);
3703+
samsung_cmu_register_one(np, &apollo_cmu_info);
37163704
}
37173705
CLK_OF_DECLARE(exynos5433_cmu_apollo, "samsung,exynos5433-cmu-apollo",
37183706
exynos5433_cmu_apollo_init);
@@ -3932,44 +3920,32 @@ static const struct exynos_cpuclk_cfg_data exynos5433_atlasclk_d[] __initconst =
39323920
{ 0 },
39333921
};
39343922

3935-
static void __init exynos5433_cmu_atlas_init(struct device_node *np)
3936-
{
3937-
void __iomem *reg_base;
3938-
struct samsung_clk_provider *ctx;
3939-
struct clk_hw **hws;
3940-
3941-
reg_base = of_iomap(np, 0);
3942-
if (!reg_base) {
3943-
panic("%s: failed to map registers\n", __func__);
3944-
return;
3945-
}
3946-
3947-
ctx = samsung_clk_init(np, reg_base, ATLAS_NR_CLK);
3948-
if (!ctx) {
3949-
panic("%s: unable to allocate ctx\n", __func__);
3950-
return;
3951-
}
3952-
3953-
samsung_clk_register_pll(ctx, atlas_pll_clks,
3954-
ARRAY_SIZE(atlas_pll_clks), reg_base);
3955-
samsung_clk_register_mux(ctx, atlas_mux_clks,
3956-
ARRAY_SIZE(atlas_mux_clks));
3957-
samsung_clk_register_div(ctx, atlas_div_clks,
3958-
ARRAY_SIZE(atlas_div_clks));
3959-
samsung_clk_register_gate(ctx, atlas_gate_clks,
3960-
ARRAY_SIZE(atlas_gate_clks));
3961-
3962-
hws = ctx->clk_data.hws;
3963-
3964-
exynos_register_cpu_clock(ctx, CLK_SCLK_ATLAS, "atlasclk",
3965-
hws[CLK_MOUT_ATLAS_PLL], hws[CLK_MOUT_BUS_PLL_ATLAS_USER], 0x200,
3966-
exynos5433_atlasclk_d, ARRAY_SIZE(exynos5433_atlasclk_d),
3967-
CLK_CPU_HAS_E5433_REGS_LAYOUT);
3923+
static const struct samsung_cpu_clock atlas_cpu_clks[] __initconst = {
3924+
CPU_CLK(CLK_SCLK_ATLAS, "atlasclk", CLK_MOUT_ATLAS_PLL,
3925+
CLK_MOUT_BUS_PLL_ATLAS_USER,
3926+
CLK_CPU_HAS_E5433_REGS_LAYOUT, 0x200,
3927+
exynos5433_atlasclk_d),
3928+
};
39683929

3969-
samsung_clk_sleep_init(reg_base, atlas_clk_regs,
3970-
ARRAY_SIZE(atlas_clk_regs));
3930+
static const struct samsung_cmu_info atlas_cmu_info __initconst = {
3931+
.pll_clks = atlas_pll_clks,
3932+
.nr_pll_clks = ARRAY_SIZE(atlas_pll_clks),
3933+
.mux_clks = atlas_mux_clks,
3934+
.nr_mux_clks = ARRAY_SIZE(atlas_mux_clks),
3935+
.div_clks = atlas_div_clks,
3936+
.nr_div_clks = ARRAY_SIZE(atlas_div_clks),
3937+
.gate_clks = atlas_gate_clks,
3938+
.nr_gate_clks = ARRAY_SIZE(atlas_gate_clks),
3939+
.cpu_clks = atlas_cpu_clks,
3940+
.nr_cpu_clks = ARRAY_SIZE(atlas_cpu_clks),
3941+
.nr_clk_ids = ATLAS_NR_CLK,
3942+
.clk_regs = atlas_clk_regs,
3943+
.nr_clk_regs = ARRAY_SIZE(atlas_clk_regs),
3944+
};
39713945

3972-
samsung_clk_of_add_provider(np, ctx);
3946+
static void __init exynos5433_cmu_atlas_init(struct device_node *np)
3947+
{
3948+
samsung_cmu_register_one(np, &atlas_cmu_info);
39733949
}
39743950
CLK_OF_DECLARE(exynos5433_cmu_atlas, "samsung,exynos5433-cmu-atlas",
39753951
exynos5433_cmu_atlas_init);

0 commit comments

Comments
 (0)