diff options
author | Yuantian Tang <andy.tang@nxp.com> | 2017-04-05 22:21:23 -0400 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2017-07-21 18:01:45 -0400 |
commit | 45899dc5f1b5107903b2bc1c78e22d7945a895fd (patch) | |
tree | 3fd26f32e29df70988425286b55376755f755d33 | |
parent | e0c888c4a24dd4e55525f37ac854125b3e90c99a (diff) |
clk: qoriq: add pll clock to clock lookup table
Register each PLL and its division clocks to clock
lookup table to facilitate the clock look up for
clock consumer.
Signed-off-by: Tang Yuantian <andy.tang@nxp.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-rw-r--r-- | drivers/clk/clk-qoriq.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c index 62cf32f2d7dd..0e7de00a84d2 100644 --- a/drivers/clk/clk-qoriq.c +++ b/drivers/clk/clk-qoriq.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/clk.h> | 13 | #include <linux/clk.h> |
14 | #include <linux/clk-provider.h> | 14 | #include <linux/clk-provider.h> |
15 | #include <linux/clkdev.h> | ||
15 | #include <linux/fsl/guts.h> | 16 | #include <linux/fsl/guts.h> |
16 | #include <linux/io.h> | 17 | #include <linux/io.h> |
17 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
@@ -1124,6 +1125,7 @@ static void __init create_one_pll(struct clockgen *cg, int idx) | |||
1124 | 1125 | ||
1125 | for (i = 0; i < ARRAY_SIZE(pll->div); i++) { | 1126 | for (i = 0; i < ARRAY_SIZE(pll->div); i++) { |
1126 | struct clk *clk; | 1127 | struct clk *clk; |
1128 | int ret; | ||
1127 | 1129 | ||
1128 | snprintf(pll->div[i].name, sizeof(pll->div[i].name), | 1130 | snprintf(pll->div[i].name, sizeof(pll->div[i].name), |
1129 | "cg-pll%d-div%d", idx, i + 1); | 1131 | "cg-pll%d-div%d", idx, i + 1); |
@@ -1137,6 +1139,11 @@ static void __init create_one_pll(struct clockgen *cg, int idx) | |||
1137 | } | 1139 | } |
1138 | 1140 | ||
1139 | pll->div[i].clk = clk; | 1141 | pll->div[i].clk = clk; |
1142 | ret = clk_register_clkdev(clk, pll->div[i].name, NULL); | ||
1143 | if (ret != 0) | ||
1144 | pr_err("%s: %s: register to lookup table failed %ld\n", | ||
1145 | __func__, pll->div[i].name, PTR_ERR(clk)); | ||
1146 | |||
1140 | } | 1147 | } |
1141 | } | 1148 | } |
1142 | 1149 | ||