summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2022-10-19 01:00:55 +0300
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2022-10-26 14:54:11 +0300
commitde1fabef28e09dedfc1fb6b75a23f5851ce78658 (patch)
tree9ebe1927c66932f7bb2e154f578a6284f919808b /drivers/pinctrl
parente5530adc17a79f2a93e8b35e0ce673fc33f5f663 (diff)
downloadlinux-de1fabef28e09dedfc1fb6b75a23f5851ce78658.tar.bz2
pinctrl: alderlake: Deduplicate COMMUNITY macro code
Define a common COMMUNITY macro and supply a variant to it. 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>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/intel/pinctrl-alderlake.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-alderlake.c b/drivers/pinctrl/intel/pinctrl-alderlake.c
index 62dbd1e67513..427febe09b69 100644
--- a/drivers/pinctrl/intel/pinctrl-alderlake.c
+++ b/drivers/pinctrl/intel/pinctrl-alderlake.c
@@ -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[] = {