From: Peter De Schrijver <pdeschrijver@nvidia.com>
To: Peter De Schrijver <pdeschrijver@nvidia.com>
Cc: Mike Turquette <mturquette@linaro.org>,
Stephen Warren <swarren@wwwdotorg.org>,
Prashant Gaikwad <pgaikwad@nvidia.com>,
Thierry Reding <thierry.reding@avionic-design.de>,
Joseph Lo <josephl@nvidia.com>,
Paul Walmsley <pwalmsley@nvidia.com>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-tegra@vger.kernel.org>
Subject: [PATCH v2 03/12] clk: tegra: Add TEGRA_PERIPH_NO_DIV flag
Date: Mon, 23 Sep 2013 17:24:55 +0300 [thread overview]
Message-ID: <1379946381-20125-4-git-send-email-pdeschrijver@nvidia.com> (raw)
In-Reply-To: <1379946381-20125-1-git-send-email-pdeschrijver@nvidia.com>
This flag indicates the peripheral clock does not have a divider. It will
simply the initialization tables and avoids some very similar code.
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
---
drivers/clk/tegra/clk-periph.c | 8 +++++---
drivers/clk/tegra/clk.h | 1 +
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/tegra/clk-periph.c b/drivers/clk/tegra/clk-periph.c
index 55ab4b1..becbeee 100644
--- a/drivers/clk/tegra/clk-periph.c
+++ b/drivers/clk/tegra/clk-periph.c
@@ -173,11 +173,12 @@ const struct clk_ops tegra_clk_periph_nodiv_ops = {
static struct clk *_tegra_clk_register_periph(const char *name,
const char **parent_names, int num_parents,
struct tegra_clk_periph *periph,
- void __iomem *clk_base, u32 offset, bool div,
+ void __iomem *clk_base, u32 offset,
unsigned long flags)
{
struct clk *clk;
struct clk_init_data init;
+ bool div = !(periph->gate.flags & TEGRA_PERIPH_NO_DIV);
init.name = name;
init.ops = div ? &tegra_clk_periph_ops : &tegra_clk_periph_nodiv_ops;
@@ -210,7 +211,7 @@ struct clk *tegra_clk_register_periph(const char *name,
u32 offset, unsigned long flags)
{
return _tegra_clk_register_periph(name, parent_names, num_parents,
- periph, clk_base, offset, true, flags);
+ periph, clk_base, offset, flags);
}
struct clk *tegra_clk_register_periph_nodiv(const char *name,
@@ -218,6 +219,7 @@ struct clk *tegra_clk_register_periph_nodiv(const char *name,
struct tegra_clk_periph *periph, void __iomem *clk_base,
u32 offset)
{
+ periph->gate.flags |= TEGRA_PERIPH_NO_DIV;
return _tegra_clk_register_periph(name, parent_names, num_parents,
- periph, clk_base, offset, false, CLK_SET_RATE_PARENT);
+ periph, clk_base, offset, CLK_SET_RATE_PARENT);
}
diff --git a/drivers/clk/tegra/clk.h b/drivers/clk/tegra/clk.h
index 4fdaef4..7ddd407 100644
--- a/drivers/clk/tegra/clk.h
+++ b/drivers/clk/tegra/clk.h
@@ -397,6 +397,7 @@ struct tegra_clk_periph_gate {
#define TEGRA_PERIPH_MANUAL_RESET BIT(1)
#define TEGRA_PERIPH_ON_APB BIT(2)
#define TEGRA_PERIPH_WAR_1005168 BIT(3)
+#define TEGRA_PERIPH_NO_DIV BIT(4)
void tegra_periph_reset(struct tegra_clk_periph_gate *gate, bool assert);
extern const struct clk_ops tegra_clk_periph_gate_ops;
--
1.7.7.rc0.72.g4b5ea.dirty
next prev parent reply other threads:[~2013-09-23 14:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-23 14:24 [PATCH v2 00/12] Introduce common infra for tegra clocks Peter De Schrijver
2013-09-23 14:24 ` [PATCH v2 01/12] clk: tegra: simplify periph clock data Peter De Schrijver
2013-09-23 14:24 ` [PATCH v2 02/12] clk: tegra: common periph_clk_enb_refcnt and clks Peter De Schrijver
2013-09-23 14:24 ` Peter De Schrijver [this message]
2013-09-23 14:24 ` [PATCH v2 04/12] clk: tegra: move some PLLC and PLLXC init to clk-pll.c Peter De Schrijver
2013-09-23 14:24 ` [PATCH v2 05/12] clk: tegra: add header for common tegra clock IDs Peter De Schrijver
2013-09-23 14:24 ` [PATCH v2 06/12] clk: tegra: add common infra for DT clocks Peter De Schrijver
2013-09-23 14:24 ` [PATCH v2 07/12] clk: tegra: move audio clk to common file Peter De Schrijver
2013-09-23 14:25 ` [PATCH v2 08/12] clk: tegra: move periph clocks " Peter De Schrijver
2013-09-23 14:25 ` [PATCH v2 09/12] clk: tegra: move PMC " Peter De Schrijver
2013-09-23 14:25 ` [PATCH v2 10/12] clk: tegra: move fixed " Peter De Schrijver
2013-09-23 14:25 ` [PATCH v2 11/12] clk: tegra: introduce common tegra_osc_clk_init Peter De Schrijver
2013-09-23 14:25 ` [PATCH v2 12/12] clk: tegra: introduce common gen4 super clock Peter De Schrijver
2013-10-01 17:39 ` [PATCH v2 00/12] Introduce common infra for tegra clocks Stephen Warren
2013-10-03 9:16 ` 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=1379946381-20125-4-git-send-email-pdeschrijver@nvidia.com \
--to=pdeschrijver@nvidia.com \
--cc=josephl@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=pwalmsley@nvidia.com \
--cc=swarren@wwwdotorg.org \
--cc=thierry.reding@avionic-design.de \
/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
all inboxes | Powered by JetHome®