Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+16 -24
+16 -24
drivers/pinctrl/intel/pinctrl-alderlake.c
··· 34 34 .gpio_base = (g), \ 35 35 } 36 36 37 - #define ADL_N_COMMUNITY(b, s, e, g) \ 38 - { \ 39 - .barno = (b), \ 40 - .padown_offset = ADL_N_PAD_OWN, \ 41 - .padcfglock_offset = ADL_N_PADCFGLOCK, \ 42 - .hostown_offset = ADL_N_HOSTSW_OWN, \ 43 - .is_offset = ADL_N_GPI_IS, \ 44 - .ie_offset = ADL_N_GPI_IE, \ 45 - .pin_base = (s), \ 46 - .npins = ((e) - (s) + 1), \ 47 - .gpps = (g), \ 48 - .ngpps = ARRAY_SIZE(g), \ 37 + #define ADL_COMMUNITY(b, s, e, g, v) \ 38 + { \ 39 + .barno = (b), \ 40 + .padown_offset = ADL_##v##_PAD_OWN, \ 41 + .padcfglock_offset = ADL_##v##_PADCFGLOCK, \ 42 + .hostown_offset = ADL_##v##_HOSTSW_OWN, \ 43 + .is_offset = ADL_##v##_GPI_IS, \ 44 + .ie_offset = ADL_##v##_GPI_IE, \ 45 + .pin_base = (s), \ 46 + .npins = ((e) - (s) + 1), \ 47 + .gpps = (g), \ 48 + .ngpps = ARRAY_SIZE(g), \ 49 49 } 50 50 51 + #define ADL_N_COMMUNITY(b, s, e, g) \ 52 + ADL_COMMUNITY(b, s, e, g, N) 53 + 51 54 #define ADL_S_COMMUNITY(b, s, e, g) \ 52 - { \ 53 - .barno = (b), \ 54 - .padown_offset = ADL_S_PAD_OWN, \ 55 - .padcfglock_offset = ADL_S_PADCFGLOCK, \ 56 - .hostown_offset = ADL_S_HOSTSW_OWN, \ 57 - .is_offset = ADL_S_GPI_IS, \ 58 - .ie_offset = ADL_S_GPI_IE, \ 59 - .pin_base = (s), \ 60 - .npins = ((e) - (s) + 1), \ 61 - .gpps = (g), \ 62 - .ngpps = ARRAY_SIZE(g), \ 63 - } 55 + ADL_COMMUNITY(b, s, e, g, S) 64 56 65 57 /* Alder Lake-N */ 66 58 static const struct pinctrl_pin_desc adln_pins[] = {