LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jacopo Mondi <jacopo+renesas@jmondi.org>
To: geert+renesas@glider.be, laurent.pinchart@ideasonboard.com,
horms@verge.net.au
Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>,
linus.walleij@linaro.org, linux-renesas-soc@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] pinctrl: sh-pfc: Introduce VIN_DATA_PIN_GROUP_VER
Date: Mon, 29 Oct 2018 19:13:43 +0100 [thread overview]
Message-ID: <1540836824-4636-2-git-send-email-jacopo+renesas@jmondi.org> (raw)
In-Reply-To: <1540836824-4636-1-git-send-email-jacopo+renesas@jmondi.org>
VIN data groups may appear on different sets of pins, usually named
"vinX_data_[a|b]". The existing VIN_DATA_PIN_GROUP() does not support appending
the 'a' or 'b' suffix, leading to the definition of groups names not consistent
with the ones defined using SH_PFC_PIN_GROUP() macro.
Fix this by adding a macro that supports appending suffixes when required.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
---
drivers/pinctrl/sh-pfc/sh_pfc.h | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h
index 458ae0a..2930e9a 100644
--- a/drivers/pinctrl/sh-pfc/sh_pfc.h
+++ b/drivers/pinctrl/sh-pfc/sh_pfc.h
@@ -54,17 +54,27 @@ struct sh_pfc_pin_group {
/*
* Using union vin_data saves memory occupied by the VIN data pins.
- * VIN_DATA_PIN_GROUP() is a macro used to describe the VIN pin groups
- * in this case.
+ *
+ * VIN_DATA_PIN_GROUP() is a macro used to describe the VIN pin groups,
+ * while VIN_DATA_PIN_GROUP_VER() is used when the same pin group can appear
+ * on different sets of pins.
*/
-#define VIN_DATA_PIN_GROUP(n, s) \
- { \
- .name = #n#s, \
+#define __VIN_DATA_PIN_GROUP(n, s) \
.pins = n##_pins.data##s, \
.mux = n##_mux.data##s, \
.nr_pins = ARRAY_SIZE(n##_pins.data##s), \
}
+#define VIN_DATA_PIN_GROUP(n, s) \
+ { \
+ .name = #n#s, \
+ __VIN_DATA_PIN_GROUP(n, s)
+
+#define VIN_DATA_PIN_GROUP_VER(n, v, s) \
+ { \
+ .name = #n#s"_"#v, \
+ __VIN_DATA_PIN_GROUP(n##_##v, s)
+
union vin_data {
unsigned int data24[24];
unsigned int data20[20];
--
2.7.4
next prev parent reply other threads:[~2018-10-29 18:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-29 18:13 [PATCH 0/2] pinctrl: sh-pfc: r8a77965: Add VIN4 and VIN5 Jacopo Mondi
2018-10-29 18:13 ` Jacopo Mondi [this message]
2018-10-30 3:46 ` [PATCH 1/2] pinctrl: sh-pfc: Introduce VIN_DATA_PIN_GROUP_VER Ulrich Hecht
2018-10-30 7:34 ` jacopo mondi
2018-10-29 18:13 ` [PATCH 2/2] pinctrl: sh-pfc: r8a77965: Add VIN[4|5] groups/functions Jacopo Mondi
2018-10-30 3:46 ` Ulrich Hecht
2018-11-05 17:19 ` [PATCH 0/2] pinctrl: sh-pfc: r8a77965: Add VIN4 and VIN5 Geert Uytterhoeven
2018-11-06 9:07 ` jacopo mondi
2018-11-06 9:24 ` Geert Uytterhoeven
2018-11-06 9:31 ` jacopo mondi
2018-11-07 8:39 ` Geert Uytterhoeven
2018-11-07 9:35 ` jacopo mondi
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=1540836824-4636-2-git-send-email-jacopo+renesas@jmondi.org \
--to=jacopo+renesas@jmondi.org \
--cc=geert+renesas@glider.be \
--cc=horms@verge.net.au \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--subject='Re: [PATCH 1/2] pinctrl: sh-pfc: Introduce VIN_DATA_PIN_GROUP_VER' \
/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
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).