diff options
-rw-r--r-- | arch/arm/mach-imx/clk-vf610.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/arch/arm/mach-imx/clk-vf610.c b/arch/arm/mach-imx/clk-vf610.c index 409637254594..5937ddee1a99 100644 --- a/arch/arm/mach-imx/clk-vf610.c +++ b/arch/arm/mach-imx/clk-vf610.c | |||
@@ -120,6 +120,17 @@ static unsigned int const clks_init_on[] __initconst = { | |||
120 | VF610_CLK_DDR_SEL, | 120 | VF610_CLK_DDR_SEL, |
121 | }; | 121 | }; |
122 | 122 | ||
123 | static struct clk * __init vf610_get_fixed_clock( | ||
124 | struct device_node *ccm_node, const char *name) | ||
125 | { | ||
126 | struct clk *clk = of_clk_get_by_name(ccm_node, name); | ||
127 | |||
128 | /* Backward compatibility if device tree is missing clks assignments */ | ||
129 | if (IS_ERR(clk)) | ||
130 | clk = imx_obtain_fixed_clock(name, 0); | ||
131 | return clk; | ||
132 | }; | ||
133 | |||
123 | static void __init vf610_clocks_init(struct device_node *ccm_node) | 134 | static void __init vf610_clocks_init(struct device_node *ccm_node) |
124 | { | 135 | { |
125 | struct device_node *np; | 136 | struct device_node *np; |
@@ -130,13 +141,13 @@ static void __init vf610_clocks_init(struct device_node *ccm_node) | |||
130 | clk[VF610_CLK_SIRC_32K] = imx_clk_fixed("sirc_32k", 32000); | 141 | clk[VF610_CLK_SIRC_32K] = imx_clk_fixed("sirc_32k", 32000); |
131 | clk[VF610_CLK_FIRC] = imx_clk_fixed("firc", 24000000); | 142 | clk[VF610_CLK_FIRC] = imx_clk_fixed("firc", 24000000); |
132 | 143 | ||
133 | clk[VF610_CLK_SXOSC] = imx_obtain_fixed_clock("sxosc", 0); | 144 | clk[VF610_CLK_SXOSC] = vf610_get_fixed_clock(ccm_node, "sxosc"); |
134 | clk[VF610_CLK_FXOSC] = imx_obtain_fixed_clock("fxosc", 0); | 145 | clk[VF610_CLK_FXOSC] = vf610_get_fixed_clock(ccm_node, "fxosc"); |
135 | clk[VF610_CLK_AUDIO_EXT] = imx_obtain_fixed_clock("audio_ext", 0); | 146 | clk[VF610_CLK_AUDIO_EXT] = vf610_get_fixed_clock(ccm_node, "audio_ext"); |
136 | clk[VF610_CLK_ENET_EXT] = imx_obtain_fixed_clock("enet_ext", 0); | 147 | clk[VF610_CLK_ENET_EXT] = vf610_get_fixed_clock(ccm_node, "enet_ext"); |
137 | 148 | ||
138 | /* Clock source from external clock via LVDs PAD */ | 149 | /* Clock source from external clock via LVDs PAD */ |
139 | clk[VF610_CLK_ANACLK1] = imx_obtain_fixed_clock("anaclk1", 0); | 150 | clk[VF610_CLK_ANACLK1] = vf610_get_fixed_clock(ccm_node, "anaclk1"); |
140 | 151 | ||
141 | clk[VF610_CLK_FXOSC_HALF] = imx_clk_fixed_factor("fxosc_half", "fxosc", 1, 2); | 152 | clk[VF610_CLK_FXOSC_HALF] = imx_clk_fixed_factor("fxosc_half", "fxosc", 1, 2); |
142 | 153 | ||