Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b49139b authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Paul Mundt
Browse files

ARM: mach-shmobile: move helper macro PORTCR to sh_pfc.h

parent 972c3fb6
Loading
Loading
Loading
Loading
+0 −16
Original line number Original line Diff line number Diff line
@@ -1287,22 +1287,6 @@ static struct pinmux_gpio pinmux_gpios[] = {
	GPIO_FN(DIVLOCK),
	GPIO_FN(DIVLOCK),
};
};


/* helper for top 4 bits in PORTnCR */
#define PCRH(in, in_pd, in_pu, out)		\
	0, (out), (in), 0,			\
	0, 0, 0, 0,				\
	0, 0, (in_pd), 0,			\
	0, 0, (in_pu), 0

#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),		\
		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 struct pinmux_cfg_reg pinmux_config_regs[] = {
static struct pinmux_cfg_reg pinmux_config_regs[] = {
	PORTCR(0, 0xe6050000), /* PORT0CR */
	PORTCR(0, 0xe6050000), /* PORT0CR */
	PORTCR(1, 0xe6050001), /* PORT1CR */
	PORTCR(1, 0xe6050001), /* PORT1CR */
+0 −16
Original line number Original line Diff line number Diff line
@@ -1199,22 +1199,6 @@ static struct pinmux_gpio pinmux_gpios[] = {
	GPIO_FN(SDENC_DV_CLKI),
	GPIO_FN(SDENC_DV_CLKI),
};
};


/* helper for top 4 bits in PORTnCR */
#define PCRH(in, in_pd, in_pu, out)		\
	0, (out), (in), 0,			\
	0, 0, 0, 0,				\
	0, 0, (in_pd), 0,			\
	0, 0, (in_pu), 0

#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),		\
		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 struct pinmux_cfg_reg pinmux_config_regs[] = {
static struct pinmux_cfg_reg pinmux_config_regs[] = {
	PORTCR(0,	0xE6051000), /* PORT0CR */
	PORTCR(0,	0xE6051000), /* PORT0CR */
	PORTCR(1,	0xE6051001), /* PORT1CR */
	PORTCR(1,	0xE6051001), /* PORT1CR */
+0 −17
Original line number Original line Diff line number Diff line
@@ -1300,23 +1300,6 @@ static struct pinmux_gpio pinmux_gpios[] = {
	GPIO_FN(RESETOUTS),
	GPIO_FN(RESETOUTS),
};
};


/* helper for top 4 bits in PORTnCR */
#define PCRH(in, in_pd, in_pu, out)	\
	0, (out), (in), 0,	\
		0, 0, 0, 0,	\
		0, 0, (in_pd), 0,	\
		0, 0, (in_pu), 0

#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),	\
				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 struct pinmux_cfg_reg pinmux_config_regs[] = {
static struct pinmux_cfg_reg pinmux_config_regs[] = {
	PORTCR(0, 0xe6050000), /* PORT0CR */
	PORTCR(0, 0xe6050000), /* PORT0CR */
	PORTCR(1, 0xe6050001), /* PORT1CR */
	PORTCR(1, 0xe6050001), /* PORT1CR */
+0 −12
Original line number Original line Diff line number Diff line
@@ -2221,18 +2221,6 @@ static struct pinmux_gpio pinmux_gpios[] = {
	GPIO_FN(FSIAISLD_PU),
	GPIO_FN(FSIAISLD_PU),
};
};


#define PORTCR(nr, reg)	\
	{ PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) { \
		0, \
		/*0001*/ PORT##nr##_OUT , \
		/*0010*/ PORT##nr##_IN , 0, 0, 0, 0, 0, 0, 0, \
		/*1010*/ PORT##nr##_IN_PD, 0, 0, 0, \
		/*1110*/ PORT##nr##_IN_PU, 0, \
		PORT##nr##_FN0, PORT##nr##_FN1,	PORT##nr##_FN2, \
		PORT##nr##_FN3,	PORT##nr##_FN4, PORT##nr##_FN5, \
		PORT##nr##_FN6, PORT##nr##_FN7, 0, 0, 0, 0, 0, 0, 0, 0 } \
	}

static struct pinmux_cfg_reg pinmux_config_regs[] = {
static struct pinmux_cfg_reg pinmux_config_regs[] = {
	PORTCR(0, 0xe6050000), /* PORT0CR */
	PORTCR(0, 0xe6050000), /* PORT0CR */
	PORTCR(1, 0xe6050001), /* PORT1CR */
	PORTCR(1, 0xe6050001), /* PORT1CR */
+17 −0
Original line number Original line Diff line number Diff line
@@ -162,5 +162,22 @@ int unregister_pinmux(struct pinmux_info *pip);
	PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT,	\
	PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT,	\
		    PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
		    PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)


/* helper macro for top 4 bits in PORTnCR */
#define _PCRH(in, in_pd, in_pu, out)	\
	0, (out), (in), 0,		\
	0, 0, 0, 0,			\
	0, 0, (in_pd), 0,		\
	0, 0, (in_pu), 0

#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),	\
				PORT##nr##_FN0, PORT##nr##_FN1,		\
				PORT##nr##_FN2, PORT##nr##_FN3,		\
				PORT##nr##_FN4, PORT##nr##_FN5,		\
				PORT##nr##_FN6, PORT##nr##_FN7 }	\
	}


#endif /* __SH_PFC_H */
#endif /* __SH_PFC_H */