SUPERH platform development
 help / color / mirror / Atom feed
* [PATCH 1/2] sh-pfc: Share common PORTCR macro definition
@ 2013-11-26  1:45 Laurent Pinchart
  2013-11-28  7:51 ` Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Laurent Pinchart @ 2013-11-26  1:45 UTC (permalink / raw)
  To: linux-sh

The macro is defined identically in four different locations. Share it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/pinctrl/sh-pfc/pfc-r8a73a4.c | 11 -----------
 drivers/pinctrl/sh-pfc/pfc-r8a7740.c | 11 -----------
 drivers/pinctrl/sh-pfc/pfc-sh7372.c  | 11 -----------
 drivers/pinctrl/sh-pfc/pfc-sh73a0.c  | 10 ----------
 drivers/pinctrl/sh-pfc/sh_pfc.h      |  3 +--
 5 files changed, 1 insertion(+), 45 deletions(-)

diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a73a4.c b/drivers/pinctrl/sh-pfc/pfc-r8a73a4.c
index d25fd4e..d76cc34 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a73a4.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a73a4.c
@@ -2061,17 +2061,6 @@ static const struct sh_pfc_function pinmux_functions[] = {
 	SH_PFC_FUNCTION(sdhi2),
 };
 
-#undef PORTCR
-#define PORTCR(nr, reg)							\
-	{								\
-		PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) {		\
-			_PCRH(PORT##nr##_IN, 0, 0, PORT##nr##_OUT),	\
-				PORT##nr##_FN0, PORT##nr##_FN1,		\
-				PORT##nr##_FN2, PORT##nr##_FN3,		\
-				PORT##nr##_FN4, PORT##nr##_FN5,		\
-				PORT##nr##_FN6, PORT##nr##_FN7 }	\
-	}
-
 static const struct pinmux_cfg_reg pinmux_config_regs[] = {
 	PORTCR(0, 0xe6050000),
 	PORTCR(1, 0xe6050001),
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7740.c b/drivers/pinctrl/sh-pfc/pfc-r8a7740.c
index 009174d..7ac0065 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a7740.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a7740.c
@@ -3234,17 +3234,6 @@ static const struct sh_pfc_function pinmux_functions[] = {
 	SH_PFC_FUNCTION(tpu0),
 };
 
-#undef PORTCR
-#define PORTCR(nr, reg)							\
-	{								\
-		PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) {		\
-			_PCRH(PORT##nr##_IN, 0, 0, PORT##nr##_OUT),	\
-				PORT##nr##_FN0, PORT##nr##_FN1,		\
-				PORT##nr##_FN2, PORT##nr##_FN3,		\
-				PORT##nr##_FN4, PORT##nr##_FN5,		\
-				PORT##nr##_FN6, PORT##nr##_FN7 }	\
-	}
-
 static const struct pinmux_cfg_reg pinmux_config_regs[] = {
 	PORTCR(0,	0xe6050000), /* PORT0CR */
 	PORTCR(1,	0xe6050001), /* PORT1CR */
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7372.c b/drivers/pinctrl/sh-pfc/pfc-sh7372.c
index 70b522d..4fea6ce 100644
--- a/drivers/pinctrl/sh-pfc/pfc-sh7372.c
+++ b/drivers/pinctrl/sh-pfc/pfc-sh7372.c
@@ -2118,17 +2118,6 @@ static const struct sh_pfc_function pinmux_functions[] = {
 	SH_PFC_FUNCTION(usb1),
 };
 
-#undef PORTCR
-#define PORTCR(nr, reg)							\
-	{								\
-		PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) {		\
-			_PCRH(PORT##nr##_IN, 0, 0, PORT##nr##_OUT),     \
-				PORT##nr##_FN0, PORT##nr##_FN1,		\
-				PORT##nr##_FN2, PORT##nr##_FN3,		\
-				PORT##nr##_FN4, PORT##nr##_FN5,		\
-				PORT##nr##_FN6, PORT##nr##_FN7 }	\
-	}
-
 static const struct pinmux_cfg_reg pinmux_config_regs[] = {
 	PORTCR(0,	0xE6051000), /* PORT0CR */
 	PORTCR(1,	0xE6051001), /* PORT1CR */
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh73a0.c b/drivers/pinctrl/sh-pfc/pfc-sh73a0.c
index 7e278a9..b81b56e 100644
--- a/drivers/pinctrl/sh-pfc/pfc-sh73a0.c
+++ b/drivers/pinctrl/sh-pfc/pfc-sh73a0.c
@@ -3138,16 +3138,6 @@ static const struct sh_pfc_function pinmux_functions[] = {
 	SH_PFC_FUNCTION(usb),
 };
 
-#undef PORTCR
-#define PORTCR(nr, reg)							\
-	{								\
-		PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) {		\
-			_PCRH(PORT##nr##_IN, 0, 0, PORT##nr##_OUT),	\
-				PORT##nr##_FN0, PORT##nr##_FN1,		\
-				PORT##nr##_FN2, PORT##nr##_FN3,		\
-				PORT##nr##_FN4, PORT##nr##_FN5,		\
-				PORT##nr##_FN6, PORT##nr##_FN7 }	\
-	}
 static const struct pinmux_cfg_reg pinmux_config_regs[] = {
 	PORTCR(0, 0xe6050000), /* PORT0CR */
 	PORTCR(1, 0xe6050001), /* PORT1CR */
diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h
index 11bd0d9..8a494e5 100644
--- a/drivers/pinctrl/sh-pfc/sh_pfc.h
+++ b/drivers/pinctrl/sh-pfc/sh_pfc.h
@@ -304,8 +304,7 @@ struct sh_pfc_soc_info {
 #define PORTCR(nr, reg)							\
 	{								\
 		PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) {		\
-			_PCRH(PORT##nr##_IN, PORT##nr##_IN_PD,		\
-			      PORT##nr##_IN_PU, PORT##nr##_OUT),	\
+			_PCRH(PORT##nr##_IN, 0, 0, PORT##nr##_OUT),	\
 				PORT##nr##_FN0, PORT##nr##_FN1,		\
 				PORT##nr##_FN2, PORT##nr##_FN3,		\
 				PORT##nr##_FN4, PORT##nr##_FN5,		\
-- 
1.8.3.2


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

* Re: [PATCH 1/2] sh-pfc: Share common PORTCR macro definition
  2013-11-26  1:45 [PATCH 1/2] sh-pfc: Share common PORTCR macro definition Laurent Pinchart
@ 2013-11-28  7:51 ` Simon Horman
  2013-12-03  9:33 ` Linus Walleij
  2013-12-04  1:01 ` Laurent Pinchart
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2013-11-28  7:51 UTC (permalink / raw)
  To: linux-sh

On Tue, Nov 26, 2013 at 02:45:33AM +0100, Laurent Pinchart wrote:
> The macro is defined identically in four different locations. Share it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

> ---
>  drivers/pinctrl/sh-pfc/pfc-r8a73a4.c | 11 -----------
>  drivers/pinctrl/sh-pfc/pfc-r8a7740.c | 11 -----------
>  drivers/pinctrl/sh-pfc/pfc-sh7372.c  | 11 -----------
>  drivers/pinctrl/sh-pfc/pfc-sh73a0.c  | 10 ----------
>  drivers/pinctrl/sh-pfc/sh_pfc.h      |  3 +--
>  5 files changed, 1 insertion(+), 45 deletions(-)
> 
> diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a73a4.c b/drivers/pinctrl/sh-pfc/pfc-r8a73a4.c
> index d25fd4e..d76cc34 100644
> --- a/drivers/pinctrl/sh-pfc/pfc-r8a73a4.c
> +++ b/drivers/pinctrl/sh-pfc/pfc-r8a73a4.c
> @@ -2061,17 +2061,6 @@ static const struct sh_pfc_function pinmux_functions[] = {
>  	SH_PFC_FUNCTION(sdhi2),
>  };
>  
> -#undef PORTCR
> -#define PORTCR(nr, reg)							\
> -	{								\
> -		PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) {		\
> -			_PCRH(PORT##nr##_IN, 0, 0, PORT##nr##_OUT),	\
> -				PORT##nr##_FN0, PORT##nr##_FN1,		\
> -				PORT##nr##_FN2, PORT##nr##_FN3,		\
> -				PORT##nr##_FN4, PORT##nr##_FN5,		\
> -				PORT##nr##_FN6, PORT##nr##_FN7 }	\
> -	}
> -
>  static const struct pinmux_cfg_reg pinmux_config_regs[] = {
>  	PORTCR(0, 0xe6050000),
>  	PORTCR(1, 0xe6050001),
> diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7740.c b/drivers/pinctrl/sh-pfc/pfc-r8a7740.c
> index 009174d..7ac0065 100644
> --- a/drivers/pinctrl/sh-pfc/pfc-r8a7740.c
> +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7740.c
> @@ -3234,17 +3234,6 @@ static const struct sh_pfc_function pinmux_functions[] = {
>  	SH_PFC_FUNCTION(tpu0),
>  };
>  
> -#undef PORTCR
> -#define PORTCR(nr, reg)							\
> -	{								\
> -		PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) {		\
> -			_PCRH(PORT##nr##_IN, 0, 0, PORT##nr##_OUT),	\
> -				PORT##nr##_FN0, PORT##nr##_FN1,		\
> -				PORT##nr##_FN2, PORT##nr##_FN3,		\
> -				PORT##nr##_FN4, PORT##nr##_FN5,		\
> -				PORT##nr##_FN6, PORT##nr##_FN7 }	\
> -	}
> -
>  static const struct pinmux_cfg_reg pinmux_config_regs[] = {
>  	PORTCR(0,	0xe6050000), /* PORT0CR */
>  	PORTCR(1,	0xe6050001), /* PORT1CR */
> diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7372.c b/drivers/pinctrl/sh-pfc/pfc-sh7372.c
> index 70b522d..4fea6ce 100644
> --- a/drivers/pinctrl/sh-pfc/pfc-sh7372.c
> +++ b/drivers/pinctrl/sh-pfc/pfc-sh7372.c
> @@ -2118,17 +2118,6 @@ static const struct sh_pfc_function pinmux_functions[] = {
>  	SH_PFC_FUNCTION(usb1),
>  };
>  
> -#undef PORTCR
> -#define PORTCR(nr, reg)							\
> -	{								\
> -		PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) {		\
> -			_PCRH(PORT##nr##_IN, 0, 0, PORT##nr##_OUT),     \
> -				PORT##nr##_FN0, PORT##nr##_FN1,		\
> -				PORT##nr##_FN2, PORT##nr##_FN3,		\
> -				PORT##nr##_FN4, PORT##nr##_FN5,		\
> -				PORT##nr##_FN6, PORT##nr##_FN7 }	\
> -	}
> -
>  static const struct pinmux_cfg_reg pinmux_config_regs[] = {
>  	PORTCR(0,	0xE6051000), /* PORT0CR */
>  	PORTCR(1,	0xE6051001), /* PORT1CR */
> diff --git a/drivers/pinctrl/sh-pfc/pfc-sh73a0.c b/drivers/pinctrl/sh-pfc/pfc-sh73a0.c
> index 7e278a9..b81b56e 100644
> --- a/drivers/pinctrl/sh-pfc/pfc-sh73a0.c
> +++ b/drivers/pinctrl/sh-pfc/pfc-sh73a0.c
> @@ -3138,16 +3138,6 @@ static const struct sh_pfc_function pinmux_functions[] = {
>  	SH_PFC_FUNCTION(usb),
>  };
>  
> -#undef PORTCR
> -#define PORTCR(nr, reg)							\
> -	{								\
> -		PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) {		\
> -			_PCRH(PORT##nr##_IN, 0, 0, PORT##nr##_OUT),	\
> -				PORT##nr##_FN0, PORT##nr##_FN1,		\
> -				PORT##nr##_FN2, PORT##nr##_FN3,		\
> -				PORT##nr##_FN4, PORT##nr##_FN5,		\
> -				PORT##nr##_FN6, PORT##nr##_FN7 }	\
> -	}
>  static const struct pinmux_cfg_reg pinmux_config_regs[] = {
>  	PORTCR(0, 0xe6050000), /* PORT0CR */
>  	PORTCR(1, 0xe6050001), /* PORT1CR */
> diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h
> index 11bd0d9..8a494e5 100644
> --- a/drivers/pinctrl/sh-pfc/sh_pfc.h
> +++ b/drivers/pinctrl/sh-pfc/sh_pfc.h
> @@ -304,8 +304,7 @@ struct sh_pfc_soc_info {
>  #define PORTCR(nr, reg)							\
>  	{								\
>  		PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) {		\
> -			_PCRH(PORT##nr##_IN, PORT##nr##_IN_PD,		\
> -			      PORT##nr##_IN_PU, PORT##nr##_OUT),	\
> +			_PCRH(PORT##nr##_IN, 0, 0, PORT##nr##_OUT),	\
>  				PORT##nr##_FN0, PORT##nr##_FN1,		\
>  				PORT##nr##_FN2, PORT##nr##_FN3,		\
>  				PORT##nr##_FN4, PORT##nr##_FN5,		\
> -- 
> 1.8.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [PATCH 1/2] sh-pfc: Share common PORTCR macro definition
  2013-11-26  1:45 [PATCH 1/2] sh-pfc: Share common PORTCR macro definition Laurent Pinchart
  2013-11-28  7:51 ` Simon Horman
@ 2013-12-03  9:33 ` Linus Walleij
  2013-12-04  1:01 ` Laurent Pinchart
  2 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2013-12-03  9:33 UTC (permalink / raw)
  To: linux-sh

On Tue, Nov 26, 2013 at 2:45 AM, Laurent Pinchart
<laurent.pinchart+renesas@ideasonboard.com> wrote:

> The macro is defined identically in four different locations. Share it.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Laurent, please stack this into your series for pull-req, OK?

Yours,
Linus Walleij

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

* Re: [PATCH 1/2] sh-pfc: Share common PORTCR macro definition
  2013-11-26  1:45 [PATCH 1/2] sh-pfc: Share common PORTCR macro definition Laurent Pinchart
  2013-11-28  7:51 ` Simon Horman
  2013-12-03  9:33 ` Linus Walleij
@ 2013-12-04  1:01 ` Laurent Pinchart
  2 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2013-12-04  1:01 UTC (permalink / raw)
  To: linux-sh

Hi Linus,

On Tuesday 03 December 2013 10:33:49 Linus Walleij wrote:
> On Tue, Nov 26, 2013 at 2:45 AM, Laurent Pinchart wrote:
> > The macro is defined identically in four different locations. Share it.
> > 
> > Signed-off-by: Laurent Pinchart
> > <laurent.pinchart+renesas@ideasonboard.com>
> 
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> 
> Laurent, please stack this into your series for pull-req, OK?

Sure.

-- 
Regards,

Laurent Pinchart


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

end of thread, other threads:[~2013-12-04  1:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-26  1:45 [PATCH 1/2] sh-pfc: Share common PORTCR macro definition Laurent Pinchart
2013-11-28  7:51 ` Simon Horman
2013-12-03  9:33 ` Linus Walleij
2013-12-04  1:01 ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox