linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yixun Lan <yixun.lan@amlogic.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Neil Armstrong <narmstrong@baylibre.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Carlo Caione <carlo@caione.org>,
	Yixun Lan <yixun.lan@amlogic.com>,
	Xingyu Chen <xingyu.chen@amlogic.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-gpio@vger.kernel.org, linux-amlogic@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] pinctrl: meson: introduce a macro to have name/groups seperated
Date: Mon, 8 Jan 2018 15:33:27 +0800	[thread overview]
Message-ID: <20180108073328.205769-2-yixun.lan@amlogic.com> (raw)
In-Reply-To: <20180108073328.205769-1-yixun.lan@amlogic.com>

We introduce a macro FUNCTION_EX here, the main motivation is
trying to have the possibility to expand the macro with the same of the
'.name' number but different multiple '.groups/.num_groups' numbers.

With this change, the meson pinctrl drivr is capable of have one uniform
'function' name but with different pin 'groups', as we face the sitiuation
that two pin groups may live inside different hardware domain (EE vs AO domain),
which mean we couldn't put them in one single group.

Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
---
 drivers/pinctrl/meson/pinctrl-meson.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/meson/pinctrl-meson.h b/drivers/pinctrl/meson/pinctrl-meson.h
index 12a391109329..d8f705098810 100644
--- a/drivers/pinctrl/meson/pinctrl-meson.h
+++ b/drivers/pinctrl/meson/pinctrl-meson.h
@@ -124,13 +124,15 @@ struct meson_pinctrl {
 	struct device_node *of_node;
 };
 
-#define FUNCTION(fn)							\
+#define FUNCTION_EX(fn, ex)						\
 	{								\
 		.name = #fn,						\
-		.groups = fn ## _groups,				\
-		.num_groups = ARRAY_SIZE(fn ## _groups),		\
+		.groups = fn ## ex ## _groups,				\
+		.num_groups = ARRAY_SIZE(fn ## ex ## _groups),		\
 	}
 
+#define FUNCTION(fn)	FUNCTION_EX(fn, )
+
 #define BANK(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib)	\
 	{								\
 		.name		= n,					\
-- 
2.15.1

  reply	other threads:[~2018-01-08  7:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-08  7:33 [PATCH 0/2] pinctrl: meson: use one uniform 'function' name Yixun Lan
2018-01-08  7:33 ` Yixun Lan [this message]
2018-01-08  7:33 ` [PATCH 2/2] pinctrl: meson-axg: correct the pin expansion of UART_AO_B Yixun Lan
2018-01-08  8:52 ` [PATCH 0/2] pinctrl: meson: use one uniform 'function' name Jerome Brunet
2018-01-10  2:12   ` Yixun Lan
2018-01-10  7:28     ` Jerome Brunet
2018-01-10 12:00       ` Yixun Lan
2018-01-17  0:14         ` Kevin Hilman
2018-01-18 13:54           ` Yixun Lan
2018-01-11  9:46 ` Linus Walleij

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=20180108073328.205769-2-yixun.lan@amlogic.com \
    --to=yixun.lan@amlogic.com \
    --cc=carlo@caione.org \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=narmstrong@baylibre.com \
    --cc=xingyu.chen@amlogic.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;
as well as URLs for NNTP newsgroup(s).