From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
Andy Shevchenko <andy@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH v1 4/5] pinctrl: sunrisepoint: Deduplicate COMMUNITY macro code
Date: Wed, 19 Oct 2022 01:34:26 +0300 [thread overview]
Message-ID: <20221018223427.43579-4-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20221018223427.43579-1-andriy.shevchenko@linux.intel.com>
Define a common COMUNITY macro and supply a variant to it.
This removes some verbosity in macros.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/pinctrl/intel/pinctrl-sunrisepoint.c | 32 ++++++++++----------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/pinctrl/intel/pinctrl-sunrisepoint.c b/drivers/pinctrl/intel/pinctrl-sunrisepoint.c
index 026067e18349..be5bb0f4b1dc 100644
--- a/drivers/pinctrl/intel/pinctrl-sunrisepoint.c
+++ b/drivers/pinctrl/intel/pinctrl-sunrisepoint.c
@@ -22,24 +22,24 @@
#define SPT_GPI_IS 0x100
#define SPT_GPI_IE 0x120
-#define SPT_COMMUNITY(b, s, e, pl, gs, gn, g, n) \
- { \
- .barno = (b), \
- .padown_offset = SPT_PAD_OWN, \
- .padcfglock_offset = (pl), \
- .hostown_offset = SPT_HOSTSW_OWN, \
- .is_offset = SPT_GPI_IS, \
- .ie_offset = SPT_GPI_IE, \
- .gpp_size = (gs), \
- .gpp_num_padown_regs = (gn), \
- .pin_base = (s), \
- .npins = ((e) - (s) + 1), \
- .gpps = (g), \
- .ngpps = (n), \
+#define SPT_COMMUNITY(b, s, e, g, n, v, gs, gn) \
+ { \
+ .barno = (b), \
+ .padown_offset = SPT_PAD_OWN, \
+ .padcfglock_offset = SPT_##v##_PADCFGLOCK, \
+ .hostown_offset = SPT_HOSTSW_OWN, \
+ .is_offset = SPT_GPI_IS, \
+ .ie_offset = SPT_GPI_IE, \
+ .gpp_size = (gs), \
+ .gpp_num_padown_regs = (gn), \
+ .pin_base = (s), \
+ .npins = ((e) - (s) + 1), \
+ .gpps = (g), \
+ .ngpps = (n), \
}
#define SPT_LP_COMMUNITY(b, s, e) \
- SPT_COMMUNITY(b, s, e, SPT_LP_PADCFGLOCK, 24, 4, NULL, 0)
+ SPT_COMMUNITY(b, s, e, NULL, 0, LP, 24, 4)
#define SPT_H_GPP(r, s, e, g) \
{ \
@@ -50,7 +50,7 @@
}
#define SPT_H_COMMUNITY(b, s, e, g) \
- SPT_COMMUNITY(b, s, e, SPT_H_PADCFGLOCK, 0, 0, g, ARRAY_SIZE(g))
+ SPT_COMMUNITY(b, s, e, g, ARRAY_SIZE(g), H, 0, 0)
/* Sunrisepoint-LP */
static const struct pinctrl_pin_desc sptlp_pins[] = {
--
2.35.1
next prev parent reply other threads:[~2022-10-18 22:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-18 22:34 [PATCH v1 1/5] pinctrl: alderlake: Deduplicate COMMUNITY macro code Andy Shevchenko
2022-10-18 22:34 ` [PATCH v1 2/5] pinctrl: cannonlake: " Andy Shevchenko
2022-10-18 22:34 ` [PATCH v1 3/5] pinctrl: icelake: " Andy Shevchenko
2022-10-18 22:34 ` Andy Shevchenko [this message]
2022-10-18 22:34 ` [PATCH v1 5/5] pinctrl: tigerlake: " Andy Shevchenko
2022-10-23 6:50 ` [PATCH v1 1/5] pinctrl: alderlake: " Mika Westerberg
2022-10-26 11:56 ` Andy Shevchenko
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=20221018223427.43579-4-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=andy@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.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).