[v2,1/5] pinctrl: actions: define constructor generic to Actions Semi SoC's

Message ID 20180729182551.19383-2-sravanhome@gmail.com
State New
Headers show
Series
  • Add Actions Semi S700 pinctrl support
Related show

Commit Message

Saravanan Sekar July 29, 2018, 6:25 p.m.
Move generic defines common to the Owl family out of S900 driver.

Signed-off-by: Parthiban Nallathambi <pn@denx.de>
Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
---
 drivers/pinctrl/actions/pinctrl-owl.h  | 136 ++++++++++++++++++++++--
 drivers/pinctrl/actions/pinctrl-s900.c | 139 ++-----------------------
 2 files changed, 136 insertions(+), 139 deletions(-)

Comments

kbuild test robot July 29, 2018, 7:06 p.m. | #1
Hi Saravanan,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on pinctrl/devel]
[also build test ERROR on next-20180727]
[cannot apply to v4.18-rc6]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Saravanan-Sekar/Add-Actions-Semi-S700-pinctrl-support/20180730-022827
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 8.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=8.1.0 make.cross ARCH=ia64 

Note: the linux-review/Saravanan-Sekar/Add-Actions-Semi-S700-pinctrl-support/20180730-022827 HEAD edc8b81de011f2413aa90b738a8fad302e281785 builds fine.
      It only hurts bisectibility.

All errors (new ones prefixed by >>):

   drivers/pinctrl/actions/pinctrl-owl.c: In function 'owl_pad_pinconf_arg2val':
   drivers/pinctrl/actions/pinctrl-owl.c:255:10: error: 'OWL_PINCONF_PULL_HOLD' undeclared (first use in this function); did you mean 'OWL_PINCONF_DRV_12MA'?
      *arg = OWL_PINCONF_PULL_HOLD;
             ^~~~~~~~~~~~~~~~~~~~~
             OWL_PINCONF_DRV_12MA
   drivers/pinctrl/actions/pinctrl-owl.c:255:10: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/pinctrl/actions/pinctrl-owl.c:258:10: error: 'OWL_PINCONF_PULL_HIZ' undeclared (first use in this function); did you mean 'OWL_PINCONF_DRV_8MA'?
      *arg = OWL_PINCONF_PULL_HIZ;
             ^~~~~~~~~~~~~~~~~~~~
             OWL_PINCONF_DRV_8MA
>> drivers/pinctrl/actions/pinctrl-owl.c:261:10: error: 'OWL_PINCONF_PULL_DOWN' undeclared (first use in this function); did you mean 'OWL_PINCONF_SLEW_SLOW'?
      *arg = OWL_PINCONF_PULL_DOWN;
             ^~~~~~~~~~~~~~~~~~~~~
             OWL_PINCONF_SLEW_SLOW
>> drivers/pinctrl/actions/pinctrl-owl.c:264:10: error: 'OWL_PINCONF_PULL_UP' undeclared (first use in this function); did you mean 'OWL_PINCONF_DRV_8MA'?
      *arg = OWL_PINCONF_PULL_UP;
             ^~~~~~~~~~~~~~~~~~~
             OWL_PINCONF_DRV_8MA
   drivers/pinctrl/actions/pinctrl-owl.c: In function 'owl_pad_pinconf_val2arg':
   drivers/pinctrl/actions/pinctrl-owl.c:282:18: error: 'OWL_PINCONF_PULL_HOLD' undeclared (first use in this function); did you mean 'OWL_PINCONF_DRV_12MA'?
      *arg = *arg == OWL_PINCONF_PULL_HOLD;
                     ^~~~~~~~~~~~~~~~~~~~~
                     OWL_PINCONF_DRV_12MA
   drivers/pinctrl/actions/pinctrl-owl.c:285:18: error: 'OWL_PINCONF_PULL_HIZ' undeclared (first use in this function); did you mean 'OWL_PINCONF_DRV_8MA'?
      *arg = *arg == OWL_PINCONF_PULL_HIZ;
                     ^~~~~~~~~~~~~~~~~~~~
                     OWL_PINCONF_DRV_8MA
   drivers/pinctrl/actions/pinctrl-owl.c:288:18: error: 'OWL_PINCONF_PULL_DOWN' undeclared (first use in this function); did you mean 'OWL_PINCONF_SLEW_SLOW'?
      *arg = *arg == OWL_PINCONF_PULL_DOWN;
                     ^~~~~~~~~~~~~~~~~~~~~
                     OWL_PINCONF_SLEW_SLOW
   drivers/pinctrl/actions/pinctrl-owl.c:291:18: error: 'OWL_PINCONF_PULL_UP' undeclared (first use in this function); did you mean 'OWL_PINCONF_DRV_8MA'?
      *arg = *arg == OWL_PINCONF_PULL_UP;
                     ^~~~~~~~~~~~~~~~~~~
                     OWL_PINCONF_DRV_8MA

vim +258 drivers/pinctrl/actions/pinctrl-owl.c

2242ddfb Manivannan Sadhasivam 2018-04-04  248  
2242ddfb Manivannan Sadhasivam 2018-04-04  249  static int owl_pad_pinconf_arg2val(const struct owl_padinfo *info,
2242ddfb Manivannan Sadhasivam 2018-04-04  250  				unsigned int param,
2242ddfb Manivannan Sadhasivam 2018-04-04  251  				u32 *arg)
2242ddfb Manivannan Sadhasivam 2018-04-04  252  {
2242ddfb Manivannan Sadhasivam 2018-04-04  253  	switch (param) {
2242ddfb Manivannan Sadhasivam 2018-04-04  254  	case PIN_CONFIG_BIAS_BUS_HOLD:
2242ddfb Manivannan Sadhasivam 2018-04-04 @255  		*arg = OWL_PINCONF_PULL_HOLD;
2242ddfb Manivannan Sadhasivam 2018-04-04  256  		break;
2242ddfb Manivannan Sadhasivam 2018-04-04  257  	case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
2242ddfb Manivannan Sadhasivam 2018-04-04 @258  		*arg = OWL_PINCONF_PULL_HIZ;
2242ddfb Manivannan Sadhasivam 2018-04-04  259  		break;
2242ddfb Manivannan Sadhasivam 2018-04-04  260  	case PIN_CONFIG_BIAS_PULL_DOWN:
2242ddfb Manivannan Sadhasivam 2018-04-04 @261  		*arg = OWL_PINCONF_PULL_DOWN;
2242ddfb Manivannan Sadhasivam 2018-04-04  262  		break;
2242ddfb Manivannan Sadhasivam 2018-04-04  263  	case PIN_CONFIG_BIAS_PULL_UP:
2242ddfb Manivannan Sadhasivam 2018-04-04 @264  		*arg = OWL_PINCONF_PULL_UP;
2242ddfb Manivannan Sadhasivam 2018-04-04  265  		break;
2242ddfb Manivannan Sadhasivam 2018-04-04  266  	case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
2242ddfb Manivannan Sadhasivam 2018-04-04  267  		*arg = (*arg >= 1 ? 1 : 0);
2242ddfb Manivannan Sadhasivam 2018-04-04  268  		break;
2242ddfb Manivannan Sadhasivam 2018-04-04  269  	default:
2242ddfb Manivannan Sadhasivam 2018-04-04  270  		return -ENOTSUPP;
2242ddfb Manivannan Sadhasivam 2018-04-04  271  	}
2242ddfb Manivannan Sadhasivam 2018-04-04  272  
2242ddfb Manivannan Sadhasivam 2018-04-04  273  	return 0;
2242ddfb Manivannan Sadhasivam 2018-04-04  274  }
2242ddfb Manivannan Sadhasivam 2018-04-04  275  

:::::: The code at line 258 was first introduced by commit
:::::: 2242ddfbf4d699b58d12467bbebae167d7563700 pinctrl: actions: Add Actions S900 pinctrl driver

:::::: TO: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
:::::: CC: Linus Walleij <linus.walleij@linaro.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kbuild test robot July 29, 2018, 7:12 p.m. | #2
Hi Saravanan,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on pinctrl/devel]
[also build test ERROR on next-20180727]
[cannot apply to v4.18-rc6]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Saravanan-Sekar/Add-Actions-Semi-S700-pinctrl-support/20180730-022827
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=sparc64 

Note: the linux-review/Saravanan-Sekar/Add-Actions-Semi-S700-pinctrl-support/20180730-022827 HEAD edc8b81de011f2413aa90b738a8fad302e281785 builds fine.
      It only hurts bisectibility.

All errors (new ones prefixed by >>):

   drivers/pinctrl/actions/pinctrl-owl.c: In function 'owl_pad_pinconf_arg2val':
>> drivers/pinctrl/actions/pinctrl-owl.c:255:10: error: 'OWL_PINCONF_PULL_HOLD' undeclared (first use in this function); did you mean 'OWL_PINCONF_DRV_12MA'?
      *arg = OWL_PINCONF_PULL_HOLD;
             ^~~~~~~~~~~~~~~~~~~~~
             OWL_PINCONF_DRV_12MA
   drivers/pinctrl/actions/pinctrl-owl.c:255:10: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/pinctrl/actions/pinctrl-owl.c:258:10: error: 'OWL_PINCONF_PULL_HIZ' undeclared (first use in this function); did you mean 'OWL_PINCONF_PULL_HOLD'?
      *arg = OWL_PINCONF_PULL_HIZ;
             ^~~~~~~~~~~~~~~~~~~~
             OWL_PINCONF_PULL_HOLD
>> drivers/pinctrl/actions/pinctrl-owl.c:261:10: error: 'OWL_PINCONF_PULL_DOWN' undeclared (first use in this function); did you mean 'OWL_PINCONF_PULL_HOLD'?
      *arg = OWL_PINCONF_PULL_DOWN;
             ^~~~~~~~~~~~~~~~~~~~~
             OWL_PINCONF_PULL_HOLD
>> drivers/pinctrl/actions/pinctrl-owl.c:264:10: error: 'OWL_PINCONF_PULL_UP' undeclared (first use in this function); did you mean 'OWL_PINCONF_PULL_HIZ'?
      *arg = OWL_PINCONF_PULL_UP;
             ^~~~~~~~~~~~~~~~~~~
             OWL_PINCONF_PULL_HIZ
   drivers/pinctrl/actions/pinctrl-owl.c: In function 'owl_pad_pinconf_val2arg':
   drivers/pinctrl/actions/pinctrl-owl.c:282:18: error: 'OWL_PINCONF_PULL_HOLD' undeclared (first use in this function); did you mean 'OWL_PINCONF_DRV_12MA'?
      *arg = *arg == OWL_PINCONF_PULL_HOLD;
                     ^~~~~~~~~~~~~~~~~~~~~
                     OWL_PINCONF_DRV_12MA
   drivers/pinctrl/actions/pinctrl-owl.c:285:18: error: 'OWL_PINCONF_PULL_HIZ' undeclared (first use in this function); did you mean 'OWL_PINCONF_PULL_HOLD'?
      *arg = *arg == OWL_PINCONF_PULL_HIZ;
                     ^~~~~~~~~~~~~~~~~~~~
                     OWL_PINCONF_PULL_HOLD
   drivers/pinctrl/actions/pinctrl-owl.c:288:18: error: 'OWL_PINCONF_PULL_DOWN' undeclared (first use in this function); did you mean 'OWL_PINCONF_PULL_HOLD'?
      *arg = *arg == OWL_PINCONF_PULL_DOWN;
                     ^~~~~~~~~~~~~~~~~~~~~
                     OWL_PINCONF_PULL_HOLD
   drivers/pinctrl/actions/pinctrl-owl.c:291:18: error: 'OWL_PINCONF_PULL_UP' undeclared (first use in this function); did you mean 'OWL_PINCONF_PULL_HIZ'?
      *arg = *arg == OWL_PINCONF_PULL_UP;
                     ^~~~~~~~~~~~~~~~~~~
                     OWL_PINCONF_PULL_HIZ

vim +255 drivers/pinctrl/actions/pinctrl-owl.c

2242ddfb Manivannan Sadhasivam 2018-04-04  248  
2242ddfb Manivannan Sadhasivam 2018-04-04  249  static int owl_pad_pinconf_arg2val(const struct owl_padinfo *info,
2242ddfb Manivannan Sadhasivam 2018-04-04  250  				unsigned int param,
2242ddfb Manivannan Sadhasivam 2018-04-04  251  				u32 *arg)
2242ddfb Manivannan Sadhasivam 2018-04-04  252  {
2242ddfb Manivannan Sadhasivam 2018-04-04  253  	switch (param) {
2242ddfb Manivannan Sadhasivam 2018-04-04  254  	case PIN_CONFIG_BIAS_BUS_HOLD:
2242ddfb Manivannan Sadhasivam 2018-04-04 @255  		*arg = OWL_PINCONF_PULL_HOLD;
2242ddfb Manivannan Sadhasivam 2018-04-04  256  		break;
2242ddfb Manivannan Sadhasivam 2018-04-04  257  	case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
2242ddfb Manivannan Sadhasivam 2018-04-04 @258  		*arg = OWL_PINCONF_PULL_HIZ;
2242ddfb Manivannan Sadhasivam 2018-04-04  259  		break;
2242ddfb Manivannan Sadhasivam 2018-04-04  260  	case PIN_CONFIG_BIAS_PULL_DOWN:
2242ddfb Manivannan Sadhasivam 2018-04-04 @261  		*arg = OWL_PINCONF_PULL_DOWN;
2242ddfb Manivannan Sadhasivam 2018-04-04  262  		break;
2242ddfb Manivannan Sadhasivam 2018-04-04  263  	case PIN_CONFIG_BIAS_PULL_UP:
2242ddfb Manivannan Sadhasivam 2018-04-04 @264  		*arg = OWL_PINCONF_PULL_UP;
2242ddfb Manivannan Sadhasivam 2018-04-04  265  		break;
2242ddfb Manivannan Sadhasivam 2018-04-04  266  	case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
2242ddfb Manivannan Sadhasivam 2018-04-04  267  		*arg = (*arg >= 1 ? 1 : 0);
2242ddfb Manivannan Sadhasivam 2018-04-04  268  		break;
2242ddfb Manivannan Sadhasivam 2018-04-04  269  	default:
2242ddfb Manivannan Sadhasivam 2018-04-04  270  		return -ENOTSUPP;
2242ddfb Manivannan Sadhasivam 2018-04-04  271  	}
2242ddfb Manivannan Sadhasivam 2018-04-04  272  
2242ddfb Manivannan Sadhasivam 2018-04-04  273  	return 0;
2242ddfb Manivannan Sadhasivam 2018-04-04  274  }
2242ddfb Manivannan Sadhasivam 2018-04-04  275  

:::::: The code at line 255 was first introduced by commit
:::::: 2242ddfbf4d699b58d12467bbebae167d7563700 pinctrl: actions: Add Actions S900 pinctrl driver

:::::: TO: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
:::::: CC: Linus Walleij <linus.walleij@linaro.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Patch

diff --git a/drivers/pinctrl/actions/pinctrl-owl.h b/drivers/pinctrl/actions/pinctrl-owl.h
index a724d1d406d4..a7bcacad11d5 100644
--- a/drivers/pinctrl/actions/pinctrl-owl.h
+++ b/drivers/pinctrl/actions/pinctrl-owl.h
@@ -15,12 +15,135 @@ 
 #define OWL_PINCONF_SLEW_SLOW 0
 #define OWL_PINCONF_SLEW_FAST 1
 
-enum owl_pinconf_pull {
-	OWL_PINCONF_PULL_HIZ,
-	OWL_PINCONF_PULL_DOWN,
-	OWL_PINCONF_PULL_UP,
-	OWL_PINCONF_PULL_HOLD,
-};
+#define MUX_PG(group_name, reg, shift, width)				\
+	{								\
+		.name = #group_name,					\
+		.pads = group_name##_pads,				\
+		.npads = ARRAY_SIZE(group_name##_pads),			\
+		.funcs = group_name##_funcs,				\
+		.nfuncs = ARRAY_SIZE(group_name##_funcs),		\
+		.mfpctl_reg  = MFCTL##reg,				\
+		.mfpctl_shift = shift,					\
+		.mfpctl_width = width,					\
+		.drv_reg = -1,						\
+		.drv_shift = -1,					\
+		.drv_width = -1,					\
+		.sr_reg = -1,						\
+		.sr_shift = -1,						\
+		.sr_width = -1,						\
+	}
+
+#define DRV_PG(group_name, reg, shift, width)				\
+	{								\
+		.name = #group_name,					\
+		.pads = group_name##_pads,				\
+		.npads = ARRAY_SIZE(group_name##_pads),			\
+		.mfpctl_reg  = -1,					\
+		.mfpctl_shift = -1,					\
+		.mfpctl_width = -1,					\
+		.drv_reg = PAD_DRV##reg,				\
+		.drv_shift = shift,					\
+		.drv_width = width,					\
+		.sr_reg = -1,						\
+		.sr_shift = -1,						\
+		.sr_width = -1,						\
+	}
+
+#define SR_PG(group_name, reg, shift, width)				\
+	{								\
+		.name = #group_name,					\
+		.pads = group_name##_pads,				\
+		.npads = ARRAY_SIZE(group_name##_pads),			\
+		.mfpctl_reg  = -1,					\
+		.mfpctl_shift = -1,					\
+		.mfpctl_width = -1,					\
+		.drv_reg = -1,						\
+		.drv_shift = -1,					\
+		.drv_width = -1,					\
+		.sr_reg = PAD_SR##reg,					\
+		.sr_shift = shift,					\
+		.sr_width = width,					\
+	}
+
+#define FUNCTION(fname)					\
+	{						\
+		.name = #fname,				\
+		.groups = fname##_groups,		\
+		.ngroups = ARRAY_SIZE(fname##_groups),	\
+	}
+
+/* PAD PULL UP/DOWN CONFIGURES */
+#define PULLCTL_CONF(pull_reg, pull_sft, pull_wdt)	\
+	{						\
+		.reg = PAD_PULLCTL##pull_reg,		\
+		.shift = pull_sft,			\
+		.width = pull_wdt,			\
+	}
+
+#define PAD_PULLCTL_CONF(pad_name, pull_reg, pull_sft, pull_wdt)	\
+	struct owl_pullctl pad_name##_pullctl_conf			\
+		= PULLCTL_CONF(pull_reg, pull_sft, pull_wdt)
+
+#define ST_CONF(st_reg, st_sft, st_wdt)			\
+	{						\
+		.reg = PAD_ST##st_reg,			\
+		.shift = st_sft,			\
+		.width = st_wdt,			\
+	}
+
+#define PAD_ST_CONF(pad_name, st_reg, st_sft, st_wdt)	\
+	struct owl_st pad_name##_st_conf		\
+		= ST_CONF(st_reg, st_sft, st_wdt)
+
+#define PAD_INFO(name)					\
+	{						\
+		.pad = name,				\
+		.pullctl = NULL,			\
+		.st = NULL,				\
+	}
+
+#define PAD_INFO_ST(name)				\
+	{						\
+		.pad = name,				\
+		.pullctl = NULL,			\
+		.st = &name##_st_conf,			\
+	}
+
+#define PAD_INFO_PULLCTL(name)				\
+	{						\
+		.pad = name,				\
+		.pullctl = &name##_pullctl_conf,	\
+		.st = NULL,				\
+	}
+
+#define PAD_INFO_PULLCTL_ST(name)			\
+	{						\
+		.pad = name,				\
+		.pullctl = &name##_pullctl_conf,	\
+		.st = &name##_st_conf,			\
+	}
+
+#define OWL_GPIO_PORT_A		0
+#define OWL_GPIO_PORT_B		1
+#define OWL_GPIO_PORT_C		2
+#define OWL_GPIO_PORT_D		3
+#define OWL_GPIO_PORT_E		4
+#define OWL_GPIO_PORT_F		5
+
+#define OWL_GPIO_PORT(port, base, count, _outen, _inen, _dat, _intc_ctl,\
+			_intc_pd, _intc_msk, _intc_type, _share)	\
+	[OWL_GPIO_PORT_##port] = {				\
+		.offset = base,					\
+		.pins = count,					\
+		.outen = _outen,				\
+		.inen = _inen,					\
+		.dat = _dat,					\
+		.intc_ctl = _intc_ctl,				\
+		.intc_pd = _intc_pd,				\
+		.intc_msk = _intc_msk,				\
+		.intc_type = _intc_type,			\
+		.shared_ctl_offset = _share,			\
+	}
 
 enum owl_pinconf_drv {
 	OWL_PINCONF_DRV_2MA,
@@ -148,6 +271,7 @@  struct owl_gpio_port {
 	unsigned int intc_pd;
 	unsigned int intc_msk;
 	unsigned int intc_type;
+	u8 shared_ctl_offset;
 };
 
 /**
diff --git a/drivers/pinctrl/actions/pinctrl-s900.c b/drivers/pinctrl/actions/pinctrl-s900.c
index ea67b14ef93b..0597009d8369 100644
--- a/drivers/pinctrl/actions/pinctrl-s900.c
+++ b/drivers/pinctrl/actions/pinctrl-s900.c
@@ -33,13 +33,6 @@ 
 #define PAD_SR1			(0x0274)
 #define PAD_SR2			(0x0278)
 
-#define OWL_GPIO_PORT_A		0
-#define OWL_GPIO_PORT_B		1
-#define OWL_GPIO_PORT_C		2
-#define OWL_GPIO_PORT_D		3
-#define OWL_GPIO_PORT_E		4
-#define OWL_GPIO_PORT_F		5
-
 #define _GPIOA(offset)		(offset)
 #define _GPIOB(offset)		(32 + (offset))
 #define _GPIOC(offset)		(64 + (offset))
@@ -892,55 +885,6 @@  static unsigned int i2c2_sr_pads[]		= { I2C2_SCLK, I2C2_SDATA };
 static unsigned int sensor0_sr_pads[]		= { SENSOR0_PCLK,
 						    SENSOR0_CKOUT };
 
-#define MUX_PG(group_name, reg, shift, width)				\
-	{								\
-		.name = #group_name,					\
-		.pads = group_name##_pads,				\
-		.npads = ARRAY_SIZE(group_name##_pads),			\
-		.funcs = group_name##_funcs,				\
-		.nfuncs = ARRAY_SIZE(group_name##_funcs),		\
-		.mfpctl_reg  = MFCTL##reg,				\
-		.mfpctl_shift = shift,					\
-		.mfpctl_width = width,					\
-		.drv_reg = -1,						\
-		.drv_shift = -1,					\
-		.drv_width = -1,					\
-		.sr_reg = -1,						\
-		.sr_shift = -1,						\
-		.sr_width = -1,						\
-	}
-
-#define DRV_PG(group_name, reg, shift, width)				\
-	{								\
-		.name = #group_name,					\
-		.pads = group_name##_pads,				\
-		.npads = ARRAY_SIZE(group_name##_pads),			\
-		.mfpctl_reg  = -1,					\
-		.mfpctl_shift = -1,					\
-		.mfpctl_width = -1,					\
-		.drv_reg = PAD_DRV##reg,				\
-		.drv_shift = shift,					\
-		.drv_width = width,					\
-		.sr_reg = -1,						\
-		.sr_shift = -1,						\
-		.sr_width = -1,						\
-	}
-
-#define SR_PG(group_name, reg, shift, width)				\
-	{								\
-		.name = #group_name,					\
-		.pads = group_name##_pads,				\
-		.npads = ARRAY_SIZE(group_name##_pads),			\
-		.mfpctl_reg  = -1,					\
-		.mfpctl_shift = -1,					\
-		.mfpctl_width = -1,					\
-		.drv_reg = -1,						\
-		.drv_shift = -1,					\
-		.drv_width = -1,					\
-		.sr_reg = PAD_SR##reg,					\
-		.sr_shift = shift,					\
-		.sr_width = width,					\
-	}
 
 /* Pinctrl groups */
 static const struct owl_pingroup s900_groups[] = {
@@ -1442,13 +1386,6 @@  static const char * const sirq2_groups[] = {
 	"sirq2_dummy",
 };
 
-#define FUNCTION(fname)					\
-	{						\
-		.name = #fname,				\
-		.groups = fname##_groups,		\
-		.ngroups = ARRAY_SIZE(fname##_groups),	\
-	}
-
 static const struct owl_pinmux_func s900_functions[] = {
 	[S900_MUX_ERAM] = FUNCTION(eram),
 	[S900_MUX_ETH_RMII] = FUNCTION(eth_rmii),
@@ -1500,28 +1437,6 @@  static const struct owl_pinmux_func s900_functions[] = {
 	[S900_MUX_SIRQ1] = FUNCTION(sirq1),
 	[S900_MUX_SIRQ2] = FUNCTION(sirq2)
 };
-/* PAD PULL UP/DOWN CONFIGURES */
-#define PULLCTL_CONF(pull_reg, pull_sft, pull_wdt)			\
-	{								\
-		.reg = PAD_PULLCTL##pull_reg,				\
-		.shift = pull_sft,					\
-		.width = pull_wdt,					\
-	}
-
-#define PAD_PULLCTL_CONF(pad_name, pull_reg, pull_sft, pull_wdt)	\
-	struct owl_pullctl pad_name##_pullctl_conf			\
-		= PULLCTL_CONF(pull_reg, pull_sft, pull_wdt)
-
-#define ST_CONF(st_reg, st_sft, st_wdt)					\
-	{								\
-		.reg = PAD_ST##st_reg,					\
-		.shift = st_sft,					\
-		.width = st_wdt,					\
-	}
-
-#define PAD_ST_CONF(pad_name, st_reg, st_sft, st_wdt)			\
-	struct owl_st pad_name##_st_conf				\
-		= ST_CONF(st_reg, st_sft, st_wdt)
 
 /* PAD_PULLCTL0 */
 static PAD_PULLCTL_CONF(ETH_RXER, 0, 18, 2);
@@ -1639,34 +1554,6 @@  static PAD_ST_CONF(SPI0_SS, 1, 2, 1);
 static PAD_ST_CONF(I2S_BCLK0, 1, 1, 1);
 static PAD_ST_CONF(I2S_MCLK0, 1, 0, 1);
 
-#define PAD_INFO(name)							\
-	{								\
-		.pad = name,						\
-		.pullctl = NULL,					\
-		.st = NULL,						\
-	}
-
-#define PAD_INFO_ST(name)						\
-	{								\
-		.pad = name,						\
-		.pullctl = NULL,					\
-		.st = &name##_st_conf,					\
-	}
-
-#define PAD_INFO_PULLCTL(name)						\
-	{								\
-		.pad = name,						\
-		.pullctl = &name##_pullctl_conf,			\
-		.st = NULL,						\
-	}
-
-#define PAD_INFO_PULLCTL_ST(name)					\
-	{								\
-		.pad = name,						\
-		.pullctl = &name##_pullctl_conf,			\
-		.st = &name##_st_conf,					\
-	}
-
 /* Pad info table */
 static struct owl_padinfo s900_padinfo[NUM_PADS] = {
 	[ETH_TXD0] = PAD_INFO_ST(ETH_TXD0),
@@ -1821,27 +1708,13 @@  static struct owl_padinfo s900_padinfo[NUM_PADS] = {
 	[SGPIO3] = PAD_INFO_PULLCTL_ST(SGPIO3)
 };
 
-#define OWL_GPIO_PORT(port, base, count, _outen, _inen, _dat,		\
-			_intc_ctl, _intc_pd, _intc_msk, _intc_type)	\
-	[OWL_GPIO_PORT_##port] = {					\
-		.offset = base,						\
-		.pins = count,						\
-		.outen = _outen,					\
-		.inen = _inen,						\
-		.dat = _dat,						\
-		.intc_ctl = _intc_ctl,					\
-		.intc_pd = _intc_pd,					\
-		.intc_msk = _intc_msk,					\
-		.intc_type = _intc_type,				\
-	}
-
 static const struct owl_gpio_port s900_gpio_ports[] = {
-	OWL_GPIO_PORT(A, 0x0000, 32, 0x0, 0x4, 0x8, 0x204, 0x208, 0x20C, 0x240),
-	OWL_GPIO_PORT(B, 0x000C, 32, 0x0, 0x4, 0x8, 0x534, 0x204, 0x208, 0x23C),
-	OWL_GPIO_PORT(C, 0x0018, 12, 0x0, 0x4, 0x8, 0x52C, 0x200, 0x204, 0x238),
-	OWL_GPIO_PORT(D, 0x0024, 30, 0x0, 0x4, 0x8, 0x524, 0x1FC, 0x200, 0x234),
-	OWL_GPIO_PORT(E, 0x0030, 32, 0x0, 0x4, 0x8, 0x51C, 0x1F8, 0x1FC, 0x230),
-	OWL_GPIO_PORT(F, 0x00F0, 8, 0x0, 0x4, 0x8, 0x460, 0x140, 0x144, 0x178)
+	OWL_GPIO_PORT(A, 0x0000, 32, 0x0, 0x4, 0x8, 0x204, 0x208, 0x20C, 0x240, 0),
+	OWL_GPIO_PORT(B, 0x000C, 32, 0x0, 0x4, 0x8, 0x534, 0x204, 0x208, 0x23C, 0),
+	OWL_GPIO_PORT(C, 0x0018, 12, 0x0, 0x4, 0x8, 0x52C, 0x200, 0x204, 0x238, 0),
+	OWL_GPIO_PORT(D, 0x0024, 30, 0x0, 0x4, 0x8, 0x524, 0x1FC, 0x200, 0x234, 0),
+	OWL_GPIO_PORT(E, 0x0030, 32, 0x0, 0x4, 0x8, 0x51C, 0x1F8, 0x1FC, 0x230, 0),
+	OWL_GPIO_PORT(F, 0x00F0, 8, 0x0, 0x4, 0x8, 0x460, 0x140, 0x144, 0x178, 0)
 };
 
 static struct owl_pinctrl_soc_data s900_pinctrl_data = {