Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1467314 > unrolled thread

[PATCH 0/2] clk: samsung: Move struct samsung_cmu_info to init section

Started byChanwoo Choi <cw00.choi@samsung.com>
First post2016-08-22 05:00 +0200
Last post2016-08-22 05:00 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/2] clk: samsung: Move struct samsung_cmu_info to init section Chanwoo Choi <cw00.choi@samsung.com> - 2016-08-22 05:00 +0200
    [PATCH 2/2] clk: samsung: exynos5410: Use samsung_cmu_register_one()  to simplify code Chanwoo Choi <cw00.choi@samsung.com> - 2016-08-22 05:00 +0200

#1467314 — [PATCH 0/2] clk: samsung: Move struct samsung_cmu_info to init section

FromChanwoo Choi <cw00.choi@samsung.com>
Date2016-08-22 05:00 +0200
Subject[PATCH 0/2] clk: samsung: Move struct samsung_cmu_info to init section
Message-ID<s8NCV-mn-3@gated-at.bofh.it>
This patchset moves the struct samsung_cmu_info to init section for
exynos5260/5410 because they are used only in initconst section.

Chanwoo Choi (2):
  clk: samsung: exynos5260: Move struct samsung_cmu_info to init section
  clk: samsung: exynos5410: Use samsung_cmu_register_one() to simplify code

 drivers/clk/samsung/clk-exynos5260.c | 350 +++++++++++++++++------------------
 drivers/clk/samsung/clk-exynos5410.c |  33 ++--
 2 files changed, 188 insertions(+), 195 deletions(-)

-- 
1.9.1

[toc] | [next] | [standalone]


#1467316 — [PATCH 2/2] clk: samsung: exynos5410: Use samsung_cmu_register_one() to simplify code

FromChanwoo Choi <cw00.choi@samsung.com>
Date2016-08-22 05:00 +0200
Subject[PATCH 2/2] clk: samsung: exynos5410: Use samsung_cmu_register_one() to simplify code
Message-ID<s8NCV-mn-7@gated-at.bofh.it>
In reply to#1467314
This patch uses the samsung_cmu_register_one() to simplify code
and move the pll/mux/div/gate data to initconst section.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/clk/samsung/clk-exynos5410.c | 33 +++++++++++++--------------------
 1 file changed, 13 insertions(+), 20 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos5410.c b/drivers/clk/samsung/clk-exynos5410.c
index 54ec486a5e45..5488a4460c15 100644
--- a/drivers/clk/samsung/clk-exynos5410.c
+++ b/drivers/clk/samsung/clk-exynos5410.c
@@ -230,29 +230,22 @@ static const struct samsung_pll_clock exynos5410_plls[nr_plls] __initconst = {
 		KPLL_CON0, NULL),
 };
 
+static const struct samsung_cmu_info cmu __initconst = {
+	.pll_clks	= exynos5410_plls,
+	.nr_pll_clks	= ARRAY_SIZE(exynos5410_plls),
+	.mux_clks	= exynos5410_mux_clks,
+	.nr_mux_clks	= ARRAY_SIZE(exynos5410_mux_clks),
+	.div_clks	= exynos5410_div_clks,
+	.nr_div_clks	= ARRAY_SIZE(exynos5410_div_clks),
+	.gate_clks	= exynos5410_gate_clks,
+	.nr_gate_clks	= ARRAY_SIZE(exynos5410_gate_clks),
+	.nr_clk_ids	= CLK_NR_CLKS,
+};
+
 /* register exynos5410 clocks */
 static void __init exynos5410_clk_init(struct device_node *np)
 {
-	struct samsung_clk_provider *ctx;
-	void __iomem *reg_base;
-
-	reg_base = of_iomap(np, 0);
-	if (!reg_base)
-		panic("%s: failed to map registers\n", __func__);
-
-	ctx = samsung_clk_init(np, reg_base, CLK_NR_CLKS);
-
-	samsung_clk_register_pll(ctx, exynos5410_plls,
-			ARRAY_SIZE(exynos5410_plls), reg_base);
-
-	samsung_clk_register_mux(ctx, exynos5410_mux_clks,
-			ARRAY_SIZE(exynos5410_mux_clks));
-	samsung_clk_register_div(ctx, exynos5410_div_clks,
-			ARRAY_SIZE(exynos5410_div_clks));
-	samsung_clk_register_gate(ctx, exynos5410_gate_clks,
-			ARRAY_SIZE(exynos5410_gate_clks));
-
-	samsung_clk_of_add_provider(np, ctx);
+	samsung_cmu_register_one(np, &cmu);
 
 	pr_debug("Exynos5410: clock setup completed.\n");
 }
-- 
1.9.1

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web