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 2/5] pinctrl: cannonlake: Deduplicate COMMUNITY macro code
Date: Wed, 19 Oct 2022 01:34:24 +0300 [thread overview]
Message-ID: <20221018223427.43579-2-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-cannonlake.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/pinctrl/intel/pinctrl-cannonlake.c b/drivers/pinctrl/intel/pinctrl-cannonlake.c
index 70e35dc7dd19..3af169ef4a06 100644
--- a/drivers/pinctrl/intel/pinctrl-cannonlake.c
+++ b/drivers/pinctrl/intel/pinctrl-cannonlake.c
@@ -30,12 +30,12 @@
.gpio_base = (g), \
}
-#define CNL_COMMUNITY(b, s, e, ho, g) \
+#define CNL_COMMUNITY(b, s, e, g, v) \
{ \
.barno = (b), \
.padown_offset = CNL_PAD_OWN, \
.padcfglock_offset = CNL_PADCFGLOCK, \
- .hostown_offset = (ho), \
+ .hostown_offset = CNL_##v##_HOSTSW_OWN, \
.is_offset = CNL_GPI_IS, \
.ie_offset = CNL_GPI_IE, \
.pin_base = (s), \
@@ -45,10 +45,10 @@
}
#define CNL_LP_COMMUNITY(b, s, e, g) \
- CNL_COMMUNITY(b, s, e, CNL_LP_HOSTSW_OWN, g)
+ CNL_COMMUNITY(b, s, e, g, LP)
#define CNL_H_COMMUNITY(b, s, e, g) \
- CNL_COMMUNITY(b, s, e, CNL_H_HOSTSW_OWN, g)
+ CNL_COMMUNITY(b, s, e, g, H)
/* Cannon Lake-H */
static const struct pinctrl_pin_desc cnlh_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 ` Andy Shevchenko [this message]
2022-10-18 22:34 ` [PATCH v1 3/5] pinctrl: icelake: " Andy Shevchenko
2022-10-18 22:34 ` [PATCH v1 4/5] pinctrl: sunrisepoint: " Andy Shevchenko
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-2-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).