public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: maxime.ripard@free-electrons.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/6] clk: sunxi-ng: mux: Add mux table macro
Date: Thu,  1 Sep 2016 16:16:13 +0200	[thread overview]
Message-ID: <20160901141617.9777-3-maxime.ripard@free-electrons.com> (raw)
In-Reply-To: <20160901141617.9777-1-maxime.ripard@free-electrons.com>

Add a new macro to declare muxes based on a table and a gate.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 drivers/clk/sunxi-ng/ccu_mux.h | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/clk/sunxi-ng/ccu_mux.h b/drivers/clk/sunxi-ng/ccu_mux.h
index f5123a1a6603..47aba3a48245 100644
--- a/drivers/clk/sunxi-ng/ccu_mux.h
+++ b/drivers/clk/sunxi-ng/ccu_mux.h
@@ -43,9 +43,12 @@ struct ccu_mux {
 	struct ccu_common	common;
 };
 
-#define SUNXI_CCU_MUX(_struct, _name, _parents, _reg, _shift, _width, _flags) \
+#define SUNXI_CCU_MUX_TABLE_WITH_GATE(_struct, _name, _parents, _table,	\
+				     _reg, _shift, _width, _gate,	\
+				     _flags)				\
 	struct ccu_mux _struct = {					\
-		.mux	= _SUNXI_CCU_MUX(_shift, _width),		\
+		.enable	= _gate,					\
+		.mux	= _SUNXI_CCU_MUX_TABLE(_shift, _width, _table),	\
 		.common	= {						\
 			.reg		= _reg,				\
 			.hw.init	= CLK_HW_INIT_PARENTS(_name,	\
@@ -57,17 +60,14 @@ struct ccu_mux {
 
 #define SUNXI_CCU_MUX_WITH_GATE(_struct, _name, _parents, _reg,		\
 				_shift, _width, _gate, _flags)		\
-	struct ccu_mux _struct = {					\
-		.enable	= _gate,					\
-		.mux	= _SUNXI_CCU_MUX(_shift, _width),		\
-		.common	= {						\
-			.reg		= _reg,				\
-			.hw.init	= CLK_HW_INIT_PARENTS(_name,	\
-							      _parents, \
-							      &ccu_mux_ops, \
-							      _flags),	\
-		}							\
-	}
+	SUNXI_CCU_MUX_TABLE_WITH_GATE(_struct, _name, _parents, NULL,	\
+				      _reg, _shift, _width, _gate,	\
+				      _flags)
+
+#define SUNXI_CCU_MUX(_struct, _name, _parents, _reg, _shift, _width,	\
+		      _flags)						\
+	SUNXI_CCU_MUX_TABLE_WITH_GATE(_struct, _name, _parents, NULL,	\
+				      _reg, _shift, _width, 0, _flags)
 
 static inline struct ccu_mux *hw_to_ccu_mux(struct clk_hw *hw)
 {
-- 
2.9.2

  parent reply	other threads:[~2016-09-01 14:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-01 14:16 [PATCH 0/6] clk: sunxi-ng: Introduce support for A23 and A33 CCUs Maxime Ripard
2016-09-01 14:16 ` [PATCH 1/6] clk: sunxi-ng: div: Add mux table macros Maxime Ripard
2016-09-02  7:25   ` Chen-Yu Tsai
2016-09-01 14:16 ` Maxime Ripard [this message]
2016-09-02  7:26   ` [PATCH 2/6] clk: sunxi-ng: mux: Add mux table macro Chen-Yu Tsai
2016-09-01 14:16 ` [PATCH 3/6] clk: sunxi-ng: Add N-class clocks support Maxime Ripard
2016-09-05  3:31   ` Chen-Yu Tsai
2016-09-01 14:16 ` [PATCH 4/6] clk: sunxi-ng: Add A33 CCU support Maxime Ripard
2016-09-05  6:34   ` Chen-Yu Tsai
2016-09-05  9:51     ` Maxime Ripard
2016-09-05 10:26       ` Chen-Yu Tsai
2016-09-01 14:16 ` [PATCH 5/6] clk: sunxi-ng: Add A23 CCU Maxime Ripard
2016-09-01 14:16 ` [PATCH 6/6] ARM: sun8i: Convert the A23 and A33 to the CCU Maxime Ripard

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=20160901141617.9777-3-maxime.ripard@free-electrons.com \
    --to=maxime.ripard@free-electrons.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