diff options
-rw-r--r-- | arch/arm/mach-imx/clk-imx6sx.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/arch/arm/mach-imx/clk-imx6sx.c b/arch/arm/mach-imx/clk-imx6sx.c index 6a5a8b543c23..e8b9a973b502 100644 --- a/arch/arm/mach-imx/clk-imx6sx.c +++ b/arch/arm/mach-imx/clk-imx6sx.c | |||
@@ -115,6 +115,9 @@ static struct clk_div_table video_div_table[] = { | |||
115 | { } | 115 | { } |
116 | }; | 116 | }; |
117 | 117 | ||
118 | static u32 share_count_asrc; | ||
119 | static u32 share_count_audio; | ||
120 | |||
118 | static void __init imx6sx_clocks_init(struct device_node *ccm_node) | 121 | static void __init imx6sx_clocks_init(struct device_node *ccm_node) |
119 | { | 122 | { |
120 | struct device_node *np; | 123 | struct device_node *np; |
@@ -319,9 +322,8 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node) | |||
319 | clks[IMX6SX_CLK_AIPS_TZ1] = imx_clk_gate2("aips_tz1", "ahb", base + 0x68, 0); | 322 | clks[IMX6SX_CLK_AIPS_TZ1] = imx_clk_gate2("aips_tz1", "ahb", base + 0x68, 0); |
320 | clks[IMX6SX_CLK_AIPS_TZ2] = imx_clk_gate2("aips_tz2", "ahb", base + 0x68, 2); | 323 | clks[IMX6SX_CLK_AIPS_TZ2] = imx_clk_gate2("aips_tz2", "ahb", base + 0x68, 2); |
321 | clks[IMX6SX_CLK_APBH_DMA] = imx_clk_gate2("apbh_dma", "usdhc3", base + 0x68, 4); | 324 | clks[IMX6SX_CLK_APBH_DMA] = imx_clk_gate2("apbh_dma", "usdhc3", base + 0x68, 4); |
322 | clks[IMX6SX_CLK_ASRC_GATE] = imx_clk_gate2("asrc_gate", "ahb", base + 0x68, 6); | 325 | clks[IMX6SX_CLK_ASRC_MEM] = imx_clk_gate2_shared("asrc_mem", "ahb", base + 0x68, 6, &share_count_asrc); |
323 | clks[IMX6SX_CLK_ASRC_MEM] = imx_clk_fixed_factor("asrc_mem", "asrc_gate", 1, 1); | 326 | clks[IMX6SX_CLK_ASRC_IPG] = imx_clk_gate2_shared("asrc_ipg", "ahb", base + 0x68, 6, &share_count_asrc); |
324 | clks[IMX6SX_CLK_ASRC_IPG] = imx_clk_fixed_factor("asrc_ipg", "asrc_gate", 1, 1); | ||
325 | clks[IMX6SX_CLK_CAAM_MEM] = imx_clk_gate2("caam_mem", "ahb", base + 0x68, 8); | 327 | clks[IMX6SX_CLK_CAAM_MEM] = imx_clk_gate2("caam_mem", "ahb", base + 0x68, 8); |
326 | clks[IMX6SX_CLK_CAAM_ACLK] = imx_clk_gate2("caam_aclk", "ahb", base + 0x68, 10); | 328 | clks[IMX6SX_CLK_CAAM_ACLK] = imx_clk_gate2("caam_aclk", "ahb", base + 0x68, 10); |
327 | clks[IMX6SX_CLK_CAAM_IPG] = imx_clk_gate2("caam_ipg", "ipg", base + 0x68, 12); | 329 | clks[IMX6SX_CLK_CAAM_IPG] = imx_clk_gate2("caam_ipg", "ipg", base + 0x68, 12); |
@@ -394,9 +396,8 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node) | |||
394 | clks[IMX6SX_CLK_ROM] = imx_clk_gate2("rom", "ahb", base + 0x7c, 0); | 396 | clks[IMX6SX_CLK_ROM] = imx_clk_gate2("rom", "ahb", base + 0x7c, 0); |
395 | clks[IMX6SX_CLK_SDMA] = imx_clk_gate2("sdma", "ahb", base + 0x7c, 6); | 397 | clks[IMX6SX_CLK_SDMA] = imx_clk_gate2("sdma", "ahb", base + 0x7c, 6); |
396 | clks[IMX6SX_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12); | 398 | clks[IMX6SX_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12); |
397 | clks[IMX6SX_CLK_AUDIO_GATE] = imx_clk_gate2("audio_gate", "audio_podf", base + 0x7c, 14); | 399 | clks[IMX6SX_CLK_AUDIO] = imx_clk_gate2_shared("audio", "audio_podf", base + 0x7c, 14, &share_count_audio); |
398 | clks[IMX6SX_CLK_AUDIO] = imx_clk_fixed_factor("audio", "audio_gate", 1, 1); | 400 | clks[IMX6SX_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_audio); |
399 | clks[IMX6SX_CLK_SPDIF] = imx_clk_fixed_factor("spdif", "audio_gate", 1, 1); | ||
400 | clks[IMX6SX_CLK_SSI1_IPG] = imx_clk_gate2("ssi1_ipg", "ipg", base + 0x7c, 18); | 401 | clks[IMX6SX_CLK_SSI1_IPG] = imx_clk_gate2("ssi1_ipg", "ipg", base + 0x7c, 18); |
401 | clks[IMX6SX_CLK_SSI2_IPG] = imx_clk_gate2("ssi2_ipg", "ipg", base + 0x7c, 20); | 402 | clks[IMX6SX_CLK_SSI2_IPG] = imx_clk_gate2("ssi2_ipg", "ipg", base + 0x7c, 20); |
402 | clks[IMX6SX_CLK_SSI3_IPG] = imx_clk_gate2("ssi3_ipg", "ipg", base + 0x7c, 22); | 403 | clks[IMX6SX_CLK_SSI3_IPG] = imx_clk_gate2("ssi3_ipg", "ipg", base + 0x7c, 22); |
@@ -479,20 +480,11 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node) | |||
479 | /* Audio clocks */ | 480 | /* Audio clocks */ |
480 | clk_set_rate(clks[IMX6SX_CLK_PLL4_AUDIO_DIV], 393216000); | 481 | clk_set_rate(clks[IMX6SX_CLK_PLL4_AUDIO_DIV], 393216000); |
481 | 482 | ||
482 | /* | 483 | clk_set_parent(clks[IMX6SX_CLK_SPDIF_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]); |
483 | * IMPORTANT: | 484 | clk_set_rate(clks[IMX6SX_CLK_SPDIF_PODF], 98304000); |
484 | * SPDIF and AUDIO clocks are sharing the same gate on i.MX6 Solo X | 485 | |
485 | * while their rates and gates are being handled by separate drivers. | ||
486 | * To keep them safe, we here merge them into one clock and use one | ||
487 | * exact rate so there'd not be any conflict during usages of them. | ||
488 | * | ||
489 | * But this results a limitation that if using these two simultaneous, | ||
490 | * make sure to keep them identical as what the code does over here. | ||
491 | */ | ||
492 | clk_set_parent(clks[IMX6SX_CLK_SPDIF_SEL], clks[IMX6SX_CLK_PLL3_USB_OTG]); | ||
493 | clk_set_parent(clks[IMX6SX_CLK_AUDIO_SEL], clks[IMX6SX_CLK_PLL3_USB_OTG]); | 486 | clk_set_parent(clks[IMX6SX_CLK_AUDIO_SEL], clks[IMX6SX_CLK_PLL3_USB_OTG]); |
494 | clk_set_rate(clks[IMX6SX_CLK_SPDIF_PODF], 48000000); | 487 | clk_set_rate(clks[IMX6SX_CLK_AUDIO_PODF], 24000000); |
495 | clk_set_rate(clks[IMX6SX_CLK_AUDIO_PODF], 48000000); | ||
496 | 488 | ||
497 | clk_set_parent(clks[IMX6SX_CLK_SSI1_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]); | 489 | clk_set_parent(clks[IMX6SX_CLK_SSI1_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]); |
498 | clk_set_parent(clks[IMX6SX_CLK_SSI2_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]); | 490 | clk_set_parent(clks[IMX6SX_CLK_SSI2_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]); |