[v1,1/5] pinctrl: alderlake: Deduplicate COMMUNITY macro code
Commit Message
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-alderlake.c | 40 +++++++++--------------
1 file changed, 16 insertions(+), 24 deletions(-)
Comments
On Wed, Oct 19, 2022 at 01:34:23AM +0300, Andy Shevchenko wrote:
> Define a common COMUNITY macro and supply a variant to it.
^^^^^^^^
COMMUNITY
(ditto for other commit messages)
> This removes some verbosity in macros.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
On Sun, Oct 23, 2022 at 09:50:15AM +0300, Mika Westerberg wrote:
> On Wed, Oct 19, 2022 at 01:34:23AM +0300, Andy Shevchenko wrote:
> > Define a common COMUNITY macro and supply a variant to it.
> ^^^^^^^^
> COMMUNITY
>
> (ditto for other commit messages)
>
> > This removes some verbosity in macros.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
All with mentioned typo fix and added tag are pushed to my review and
testing queue, thanks!
@@ -34,33 +34,25 @@
.gpio_base = (g), \
}
-#define ADL_N_COMMUNITY(b, s, e, g) \
- { \
- .barno = (b), \
- .padown_offset = ADL_N_PAD_OWN, \
- .padcfglock_offset = ADL_N_PADCFGLOCK, \
- .hostown_offset = ADL_N_HOSTSW_OWN, \
- .is_offset = ADL_N_GPI_IS, \
- .ie_offset = ADL_N_GPI_IE, \
- .pin_base = (s), \
- .npins = ((e) - (s) + 1), \
- .gpps = (g), \
- .ngpps = ARRAY_SIZE(g), \
+#define ADL_COMMUNITY(b, s, e, g, v) \
+ { \
+ .barno = (b), \
+ .padown_offset = ADL_##v##_PAD_OWN, \
+ .padcfglock_offset = ADL_##v##_PADCFGLOCK, \
+ .hostown_offset = ADL_##v##_HOSTSW_OWN, \
+ .is_offset = ADL_##v##_GPI_IS, \
+ .ie_offset = ADL_##v##_GPI_IE, \
+ .pin_base = (s), \
+ .npins = ((e) - (s) + 1), \
+ .gpps = (g), \
+ .ngpps = ARRAY_SIZE(g), \
}
+#define ADL_N_COMMUNITY(b, s, e, g) \
+ ADL_COMMUNITY(b, s, e, g, N)
+
#define ADL_S_COMMUNITY(b, s, e, g) \
- { \
- .barno = (b), \
- .padown_offset = ADL_S_PAD_OWN, \
- .padcfglock_offset = ADL_S_PADCFGLOCK, \
- .hostown_offset = ADL_S_HOSTSW_OWN, \
- .is_offset = ADL_S_GPI_IS, \
- .ie_offset = ADL_S_GPI_IE, \
- .pin_base = (s), \
- .npins = ((e) - (s) + 1), \
- .gpps = (g), \
- .ngpps = ARRAY_SIZE(g), \
- }
+ ADL_COMMUNITY(b, s, e, g, S)
/* Alder Lake-N */
static const struct pinctrl_pin_desc adln_pins[] = {