Commit e7eccc7e authored by Nicolin Chen's avatar Nicolin Chen Committed by Shawn Guo

ARM: clk-imx6qdl: Add clko1 configuration for imx6qdl-sabresd

WM8962 needs 24MHz clock for its MCLK, so choose PLL4 as the parent of clko1.
Signed-off-by: default avatarNicolin Chen <b42378@freescale.com>
Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
parent 3250f59e
...@@ -550,6 +550,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) ...@@ -550,6 +550,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
clk_register_clkdev(clk[ahb], "ahb", NULL); clk_register_clkdev(clk[ahb], "ahb", NULL);
clk_register_clkdev(clk[cko1], "cko1", NULL); clk_register_clkdev(clk[cko1], "cko1", NULL);
clk_register_clkdev(clk[arm], NULL, "cpu0"); clk_register_clkdev(clk[arm], NULL, "cpu0");
clk_register_clkdev(clk[pll4_post_div], "pll4_post_div", NULL);
clk_register_clkdev(clk[pll4_audio], "pll4_audio", NULL);
if (imx6q_revision() != IMX_CHIP_REVISION_1_0) { if (imx6q_revision() != IMX_CHIP_REVISION_1_0) {
clk_set_parent(clk[ldb_di0_sel], clk[pll5_video_div]); clk_set_parent(clk[ldb_di0_sel], clk[pll5_video_div]);
......
...@@ -146,6 +146,45 @@ static void __init imx6q_sabrelite_init(void) ...@@ -146,6 +146,45 @@ static void __init imx6q_sabrelite_init(void)
imx6q_sabrelite_cko1_setup(); imx6q_sabrelite_cko1_setup();
} }
static void __init imx6q_sabresd_cko1_setup(void)
{
struct clk *cko1_sel, *pll4, *pll4_post, *cko1;
unsigned long rate;
cko1_sel = clk_get_sys(NULL, "cko1_sel");
pll4 = clk_get_sys(NULL, "pll4_audio");
pll4_post = clk_get_sys(NULL, "pll4_post_div");
cko1 = clk_get_sys(NULL, "cko1");
if (IS_ERR(cko1_sel) || IS_ERR(pll4)
|| IS_ERR(pll4_post) || IS_ERR(cko1)) {
pr_err("cko1 setup failed!\n");
goto put_clk;
}
/*
* Setting pll4 at 768MHz (24MHz * 32)
* So its child clock can get 24MHz easily
*/
clk_set_rate(pll4, 768000000);
clk_set_parent(cko1_sel, pll4_post);
rate = clk_round_rate(cko1, 24000000);
clk_set_rate(cko1, rate);
put_clk:
if (!IS_ERR(cko1_sel))
clk_put(cko1_sel);
if (!IS_ERR(pll4_post))
clk_put(pll4_post);
if (!IS_ERR(pll4))
clk_put(pll4);
if (!IS_ERR(cko1))
clk_put(cko1);
}
static void __init imx6q_sabresd_init(void)
{
imx6q_sabresd_cko1_setup();
}
static void __init imx6q_1588_init(void) static void __init imx6q_1588_init(void)
{ {
struct regmap *gpr; struct regmap *gpr;
...@@ -166,6 +205,9 @@ static void __init imx6q_init_machine(void) ...@@ -166,6 +205,9 @@ static void __init imx6q_init_machine(void)
{ {
if (of_machine_is_compatible("fsl,imx6q-sabrelite")) if (of_machine_is_compatible("fsl,imx6q-sabrelite"))
imx6q_sabrelite_init(); imx6q_sabrelite_init();
else if (of_machine_is_compatible("fsl,imx6q-sabresd") ||
of_machine_is_compatible("fsl,imx6dl-sabresd"))
imx6q_sabresd_init();
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment