diff options
author | Richard Zhao <richard.zhao@freescale.com> | 2012-04-24 02:19:13 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-05-11 03:18:06 -0400 |
commit | a258561df107a88a042121ea2b950a716691fca6 (patch) | |
tree | f8b66c485260e1c8c817f3ea6b6028c1adedeed8 /arch/arm/mach-imx/mach-imx6q.c | |
parent | 0987b598eadfbb16297e8a8d4be2002b2ea32a63 (diff) |
ARM: imx6q_sabrelite: clk_register_clkdev cko1 for sgtl5000
Signed-off-by: Richard Zhao <richard.zhao@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.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index e0cc3dac3bec..095c5c5de7bc 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c | |||
@@ -10,6 +10,8 @@ | |||
10 | * http://www.gnu.org/copyleft/gpl.html | 10 | * http://www.gnu.org/copyleft/gpl.html |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/clk.h> | ||
14 | #include <linux/clkdev.h> | ||
13 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
14 | #include <linux/init.h> | 16 | #include <linux/init.h> |
15 | #include <linux/io.h> | 17 | #include <linux/io.h> |
@@ -77,11 +79,37 @@ static int ksz9021rn_phy_fixup(struct phy_device *phydev) | |||
77 | return 0; | 79 | return 0; |
78 | } | 80 | } |
79 | 81 | ||
82 | static void __init imx6q_sabrelite_cko1_setup(void) | ||
83 | { | ||
84 | struct clk *cko1_sel, *ahb, *cko1; | ||
85 | unsigned long rate; | ||
86 | |||
87 | cko1_sel = clk_get_sys(NULL, "cko1_sel"); | ||
88 | ahb = clk_get_sys(NULL, "ahb"); | ||
89 | cko1 = clk_get_sys(NULL, "cko1"); | ||
90 | if (IS_ERR(cko1_sel) || IS_ERR(ahb) || IS_ERR(cko1)) { | ||
91 | pr_err("cko1 setup failed!\n"); | ||
92 | goto put_clk; | ||
93 | } | ||
94 | clk_set_parent(cko1_sel, ahb); | ||
95 | rate = clk_round_rate(cko1, 16000000); | ||
96 | clk_set_rate(cko1, rate); | ||
97 | clk_register_clkdev(cko1, NULL, "0-000a"); | ||
98 | put_clk: | ||
99 | if (!IS_ERR(cko1_sel)) | ||
100 | clk_put(cko1_sel); | ||
101 | if (!IS_ERR(ahb)) | ||
102 | clk_put(ahb); | ||
103 | if (!IS_ERR(cko1)) | ||
104 | clk_put(cko1); | ||
105 | } | ||
106 | |||
80 | static void __init imx6q_sabrelite_init(void) | 107 | static void __init imx6q_sabrelite_init(void) |
81 | { | 108 | { |
82 | if (IS_ENABLED(CONFIG_PHYLIB)) | 109 | if (IS_ENABLED(CONFIG_PHYLIB)) |
83 | phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, | 110 | phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, |
84 | ksz9021rn_phy_fixup); | 111 | ksz9021rn_phy_fixup); |
112 | imx6q_sabrelite_cko1_setup(); | ||
85 | } | 113 | } |
86 | 114 | ||
87 | static void __init imx6q_init_machine(void) | 115 | static void __init imx6q_init_machine(void) |