Re: [PATCH v4 2/8] pinctrl: sh-pfc: r8a7790: Implement voltage switching for SDHI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > b/drivers/pinctrl/sh-pfc/sh_pfc.h index 734f7a92229c..3eca740bba02 100644
> > --- a/drivers/pinctrl/sh-pfc/sh_pfc.h
> > +++ b/drivers/pinctrl/sh-pfc/sh_pfc.h
> > @@ -272,14 +272,18 @@ struct sh_pfc_soc_info {
> >  		.enum_id = _pin##_DATA,					\
> >  	}
> > 
> > -/* SH_PFC_PIN_CFG - Expand to a sh_pfc_pin entry (named PORT#) with config
> > */
> > -#define SH_PFC_PIN_CFG(_pin, cfgs)					\
> > +/* SH_PFC_{PORT,GPIO}_CFG - Expand to a sh_pfc_pin entry with config */
> > +#define _SH_PFC_PIN_CFG(_pin, _name, cfgs)				\
> >  	{								\
> >  		.pin = _pin,						\
> > -		.name = __stringify(PORT##_pin),			\
> > -		.enum_id = PORT##_pin##_DATA,				\
> > +		.name = __stringify(_name),				\
> > +		.enum_id = _name##_DATA,				\
> >  		.configs = cfgs,					\
> >  	}
> > +#define SH_PFC_PORT_CFG(_pin, cfgs)				\
> > +	_SH_PFC_PIN_CFG(PORT##_pin, PORT##_pin, cfgs)
> > +#define SH_PFC_GPIO_CFG(bank, _pin, _name, cfgs)		\
> > +	_SH_PFC_PIN_CFG((bank * 32) + _pin, _name, cfgs)
> > 
> >  /* SH_PFC_PIN_NAMED - Expand to a sh_pfc_pin entry with the given name */
> >  #define SH_PFC_PIN_NAMED(row, col, _name)				\
> > --- END ---
> > 
> > If you're happy with that, I'll re-send the series (hopefully for the
> > last time!) with the r8a7790 changes squashed into "pinctrl: sh-pfc:
> > r8a7790: Implement voltage switching for SDHI" and the SH_PFC_PIN_CFG
> > macro change as a new patch before it.
> 
> That looks good to me. I'd split it in two patches though, one that reworks 
> the existing macros (the drivers/pinctrl/sh-pfc/sh_pfc.h changes) and one that 
> implements voltage switching for SDHI on r8a7790.
> 
> I would also avoid renaming SH_PFC_PIN_CFG to SH_PFC_PORT_CFG to avoid 
> modifying unrelated files, you can name the low-level macro __SH_PFC_PIN_CFG 
> and add
> 
> #define SH_PFC_PIN_CFG(_pin, cfgs)				\
> 	__SH_PFC_PIN_CFG(PORT##_pin, PORT##_pin, cfgs)
> 
> Additionally, your new SH_PFC_GPIO_CFG macro seems identical to _GP_GPIO now. 
> It would make sense to merge the two.

It is identical. And since we meanwhile also have PORT_GP_CFG_32, I
wonder if we can't simply do this in CPU_ALL_PORT?

@@ -30,7 +31,7 @@
 	PORT_GP_32(0, fn, sfx),						\
 	PORT_GP_30(1, fn, sfx),						\
 	PORT_GP_30(2, fn, sfx),						\
-	PORT_GP_32(3, fn, sfx),						\
+	PORT_GP_CFG_32(3, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE),		\
 	PORT_GP_32(4, fn, sfx),						\
 	PORT_GP_32(5, fn, sfx)
 
And skip all the macro refactoring?

I'll test this once I have access to my Lager again, but though I'll let
you know already...

Thanks,

   Wolfram

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux