aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2013-08-26 13:08:59 -0400
committerMike Turquette <mturquette@linaro.org>2013-09-06 16:33:10 -0400
commite6c3e730a75faee17ebbf3220c00e3039ab49f53 (patch)
tree5f379c39b6d4eef67ac6ce5e794b3806cb44132e
parenta1fa6f503aad8da91c4cc8dd0e71d2789d78d3f6 (diff)
clk: samsung: exynos4: Use separate aliases for cpufreq related clocks
Exynos cpufreq driver is the only remaining piece of code that needs static clkdev aliases for operation, because it can not do device tree based clock lookups yet. This patch moves clock alias definitions for those clocks to separate arrays that can be used with samsung_clk_register_alias() helper. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mike Turquette <mturquette@linaro.org>
-rw-r--r--drivers/clk/samsung/clk-exynos4.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c
index 742b4c58ced9..d70d3cbaacfe 100644
--- a/drivers/clk/samsung/clk-exynos4.c
+++ b/drivers/clk/samsung/clk-exynos4.c
@@ -392,9 +392,8 @@ static struct samsung_mux_clock exynos4210_mux_clks[] __initdata = {
392 MUX(none, "mout_g2d", mout_g2d_p, E4210_SRC_IMAGE, 8, 1), 392 MUX(none, "mout_g2d", mout_g2d_p, E4210_SRC_IMAGE, 8, 1),
393 MUX(none, "mout_fimd1", group1_p4210, E4210_SRC_LCD1, 0, 4), 393 MUX(none, "mout_fimd1", group1_p4210, E4210_SRC_LCD1, 0, 4),
394 MUX(none, "mout_mipi1", group1_p4210, E4210_SRC_LCD1, 12, 4), 394 MUX(none, "mout_mipi1", group1_p4210, E4210_SRC_LCD1, 12, 4),
395 MUX_A(sclk_mpll, "sclk_mpll", mout_mpll_p, SRC_CPU, 8, 1, "mout_mpll"), 395 MUX(sclk_mpll, "sclk_mpll", mout_mpll_p, SRC_CPU, 8, 1),
396 MUX_A(mout_core, "mout_core", mout_core_p4210, 396 MUX(mout_core, "mout_core", mout_core_p4210, SRC_CPU, 16, 1),
397 SRC_CPU, 16, 1, "moutcore"),
398 MUX_A(sclk_vpll, "sclk_vpll", sclk_vpll_p4210, 397 MUX_A(sclk_vpll, "sclk_vpll", sclk_vpll_p4210,
399 SRC_TOP0, 8, 1, "sclk_vpll"), 398 SRC_TOP0, 8, 1, "sclk_vpll"),
400 MUX(mout_fimc0, "mout_fimc0", group1_p4210, SRC_CAM, 0, 4), 399 MUX(mout_fimc0, "mout_fimc0", group1_p4210, SRC_CAM, 0, 4),
@@ -431,8 +430,8 @@ static struct samsung_mux_clock exynos4210_mux_clks[] __initdata = {
431 430
432/* list of mux clocks supported in exynos4x12 soc */ 431/* list of mux clocks supported in exynos4x12 soc */
433static struct samsung_mux_clock exynos4x12_mux_clks[] __initdata = { 432static struct samsung_mux_clock exynos4x12_mux_clks[] __initdata = {
434 MUX_A(mout_mpll_user_c, "mout_mpll_user_c", mout_mpll_user_p4x12, 433 MUX(mout_mpll_user_c, "mout_mpll_user_c", mout_mpll_user_p4x12,
435 SRC_CPU, 24, 1, "mout_mpll"), 434 SRC_CPU, 24, 1),
436 MUX(none, "mout_aclk266_gps", aclk_p4412, SRC_TOP1, 4, 1), 435 MUX(none, "mout_aclk266_gps", aclk_p4412, SRC_TOP1, 4, 1),
437 MUX(none, "mout_aclk400_mcuisp", aclk_p4412, SRC_TOP1, 8, 1), 436 MUX(none, "mout_aclk400_mcuisp", aclk_p4412, SRC_TOP1, 8, 1),
438 MUX(mout_mpll_user_t, "mout_mpll_user_t", mout_mpll_user_p4x12, 437 MUX(mout_mpll_user_t, "mout_mpll_user_t", mout_mpll_user_p4x12,
@@ -456,8 +455,7 @@ static struct samsung_mux_clock exynos4x12_mux_clks[] __initdata = {
456 SRC_DMC, 12, 1, "sclk_mpll"), 455 SRC_DMC, 12, 1, "sclk_mpll"),
457 MUX_A(sclk_vpll, "sclk_vpll", mout_vpll_p, 456 MUX_A(sclk_vpll, "sclk_vpll", mout_vpll_p,
458 SRC_TOP0, 8, 1, "sclk_vpll"), 457 SRC_TOP0, 8, 1, "sclk_vpll"),
459 MUX_A(mout_core, "mout_core", mout_core_p4x12, 458 MUX(mout_core, "mout_core", mout_core_p4x12, SRC_CPU, 16, 1),
460 SRC_CPU, 16, 1, "moutcore"),
461 MUX(mout_fimc0, "mout_fimc0", group1_p4x12, SRC_CAM, 0, 4), 459 MUX(mout_fimc0, "mout_fimc0", group1_p4x12, SRC_CAM, 0, 4),
462 MUX(mout_fimc1, "mout_fimc1", group1_p4x12, SRC_CAM, 4, 4), 460 MUX(mout_fimc1, "mout_fimc1", group1_p4x12, SRC_CAM, 4, 4),
463 MUX(mout_fimc2, "mout_fimc2", group1_p4x12, SRC_CAM, 8, 4), 461 MUX(mout_fimc2, "mout_fimc2", group1_p4x12, SRC_CAM, 8, 4),
@@ -545,7 +543,7 @@ static struct samsung_div_clock exynos4_div_clks[] __initdata = {
545 DIV(none, "div_spi_pre2", "div_spi2", DIV_PERIL2, 8, 8), 543 DIV(none, "div_spi_pre2", "div_spi2", DIV_PERIL2, 8, 8),
546 DIV(none, "div_audio1", "mout_audio1", DIV_PERIL4, 0, 4), 544 DIV(none, "div_audio1", "mout_audio1", DIV_PERIL4, 0, 4),
547 DIV(none, "div_audio2", "mout_audio2", DIV_PERIL4, 16, 4), 545 DIV(none, "div_audio2", "mout_audio2", DIV_PERIL4, 16, 4),
548 DIV_A(arm_clk, "arm_clk", "div_core2", DIV_CPU0, 28, 3, "armclk"), 546 DIV(arm_clk, "arm_clk", "div_core2", DIV_CPU0, 28, 3),
549 DIV_A(sclk_apll, "sclk_apll", "mout_apll", 547 DIV_A(sclk_apll, "sclk_apll", "mout_apll",
550 DIV_CPU0, 24, 3, "sclk_apll"), 548 DIV_CPU0, 24, 3, "sclk_apll"),
551 DIV_F(none, "div_mipi_pre0", "div_mipi0", DIV_LCD0, 20, 4, 549 DIV_F(none, "div_mipi_pre0", "div_mipi0", DIV_LCD0, 20, 4,
@@ -926,6 +924,20 @@ static struct samsung_gate_clock exynos4x12_gate_clks[] __initdata = {
926 GATE(tmu_apbif, "tmu_apbif", "aclk100", E4X12_GATE_IP_PERIR, 17, 0, 0), 924 GATE(tmu_apbif, "tmu_apbif", "aclk100", E4X12_GATE_IP_PERIR, 17, 0, 0),
927}; 925};
928 926
927static struct samsung_clock_alias exynos4_aliases[] __initdata = {
928 ALIAS(mout_core, NULL, "moutcore"),
929 ALIAS(arm_clk, NULL, "armclk"),
930 ALIAS(sclk_apll, NULL, "mout_apll"),
931};
932
933static struct samsung_clock_alias exynos4210_aliases[] __initdata = {
934 ALIAS(sclk_mpll, NULL, "mout_mpll"),
935};
936
937static struct samsung_clock_alias exynos4x12_aliases[] __initdata = {
938 ALIAS(mout_mpll_user_c, NULL, "mout_mpll"),
939};
940
929/* 941/*
930 * The parent of the fin_pll clock is selected by the XOM[0] bit. This bit 942 * The parent of the fin_pll clock is selected by the XOM[0] bit. This bit
931 * resides in chipid register space, outside of the clock controller memory 943 * resides in chipid register space, outside of the clock controller memory
@@ -1061,6 +1073,8 @@ static void __init exynos4_clk_init(struct device_node *np,
1061 ARRAY_SIZE(exynos4210_div_clks)); 1073 ARRAY_SIZE(exynos4210_div_clks));
1062 samsung_clk_register_gate(exynos4210_gate_clks, 1074 samsung_clk_register_gate(exynos4210_gate_clks,
1063 ARRAY_SIZE(exynos4210_gate_clks)); 1075 ARRAY_SIZE(exynos4210_gate_clks));
1076 samsung_clk_register_alias(exynos4210_aliases,
1077 ARRAY_SIZE(exynos4210_aliases));
1064 } else { 1078 } else {
1065 samsung_clk_register_mux(exynos4x12_mux_clks, 1079 samsung_clk_register_mux(exynos4x12_mux_clks,
1066 ARRAY_SIZE(exynos4x12_mux_clks)); 1080 ARRAY_SIZE(exynos4x12_mux_clks));
@@ -1068,8 +1082,13 @@ static void __init exynos4_clk_init(struct device_node *np,
1068 ARRAY_SIZE(exynos4x12_div_clks)); 1082 ARRAY_SIZE(exynos4x12_div_clks));
1069 samsung_clk_register_gate(exynos4x12_gate_clks, 1083 samsung_clk_register_gate(exynos4x12_gate_clks,
1070 ARRAY_SIZE(exynos4x12_gate_clks)); 1084 ARRAY_SIZE(exynos4x12_gate_clks));
1085 samsung_clk_register_alias(exynos4x12_aliases,
1086 ARRAY_SIZE(exynos4x12_aliases));
1071 } 1087 }
1072 1088
1089 samsung_clk_register_alias(exynos4_aliases,
1090 ARRAY_SIZE(exynos4_aliases));
1091
1073 pr_info("%s clocks: sclk_apll = %ld, sclk_mpll = %ld\n" 1092 pr_info("%s clocks: sclk_apll = %ld, sclk_mpll = %ld\n"
1074 "\tsclk_epll = %ld, sclk_vpll = %ld, arm_clk = %ld\n", 1093 "\tsclk_epll = %ld, sclk_vpll = %ld, arm_clk = %ld\n",
1075 exynos4_soc == EXYNOS4210 ? "Exynos4210" : "Exynos4x12", 1094 exynos4_soc == EXYNOS4210 ? "Exynos4210" : "Exynos4x12",