From: Peter De Schrijver <pdeschrijver@nvidia.com>
To: Peter De Schrijver <pdeschrijver@nvidia.com>
Cc: Prashant Gaikwad <pgaikwad@nvidia.com>,
Mike Turquette <mturquette@linaro.org>,
Stephen Warren <swarren@wwwdotorg.org>,
Thierry Reding <thierry.reding@gmail.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-tegra@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH v5 08/15] clk: tegra: add common infra for DT clocks
Date: Fri, 18 Oct 2013 16:25:12 +0300 [thread overview]
Message-ID: <1382102719-5531-9-git-send-email-pdeschrijver@nvidia.com> (raw)
In-Reply-To: <1382102719-5531-1-git-send-email-pdeschrijver@nvidia.com>
Introduce a common infrastructure for sharing clock initialization between
SoCs.
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
---
drivers/clk/tegra/clk.c | 9 +++++++++
drivers/clk/tegra/clk.h | 7 +++++++
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/drivers/clk/tegra/clk.c b/drivers/clk/tegra/clk.c
index 3a95a87..a0430cd 100644
--- a/drivers/clk/tegra/clk.c
+++ b/drivers/clk/tegra/clk.c
@@ -212,6 +212,15 @@ void __init tegra_add_of_provider(struct device_node *np)
of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
}
+struct clk ** __init tegra_lookup_dt_id(int clk_id,
+ struct tegra_clk *tegra_clk)
+{
+ if (tegra_clk[clk_id].present)
+ return &clks[tegra_clk[clk_id].dt_id];
+ else
+ return NULL;
+}
+
tegra_clk_apply_init_table_func tegra_clk_apply_init_table;
void __init tegra_clocks_apply_init_table(void)
diff --git a/drivers/clk/tegra/clk.h b/drivers/clk/tegra/clk.h
index c49df4d..489dad5 100644
--- a/drivers/clk/tegra/clk.h
+++ b/drivers/clk/tegra/clk.h
@@ -568,6 +568,11 @@ struct tegra_clk_duplicate {
}, \
}
+struct tegra_clk {
+ int dt_id;
+ bool present;
+};
+
void tegra_init_from_table(struct tegra_clk_init_table *tbl,
struct clk *clks[], int clk_max);
@@ -577,6 +582,8 @@ void tegra_init_dup_clks(struct tegra_clk_duplicate *dup_list,
struct tegra_clk_periph_regs *get_reg_bank(int clkid);
struct clk **tegra_clk_init(int num, int periph_banks);
+struct clk **tegra_lookup_dt_id(int clk_id, struct tegra_clk *tegra_clk);
+
void tegra_add_of_provider(struct device_node *np);
void tegra114_clock_tune_cpu_trimmers_high(void);
--
1.7.7.rc0.72.g4b5ea.dirty
next prev parent reply other threads:[~2013-10-18 13:27 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1382102719-5531-1-git-send-email-pdeschrijver@nvidia.com>
2013-10-18 13:25 ` [PATCH v5 01/15] ARM: tegra30: add missing CLK IDs Peter De Schrijver
2013-10-20 21:31 ` Stephen Warren
2013-10-21 8:39 ` Peter De Schrijver
2013-10-18 13:25 ` [PATCH v5 02/15] clk: tegra: simplify periph clock data Peter De Schrijver
2013-10-18 13:25 ` [PATCH v5 03/15] clk: tegra: common periph_clk_enb_refcnt and clks Peter De Schrijver
2013-10-18 13:25 ` [PATCH v5 04/15] clk: tegra: Add TEGRA_PERIPH_NO_DIV flag Peter De Schrijver
2013-10-18 13:25 ` [PATCH v5 05/15] clk: tegra: move some PLLC and PLLXC init to clk-pll.c Peter De Schrijver
2013-10-18 13:25 ` [PATCH v5 06/15] clk: tegra: move fields to tegra_clk_pll_params Peter De Schrijver
2013-10-18 13:25 ` [PATCH v5 07/15] clk: tegra: add header for common tegra clock IDs Peter De Schrijver
2013-10-18 13:25 ` Peter De Schrijver [this message]
2013-10-18 13:25 ` [PATCH v5 09/15] clk: tegra: add clkdev registration infra Peter De Schrijver
2013-10-18 13:25 ` [PATCH v5 10/15] clk: tegra: move audio clk to common file Peter De Schrijver
2013-10-18 23:30 ` Andrew Bresticker
2013-10-18 13:25 ` [PATCH v5 11/15] clk: tegra: move periph clocks " Peter De Schrijver
2013-10-18 13:25 ` [PATCH v5 12/15] clk: tegra: move PMC, fixed clocks to common files Peter De Schrijver
2013-10-19 0:01 ` Andrew Bresticker
2013-10-18 13:25 ` [PATCH v5 13/15] clk: tegra: introduce common gen4 super clock Peter De Schrijver
2013-10-19 0:16 ` Andrew Bresticker
2013-10-18 13:25 ` [PATCH v5 14/15] clk: tegra: move tegra30 to common infra Peter De Schrijver
2013-10-18 13:25 ` [PATCH v5 15/15] clk: tegra: move tegra20 " Peter De Schrijver
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=1382102719-5531-9-git-send-email-pdeschrijver@nvidia.com \
--to=pdeschrijver@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=pgaikwad@nvidia.com \
--cc=swarren@wwwdotorg.org \
--cc=thierry.reding@gmail.com \
/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
Powered by JetHome