All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 01/17] pinctrl: intel: Introduce INTEL_COMMUNITY_*() to unify community macros
@ 2022-12-19 12:26 Andy Shevchenko
  2022-12-19 12:26 ` [PATCH v1 02/17] pinctrl: alderlake: Replace ADL_COMMUNITY() by INTEL_COMMUNITY_GPPS() Andy Shevchenko
                   ` (16 more replies)
  0 siblings, 17 replies; 21+ messages in thread
From: Andy Shevchenko @ 2022-12-19 12:26 UTC (permalink / raw)
  To: Andy Shevchenko, linux-gpio, linux-kernel
  Cc: Mika Westerberg, Andy Shevchenko, Linus Walleij

Now it becomes visible that we can deduplicate SoC specific
*_COMMUNITY() macros across the Intel pin control drivers.
For that, introduce a common INTEL_COMMUNITY_GPPS() and
INTEL_COMMUNITY_SIZE() macros in the pinctrl-intel.h.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/intel/pinctrl-intel.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/pinctrl/intel/pinctrl-intel.h b/drivers/pinctrl/intel/pinctrl-intel.h
index 65628423bf63..b0f2be4c1fd1 100644
--- a/drivers/pinctrl/intel/pinctrl-intel.h
+++ b/drivers/pinctrl/intel/pinctrl-intel.h
@@ -143,6 +143,28 @@ struct intel_community {
 #define PINCTRL_FEATURE_BLINK		BIT(4)
 #define PINCTRL_FEATURE_EXP		BIT(5)
 
+#define __INTEL_COMMUNITY(b, s, e, g, n, gs, gn, soc)		\
+	{							\
+		.barno = (b),					\
+		.padown_offset = soc ## _PAD_OWN,		\
+		.padcfglock_offset = soc ## _PADCFGLOCK,	\
+		.hostown_offset = soc ## _HOSTSW_OWN,		\
+		.is_offset = soc ## _GPI_IS,			\
+		.ie_offset = soc ## _GPI_IE,			\
+		.gpp_size = (gs),				\
+		.gpp_num_padown_regs = (gn),			\
+		.pin_base = (s),				\
+		.npins = ((e) - (s) + 1),			\
+		.gpps = (g),					\
+		.ngpps = (n),					\
+	}
+
+#define INTEL_COMMUNITY_GPPS(b, s, e, g, soc)			\
+	__INTEL_COMMUNITY(b, s, e, g, ARRAY_SIZE(g), 0, 0, soc)
+
+#define INTEL_COMMUNITY_SIZE(b, s, e, gs, gn, soc)		\
+	__INTEL_COMMUNITY(b, s, e, NULL, 0, gs, gn, soc)
+
 /**
  * PIN_GROUP - Declare a pin group
  * @n: Name of the group
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2022-12-28  6:50 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-19 12:26 [PATCH v1 01/17] pinctrl: intel: Introduce INTEL_COMMUNITY_*() to unify community macros Andy Shevchenko
2022-12-19 12:26 ` [PATCH v1 02/17] pinctrl: alderlake: Replace ADL_COMMUNITY() by INTEL_COMMUNITY_GPPS() Andy Shevchenko
2022-12-19 12:26 ` [PATCH v1 03/17] pinctrl: broxton: Replace BXT_COMMUNITY() by INTEL_COMMUNITY_SIZE() Andy Shevchenko
2022-12-19 12:26 ` [PATCH v1 04/17] pinctrl: cannonlake: Replace CNL_COMMUNITY() by INTEL_COMMUNITY_GPPS() Andy Shevchenko
2022-12-19 12:26 ` [PATCH v1 05/17] pinctrl: cedarfork: Replace CDF_COMMUNITY() " Andy Shevchenko
2022-12-19 12:26 ` [PATCH v1 06/17] pinctrl: denverton: Replace DNV_COMMUNITY() " Andy Shevchenko
2022-12-19 12:26 ` [PATCH v1 07/17] pinctrl: elkhartlake: Replace EHL_COMMUNITY() " Andy Shevchenko
2022-12-19 12:26 ` [PATCH v1 08/17] pinctrl: emmitsburg: Replace EBG_COMMUNITY() " Andy Shevchenko
2022-12-19 12:26 ` [PATCH v1 09/17] pinctrl: geminilake: Replace GLK_COMMUNITY() by INTEL_COMMUNITY_SIZE() Andy Shevchenko
2022-12-19 12:26 ` [PATCH v1 10/17] pinctrl: icelake: Replace ICL_COMMUNITY() by INTEL_COMMUNITY_GPPS() Andy Shevchenko
2022-12-19 12:26 ` [PATCH v1 11/17] pinctrl: jasperlake: Replace JSL_COMMUNITY() " Andy Shevchenko
2022-12-19 12:26 ` [PATCH v1 12/17] pinctrl: lakefield: Replace LKF_COMMUNITY() " Andy Shevchenko
2022-12-19 12:26 ` [PATCH v1 13/17] pinctrl: lewisburg: Replace LBG_COMMUNITY() by INTEL_COMMUNITY_SIZE() Andy Shevchenko
2022-12-19 12:26 ` [PATCH v1 14/17] pinctrl: meteorlake: Replace MTL_COMMUNITY() by INTEL_COMMUNITY_GPPS() Andy Shevchenko
2022-12-19 12:26 ` [PATCH v1 15/17] pinctrl: tigerlake: Replace TGL_COMMUNITY() " Andy Shevchenko
2022-12-19 12:26 ` [PATCH v1 16/17] pinctrl: sunrisepoint: Replace SPT_COMMUNITY() by INTEL_COMMUNITY_*() Andy Shevchenko
2022-12-19 12:26 ` [PATCH v1 17/17] pinctrl: intel: Always use gpp_num_padown_regs in the main driver Andy Shevchenko
2022-12-19 14:32 ` [PATCH v1 01/17] pinctrl: intel: Introduce INTEL_COMMUNITY_*() to unify community macros Mika Westerberg
2022-12-19 14:38   ` Andy Shevchenko
2022-12-27 19:19   ` Andy Shevchenko
2022-12-28  6:50     ` Mika Westerberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.