summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/mach-imx6q.c
diff options
context:
space:
mode:
authorNicolin Chen <b42378@freescale.com>2013-06-13 19:50:56 +0800
committerShawn Guo <shawn.guo@linaro.org>2013-06-17 15:45:16 +0800
commite7eccc7e16acfcc3e613e7c0df7e62528d24581c (patch)
tree59bcf789c1f05e9a6d4abebb1f3b331edb8dfae4 /arch/arm/mach-imx/mach-imx6q.c
parent3250f59e5d1c6279bd02c45c681b258adf9899a8 (diff)
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: Nicolin Chen <b42378@freescale.com> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx/mach-imx6q.c')
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 045e5e30b18f..f5965220a4d8 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -146,6 +146,45 @@ static void __init imx6q_sabrelite_init(void)
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)
{
struct regmap *gpr;
@@ -166,6 +205,9 @@ static void __init imx6q_init_machine(void)
{
if (of_machine_is_compatible("fsl,imx6q-sabrelite"))
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);