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

pinctrl: sunrisepoint: 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 -16
+16 -16
drivers/pinctrl/intel/pinctrl-sunrisepoint.c
··· 22 22 #define SPT_GPI_IS 0x100 23 23 #define SPT_GPI_IE 0x120 24 24 25 - #define SPT_COMMUNITY(b, s, e, pl, gs, gn, g, n) \ 26 - { \ 27 - .barno = (b), \ 28 - .padown_offset = SPT_PAD_OWN, \ 29 - .padcfglock_offset = (pl), \ 30 - .hostown_offset = SPT_HOSTSW_OWN, \ 31 - .is_offset = SPT_GPI_IS, \ 32 - .ie_offset = SPT_GPI_IE, \ 33 - .gpp_size = (gs), \ 34 - .gpp_num_padown_regs = (gn), \ 35 - .pin_base = (s), \ 36 - .npins = ((e) - (s) + 1), \ 37 - .gpps = (g), \ 38 - .ngpps = (n), \ 25 + #define SPT_COMMUNITY(b, s, e, g, n, v, gs, gn) \ 26 + { \ 27 + .barno = (b), \ 28 + .padown_offset = SPT_PAD_OWN, \ 29 + .padcfglock_offset = SPT_##v##_PADCFGLOCK, \ 30 + .hostown_offset = SPT_HOSTSW_OWN, \ 31 + .is_offset = SPT_GPI_IS, \ 32 + .ie_offset = SPT_GPI_IE, \ 33 + .gpp_size = (gs), \ 34 + .gpp_num_padown_regs = (gn), \ 35 + .pin_base = (s), \ 36 + .npins = ((e) - (s) + 1), \ 37 + .gpps = (g), \ 38 + .ngpps = (n), \ 39 39 } 40 40 41 41 #define SPT_LP_COMMUNITY(b, s, e) \ 42 - SPT_COMMUNITY(b, s, e, SPT_LP_PADCFGLOCK, 24, 4, NULL, 0) 42 + SPT_COMMUNITY(b, s, e, NULL, 0, LP, 24, 4) 43 43 44 44 #define SPT_H_GPP(r, s, e, g) \ 45 45 { \ ··· 50 50 } 51 51 52 52 #define SPT_H_COMMUNITY(b, s, e, g) \ 53 - SPT_COMMUNITY(b, s, e, SPT_H_PADCFGLOCK, 0, 0, g, ARRAY_SIZE(g)) 53 + SPT_COMMUNITY(b, s, e, g, ARRAY_SIZE(g), H, 0, 0) 54 54 55 55 /* Sunrisepoint-LP */ 56 56 static const struct pinctrl_pin_desc sptlp_pins[] = {