diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2022-10-19 01:00:55 +0300 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2022-10-26 14:54:12 +0300 |
commit | 1177ca3a0b53bdfb1438e33a5546527de728ec10 (patch) | |
tree | 54477baeea514c477aff2ae23e6d15c7cdcb13c5 | |
parent | 2d145b8bd3eb72ed577550355430930ec1057d15 (diff) | |
download | linux-1177ca3a0b53bdfb1438e33a5546527de728ec10.tar.gz linux-1177ca3a0b53bdfb1438e33a5546527de728ec10.tar.bz2 linux-1177ca3a0b53bdfb1438e33a5546527de728ec10.zip |
pinctrl: tigerlake: 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>
-rw-r--r-- | drivers/pinctrl/intel/pinctrl-tigerlake.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-tigerlake.c b/drivers/pinctrl/intel/pinctrl-tigerlake.c index 3ddaeffc0415..431352fa2ab5 100644 --- a/drivers/pinctrl/intel/pinctrl-tigerlake.c +++ b/drivers/pinctrl/intel/pinctrl-tigerlake.c @@ -31,25 +31,25 @@ .gpio_base = (g), \ } -#define TGL_COMMUNITY(b, s, e, pl, ho, g) \ - { \ - .barno = (b), \ - .padown_offset = TGL_PAD_OWN, \ - .padcfglock_offset = (pl), \ - .hostown_offset = (ho), \ - .is_offset = TGL_GPI_IS, \ - .ie_offset = TGL_GPI_IE, \ - .pin_base = (s), \ - .npins = ((e) - (s) + 1), \ - .gpps = (g), \ - .ngpps = ARRAY_SIZE(g), \ +#define TGL_COMMUNITY(b, s, e, g, v) \ + { \ + .barno = (b), \ + .padown_offset = TGL_PAD_OWN, \ + .padcfglock_offset = TGL_##v##_PADCFGLOCK, \ + .hostown_offset = TGL_##v##_HOSTSW_OWN, \ + .is_offset = TGL_GPI_IS, \ + .ie_offset = TGL_GPI_IE, \ + .pin_base = (s), \ + .npins = ((e) - (s) + 1), \ + .gpps = (g), \ + .ngpps = ARRAY_SIZE(g), \ } #define TGL_LP_COMMUNITY(b, s, e, g) \ - TGL_COMMUNITY(b, s, e, TGL_LP_PADCFGLOCK, TGL_LP_HOSTSW_OWN, g) + TGL_COMMUNITY(b, s, e, g, LP) #define TGL_H_COMMUNITY(b, s, e, g) \ - TGL_COMMUNITY(b, s, e, TGL_H_PADCFGLOCK, TGL_H_HOSTSW_OWN, g) + TGL_COMMUNITY(b, s, e, g, H) /* Tiger Lake-LP */ static const struct pinctrl_pin_desc tgllp_pins[] = { |