From: Magnus Damm <magnus.damm@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: linux-sh@vger.kernel.org, linus.walleij@linaro.org,
wsa@the-dreams.de, horms@verge.net.au,
laurent.pinchart@ideasonboard.com,
Magnus Damm <magnus.damm@gmail.com>
Subject: [PATCH 03/05 v2] pinctrl: sh-pfc: r7s72100 single pin macros
Date: Tue, 17 Dec 2013 11:38:14 +0900 [thread overview]
Message-ID: <20131217023814.24573.91649.sendpatchset@w520> (raw)
In-Reply-To: <20131217023745.24573.3660.sendpatchset@w520>
From: Magnus Damm <damm@opensource.se>
Introduce macros that allow description of one pin per line.
Compared to the other ways of doing this, using this style
we can compresses the description of each pin from 9 to 1 line.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
This patch uses RZ_PMX_GROUP and RZ_GROUPS, thanks Laurent!
drivers/pinctrl/sh-pfc/pfc-r7s72100.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
--- 0003/drivers/pinctrl/sh-pfc/pfc-r7s72100.c
+++ work/drivers/pinctrl/sh-pfc/pfc-r7s72100.c 2013-12-16 19:14:30.000000000 +0900
@@ -98,9 +98,30 @@ static struct sh_pfc_pin pinmux_pins[] =
#define RZ_PORT_PIN(bank, pin) (((bank) * 16) + (pin))
+#define __RZ_STR(pfx, hw, bank, pin, sfx) \
+ pfx##_##hw##_p##bank##_##pin####sfx
+
+#define RZ_PIN_AND_MUX(pfx, hw, bank, pin, fn) \
+static const unsigned int __RZ_STR(pfx, hw, bank, pin, _pins)[] = { \
+ RZ_PORT_PIN(bank, pin), \
+}; \
+static const unsigned int __RZ_STR(pfx, hw, bank, pin, _mux)[] = { \
+ P_##bank##_##pin##_MARK_FN##fn, \
+};
+
+#define RZ_PMX_GROUP(pfx, hw, bank, pin, fn) \
+ SH_PFC_PIN_GROUP(pfx##_##hw##_p##bank##_##pin),
+
+#define __RZ_GROUPS(x) #x
+
+#define RZ_GROUPS(pfx, hw, bank, pin, fn) \
+ __RZ_GROUPS(pfx##_##hw##_p##bank##_##pin),
+
static const struct sh_pfc_pin_group pinmux_groups[] = {
};
+static const char * const scif2_groups[] = {
+};
static const struct sh_pfc_function pinmux_functions[] = {
};
next prev parent reply other threads:[~2013-12-17 2:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-17 2:37 [PATCH 00/05 v2] pinctrl: sh-pfc: r7s72100 support V2 Magnus Damm
2013-12-17 2:37 ` [PATCH 01/05 v2] pinctrl: sh-pfc: Rework _GP_GPIO, introduce _GP_GPIO32 Magnus Damm
2013-12-17 2:38 ` [PATCH 02/05 v2] pinctrl: sh-pfc: r7s72100 base support Magnus Damm
2013-12-17 16:17 ` Laurent Pinchart
2013-12-17 21:04 ` Wolfram Sang
2013-12-17 22:29 ` Magnus Damm
2013-12-18 10:05 ` Wolfram Sang
2013-12-18 10:35 ` Magnus Damm
2013-12-17 2:38 ` Magnus Damm [this message]
2013-12-17 16:01 ` [PATCH 03/05 v2] pinctrl: sh-pfc: r7s72100 single pin macros Laurent Pinchart
2013-12-17 22:34 ` Magnus Damm
2013-12-17 2:38 ` [PATCH 04/05 v2] pinctrl: sh-pfc: r7s72100 SCIF support Magnus Damm
2013-12-17 16:08 ` Laurent Pinchart
2013-12-17 22:26 ` Magnus Damm
2013-12-31 17:29 ` Laurent Pinchart
2013-12-17 2:38 ` [PATCH 05/05 v2] pinctrl: sh-pfc: r8a7791 and r7s72100 binding docs Magnus Damm
2013-12-29 23:35 ` [PATCH 00/05 v2] pinctrl: sh-pfc: r7s72100 support V2 Laurent Pinchart
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=20131217023814.24573.91649.sendpatchset@w520 \
--to=magnus.damm@gmail.com \
--cc=horms@verge.net.au \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=wsa@the-dreams.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