linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: andy.tang@nxp.com (Yuantian Tang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] clk: qoriq: add pll clock to clock lookup table
Date: Thu, 6 Apr 2017 10:21:23 +0800	[thread overview]
Message-ID: <1491445283-13053-2-git-send-email-andy.tang@nxp.com> (raw)
In-Reply-To: <1491445283-13053-1-git-send-email-andy.tang@nxp.com>

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>
---
 drivers/clk/clk-qoriq.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index 62cf32f..1bb691a 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -12,6 +12,7 @@
 
 #include <linux/clk.h>
 #include <linux/clk-provider.h>
+#include <linux/clkdev.h>
 #include <linux/fsl/guts.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
@@ -1124,6 +1125,7 @@ static void __init create_one_pll(struct clockgen *cg, int idx)
 
 	for (i = 0; i < ARRAY_SIZE(pll->div); i++) {
 		struct clk *clk;
+		int ret;
 
 		snprintf(pll->div[i].name, sizeof(pll->div[i].name),
 			 "cg-pll%d-div%d", idx, i + 1);
@@ -1137,6 +1139,11 @@ static void __init create_one_pll(struct clockgen *cg, int idx)
 		}
 
 		pll->div[i].clk = clk;
+		ret = clk_register_clkdev(clk, pll->div[i].name, NULL);
+		if (ret != 0)
+			pr_err("%s: %s: register to lookup table failed %ld\n",
+			       __func__, pll->div[i].name, PTR_ERR(clk));
+
 	}
 }
 
-- 
2.1.0.27.g96db324

  reply	other threads:[~2017-04-06  2:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06  2:21 [PATCH 1/2] clk: qoriq: add clock configuration for ls1088a soc Yuantian Tang
2017-04-06  2:21 ` Yuantian Tang [this message]
2017-07-21 22:02   ` [PATCH 2/2] clk: qoriq: add pll clock to clock lookup table Stephen Boyd
2017-07-21 22:01 ` [PATCH 1/2] clk: qoriq: add clock configuration for ls1088a soc Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1491445283-13053-2-git-send-email-andy.tang@nxp.com \
    --to=andy.tang@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).