linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mturquette@baylibre.com (Michael Turquette)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH v2 2/6] clk: meson: add peripheral gate macro
Date: Wed, 22 Jun 2016 19:01:16 -0700	[thread overview]
Message-ID: <1466647280-17596-3-git-send-email-mturquette@baylibre.com> (raw)
In-Reply-To: <1466647280-17596-1-git-send-email-mturquette@baylibre.com>

There are a series of peripheral and system gate clocks that fan out
from the clk81 signal. Add a helper macro to statically initialize these
gate clocks.

Tested-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
---
No change in v2.

 drivers/clk/meson/clkc.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/clk/meson/clkc.h b/drivers/clk/meson/clkc.h
index f3f396168ba4..9436932880c0 100644
--- a/drivers/clk/meson/clkc.h
+++ b/drivers/clk/meson/clkc.h
@@ -73,6 +73,20 @@ struct meson_clk_cpu {
 int meson_clk_cpu_notifier_cb(struct notifier_block *nb, unsigned long event,
 		void *data);
 
+#define MESON_GATE(_name, _reg, _bit)					\
+struct clk_gate gxbb_##_name = { 						\
+	.reg = (void __iomem *) _reg, 					\
+	.bit_idx = (_bit), 						\
+	.lock = &clk_lock,						\
+	.hw.init = &(struct clk_init_data) { 				\
+		.name = #_name,					\
+		.ops = &clk_gate_ops,					\
+		.parent_names = (const char *[]){ "clk81" },		\
+		.num_parents = 1,					\
+		.flags = (CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED), 	\
+	},								\
+};
+
 /* clk_ops */
 extern const struct clk_ops meson_clk_pll_ro_ops;
 extern const struct clk_ops meson_clk_pll_ops;
-- 
2.1.4

  parent reply	other threads:[~2016-06-23  2:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-23  2:01 [PATCH v2 0/6] Add support for AmLogic GXBB clock controller Michael Turquette
2016-06-23  2:01 ` [PATCH v2 1/6] clk: meson: only build selected platforms Michael Turquette
2016-06-23  2:01 ` Michael Turquette [this message]
2016-06-23  2:01 ` [PATCH v2 3/6] clk: meson: add mpll support Michael Turquette
2016-06-23  2:01 ` [PATCH v2 4/6] clk: meson: fractional pll support Michael Turquette
2016-06-23  2:01 ` [PATCH v2 5/6] clk: gxbb: Document bindings for the GXBB clock controller Michael Turquette
2016-06-23  2:01 ` [PATCH v2 6/6] clk: gxbb: add AmLogic GXBB clk controller driver Michael Turquette

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=1466647280-17596-3-git-send-email-mturquette@baylibre.com \
    --to=mturquette@baylibre.com \
    --cc=linus-amlogic@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).