From: mturquette@linaro.org (Mike Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/5] clk: of: helper for determining number of parent clocks
Date: Wed, 21 Aug 2013 22:53:10 -0700 [thread overview]
Message-ID: <1377150793-27864-3-git-send-email-mturquette@linaro.org> (raw)
In-Reply-To: <1377150793-27864-1-git-send-email-mturquette@linaro.org>
Walks the "clocks" array of parent clock phandles and returns the
number.
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
---
No change since v3
drivers/clk/clk.c | 6 ++++++
include/linux/clk-provider.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index bc02037..2655882 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2189,6 +2189,12 @@ struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec)
return clk;
}
+int of_clk_get_parent_count(struct device_node *np)
+{
+ return of_count_phandle_with_args(np, "clocks", "#clock-cells");
+}
+EXPORT_SYMBOL_GPL(of_clk_get_parent_count);
+
const char *of_clk_get_parent_name(struct device_node *np, int index)
{
struct of_phandle_args clkspec;
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 015f18c..5497739 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -471,6 +471,7 @@ void of_clk_del_provider(struct device_node *np);
struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
void *data);
struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data);
+int of_clk_get_parent_count(struct device_node *np);
const char *of_clk_get_parent_name(struct device_node *np, int index);
void of_clk_init(const struct of_device_id *matches);
--
1.8.1.2
next prev parent reply other threads:[~2013-08-22 5:53 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-22 5:53 [PATCH v4 0/5] clk: dt: bindings for mux, divider & gate clocks Mike Turquette
2013-08-22 5:53 ` [PATCH v4 1/5] clk: divider: replace bitfield width with mask Mike Turquette
2013-08-22 5:53 ` Mike Turquette [this message]
2013-08-22 5:53 ` [PATCH v4 3/5] clk: dt: binding for basic multiplexer clock Mike Turquette
2013-08-28 15:50 ` Kumar Gala
2013-08-29 1:14 ` Mike Turquette
2013-08-29 6:58 ` Tero Kristo
2013-08-30 5:54 ` Tony Lindgren
2013-08-30 20:02 ` Kumar Gala
2013-08-30 20:33 ` Mike Turquette
2013-08-30 20:48 ` Kumar Gala
2013-08-30 21:37 ` Stephen Warren
2013-09-03 23:22 ` Mike Turquette
2013-09-04 18:36 ` Stephen Warren
2013-09-05 18:29 ` Mike Turquette
2013-09-05 20:30 ` Stephen Warren
2013-09-05 20:51 ` Sylwester Nawrocki
2013-09-06 6:53 ` Tero Kristo
2013-09-06 19:01 ` Stephen Warren
2013-09-07 4:15 ` Saravana Kannan
2013-09-07 12:27 ` Tomasz Figa
2013-08-22 5:53 ` [PATCH v4 4/5] clk: dt: binding for basic divider clock Mike Turquette
2013-08-22 5:53 ` [PATCH v4 5/5] clk: dt: binding for basic gate clock Mike Turquette
2013-08-30 1:45 ` Haojian Zhuang
2013-08-30 20:06 ` Stephen Warren
2013-09-04 3:03 ` Haojian Zhuang
2013-09-04 17:59 ` Tony Lindgren
2013-09-07 11:56 ` Tomasz Figa
2013-08-29 18:23 ` [PATCH v4 0/5] clk: dt: bindings for mux, divider & gate clocks Santosh Shilimkar
2013-08-30 7:05 ` Tero Kristo
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=1377150793-27864-3-git-send-email-mturquette@linaro.org \
--to=mturquette@linaro.org \
--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).