diff options
Diffstat (limited to 'arch/arm/mach-imx/clk-imx51-imx53.c')
-rw-r--r-- | arch/arm/mach-imx/clk-imx51-imx53.c | 44 |
1 files changed, 8 insertions, 36 deletions
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c index 6fc486b6a3c6..929762742ee1 100644 --- a/arch/arm/mach-imx/clk-imx51-imx53.c +++ b/arch/arm/mach-imx/clk-imx51-imx53.c | |||
@@ -123,11 +123,13 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil, | |||
123 | { | 123 | { |
124 | int i; | 124 | int i; |
125 | 125 | ||
126 | of_clk_init(NULL); | ||
127 | |||
126 | clk[dummy] = imx_clk_fixed("dummy", 0); | 128 | clk[dummy] = imx_clk_fixed("dummy", 0); |
127 | clk[ckil] = imx_clk_fixed("ckil", rate_ckil); | 129 | clk[ckil] = imx_obtain_fixed_clock("ckil", rate_ckil); |
128 | clk[osc] = imx_clk_fixed("osc", rate_osc); | 130 | clk[osc] = imx_obtain_fixed_clock("osc", rate_osc); |
129 | clk[ckih1] = imx_clk_fixed("ckih1", rate_ckih1); | 131 | clk[ckih1] = imx_obtain_fixed_clock("ckih1", rate_ckih1); |
130 | clk[ckih2] = imx_clk_fixed("ckih2", rate_ckih2); | 132 | clk[ckih2] = imx_obtain_fixed_clock("ckih2", rate_ckih2); |
131 | 133 | ||
132 | clk[lp_apm] = imx_clk_mux("lp_apm", MXC_CCM_CCSR, 9, 1, | 134 | clk[lp_apm] = imx_clk_mux("lp_apm", MXC_CCM_CCSR, 9, 1, |
133 | lp_apm_sel, ARRAY_SIZE(lp_apm_sel)); | 135 | lp_apm_sel, ARRAY_SIZE(lp_apm_sel)); |
@@ -542,42 +544,12 @@ int __init mx53_clocks_init(unsigned long rate_ckil, unsigned long rate_osc, | |||
542 | return 0; | 544 | return 0; |
543 | } | 545 | } |
544 | 546 | ||
545 | #ifdef CONFIG_OF | ||
546 | static void __init clk_get_freq_dt(unsigned long *ckil, unsigned long *osc, | ||
547 | unsigned long *ckih1, unsigned long *ckih2) | ||
548 | { | ||
549 | struct device_node *np; | ||
550 | |||
551 | /* retrieve the freqency of fixed clocks from device tree */ | ||
552 | for_each_compatible_node(np, NULL, "fixed-clock") { | ||
553 | u32 rate; | ||
554 | if (of_property_read_u32(np, "clock-frequency", &rate)) | ||
555 | continue; | ||
556 | |||
557 | if (of_device_is_compatible(np, "fsl,imx-ckil")) | ||
558 | *ckil = rate; | ||
559 | else if (of_device_is_compatible(np, "fsl,imx-osc")) | ||
560 | *osc = rate; | ||
561 | else if (of_device_is_compatible(np, "fsl,imx-ckih1")) | ||
562 | *ckih1 = rate; | ||
563 | else if (of_device_is_compatible(np, "fsl,imx-ckih2")) | ||
564 | *ckih2 = rate; | ||
565 | } | ||
566 | } | ||
567 | |||
568 | int __init mx51_clocks_init_dt(void) | 547 | int __init mx51_clocks_init_dt(void) |
569 | { | 548 | { |
570 | unsigned long ckil, osc, ckih1, ckih2; | 549 | return mx51_clocks_init(0, 0, 0, 0); |
571 | |||
572 | clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2); | ||
573 | return mx51_clocks_init(ckil, osc, ckih1, ckih2); | ||
574 | } | 550 | } |
575 | 551 | ||
576 | int __init mx53_clocks_init_dt(void) | 552 | int __init mx53_clocks_init_dt(void) |
577 | { | 553 | { |
578 | unsigned long ckil, osc, ckih1, ckih2; | 554 | return mx53_clocks_init(0, 0, 0, 0); |
579 | |||
580 | clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2); | ||
581 | return mx53_clocks_init(ckil, osc, ckih1, ckih2); | ||
582 | } | 555 | } |
583 | #endif | ||