Skip to contentSkip to conversation

mx53loco: Use gpio_direction_input prior to gpio_get_value

PATCH New Fabio Estevam 3 participants 15 messages Feb 8, 2012 – Feb 9, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 mx53loco: Use gpio_direction_input prior to gpio_get_value

Use gpio_direction_input prior to gpio_get_value.

---
 board/freescale/mx53loco/mx53loco.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
board/freescale/mx53loco/mx53loco.c +2 -0
index e6345e7..c2c26f0 100644
@@ -153,7 +153,9 @@ int board_mmc_getcd(struct mmc *mmc)
 	int ret;
 
 	mxc_request_iomux(MX53_PIN_EIM_DA11, IOMUX_CONFIG_ALT1);
+	gpio_direction_input(75);
 	mxc_request_iomux(MX53_PIN_EIM_DA13, IOMUX_CONFIG_ALT1);
+	gpio_direction_input(77);
 
 	if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
 		ret = !gpio_get_value(77); /* GPIO3_13 */
Signature · 1 line
1.7.1
#1 lore raw

PATCH 2/5 mx53ard: Use gpio_direction_input prior to gpio_get_value

Use gpio_direction_input prior to gpio_get_value.

---
 board/freescale/mx53ard/mx53ard.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
board/freescale/mx53ard/mx53ard.c +2 -0
index 40b5c19..e90e39e 100644
@@ -89,7 +89,9 @@ int board_mmc_getcd(struct mmc *mmc)
 	int ret;
 
 	mxc_request_iomux(MX53_PIN_GPIO_1, IOMUX_CONFIG_ALT1);
+	gpio_direction_input(1);
 	mxc_request_iomux(MX53_PIN_GPIO_4, IOMUX_CONFIG_ALT1);
+	gpio_direction_input(4);
 
 	if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
 		ret = !gpio_get_value(1); /* GPIO1_1 */
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/5 mx53ard: Use gpio_direction_input prior to gpio_get_value

Quoted 4 lines · Fabio Estevam

Use gpio_direction_input prior to gpio_get_value.

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#3 lore raw

PATCH 3/5 mx53evk: Use gpio_direction_input prior to gpio_get_value

In reply to Fabio Estevam

Use gpio_direction_input prior to gpio_get_value.

---
 board/freescale/mx53evk/mx53evk.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
board/freescale/mx53evk/mx53evk.c +2 -0
index e976ae1..8a6e31d 100644
@@ -214,7 +214,9 @@ int board_mmc_getcd(struct mmc *mmc)
 	int ret;
 
 	mxc_request_iomux(MX53_PIN_EIM_DA11, IOMUX_CONFIG_ALT1);
+	gpio_direction_input(75);
 	mxc_request_iomux(MX53_PIN_EIM_DA13, IOMUX_CONFIG_ALT1);
+	gpio_direction_input(77);
 
 	if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
 		ret = !gpio_get_value(77); /* GPIO3_13 */
Signature · 1 line
1.7.1
#4 lore raw

PATCH 3/5 mx53evk: Use gpio_direction_input prior to gpio_get_value

2012/2/8 Fabio Estevam <[email protected]>:

Quoted 4 lines

Use gpio_direction_input prior to gpio_get_value.

Quoted 25 lines

---
?board/freescale/mx53evk/mx53evk.c | ? ?2 ++
?1 files changed, 2 insertions(+), 0 deletions(-)

board/freescale/mx53evk/mx53evk.c +2 -0
index e976ae1..8a6e31d 100644
@@ -214,7 +214,9 @@ int board_mmc_getcd(struct mmc *mmc)
 ? ? ? ?int ret;
 
 ? ? ? ?mxc_request_iomux(MX53_PIN_EIM_DA11, IOMUX_CONFIG_ALT1);
+ ? ? ? gpio_direction_input(75);
 ? ? ? ?mxc_request_iomux(MX53_PIN_EIM_DA13, IOMUX_CONFIG_ALT1);
+ ? ? ? gpio_direction_input(77);
 
 ? ? ? ?if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)

? ? ? ? ? ? ? ?ret = !gpio_get_value(77); /* GPIO3_13 */ --
1.7.1

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#5 lore raw

PATCH 3/5 mx53evk: Use gpio_direction_input prior to gpio_get_value

In reply to Fabio Estevam
Quoted 5 lines · Fabio Estevam

Use gpio_direction_input prior to gpio_get_value.

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#6 lore raw

PATCH 4/5 mx53smd: Use gpio_direction_input prior to gpio_get_value

In reply to Fabio Estevam

Use gpio_direction_input prior to gpio_get_value.

---
 board/freescale/mx53smd/mx53smd.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
board/freescale/mx53smd/mx53smd.c +1 -0
index e273192..c237980 100644
@@ -135,6 +135,7 @@ struct fsl_esdhc_cfg esdhc_cfg[1] = {
 int board_mmc_getcd(struct mmc *mmc)
 {
 	mxc_request_iomux(MX53_PIN_EIM_DA13, IOMUX_CONFIG_ALT1);
+	gpio_direction_input(77);
 	return !gpio_get_value(77); /* GPIO3_13 */
 }
 
Signature · 1 line
1.7.1
#7 lore raw

PATCH 4/5 mx53smd: Use gpio_direction_input prior to gpio_get_value

Quoted 4 lines · Fabio Estevam

Use gpio_direction_input prior to gpio_get_value.

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#8 lore raw

PATCH 5/5 mx51evk: Use gpio_direction_input prior to gpio_get_value

In reply to Fabio Estevam

Use gpio_direction_input prior to gpio_get_value.

---
 board/freescale/mx51evk/mx51evk.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
board/freescale/mx51evk/mx51evk.c +2 -0
index 8d1f6a3..b505a71 100644
@@ -327,7 +327,9 @@ int board_mmc_getcd(struct mmc *mmc)
 	int ret;
 
 	mxc_request_iomux(MX51_PIN_GPIO1_0, IOMUX_CONFIG_ALT1);
+	gpio_direction_input(0);
 	mxc_request_iomux(MX51_PIN_GPIO1_6, IOMUX_CONFIG_ALT0);
+	gpio_direction_input(6);
 
 	if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
 		ret = !gpio_get_value(0);
Signature · 1 line
1.7.1
#9 lore raw

PATCH 5/5 mx51evk: Use gpio_direction_input prior to gpio_get_value

Quoted 4 lines · Fabio Estevam

Use gpio_direction_input prior to gpio_get_value.

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#10 lore raw

PATCH 1/5 mx53loco: Use gpio_direction_input prior to gpio_get_value

In reply to Fabio Estevam
Quoted 8 lines · Fabio Estevam

Use gpio_direction_input prior to gpio_get_value.

---
 board/freescale/mx53loco/mx53loco.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Hi Fabio,

board/freescale/mx53loco/mx53loco.c int board_mmc_getcd(struct mmc *mmc) · line 159

Quoted 12 lines
board/freescale/mx53loco/mx53loco.c +2 -0
index e6345e7..c2c26f0 100644
@@ -153,7 +153,9 @@ int board_mmc_getcd(struct mmc *mmc)
 	int ret;
 
 	mxc_request_iomux(MX53_PIN_EIM_DA11, IOMUX_CONFIG_ALT1);
+	gpio_direction_input(75);
 	mxc_request_iomux(MX53_PIN_EIM_DA13, IOMUX_CONFIG_ALT1);
+	gpio_direction_input(77);
 

The patch makes clear that the GPIO is configured as input. However, after a reset all GPIOs in the MX53 are configured as input. Do we need such changes ?

Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#11 lore raw

PATCH 1/5 mx53loco: Use gpio_direction_input prior to gpio_get_value

Quoted 3 lines · Stefano Babic

The patch makes clear that the GPIO is configured as input. However, after a reset all GPIOs in the MX53 are configured as input. Do we need such changes ?

I would prefer to explicitly set gpio_direction_input rather than depending on the reset value and I think it aligns with the GPIO API mechanism used in the kernel as well.

Regards,

Fabio Estevam

#12 lore raw

PATCH 1/5 mx53loco: Use gpio_direction_input prior to gpio_get_value

Quoted 9 lines · Fabio Estevam
Quoted 3 lines · Stefano Babic

The patch makes clear that the GPIO is configured as input. However, after a reset all GPIOs in the MX53 are configured as input. Do we need such changes ?

I would prefer to explicitly set gpio_direction_input rather than depending on the reset value and I think it aligns with the GPIO API mechanism used in the kernel as well.

Ok, good reasons.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#13 lore raw

PATCH 1/5 mx53loco: Use gpio_direction_input prior to gpio_get_value

In reply to Fabio Estevam

2012/2/8 Fabio Estevam <[email protected]>:

Quoted 4 lines

Use gpio_direction_input prior to gpio_get_value.

Quoted 25 lines

---
?board/freescale/mx53loco/mx53loco.c | ? ?2 ++
?1 files changed, 2 insertions(+), 0 deletions(-)

board/freescale/mx53loco/mx53loco.c +2 -0
index e6345e7..c2c26f0 100644
@@ -153,7 +153,9 @@ int board_mmc_getcd(struct mmc *mmc)
 ? ? ? ?int ret;
 
 ? ? ? ?mxc_request_iomux(MX53_PIN_EIM_DA11, IOMUX_CONFIG_ALT1);
+ ? ? ? gpio_direction_input(75);
 ? ? ? ?mxc_request_iomux(MX53_PIN_EIM_DA13, IOMUX_CONFIG_ALT1);
+ ? ? ? gpio_direction_input(77);
 
 ? ? ? ?if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)

? ? ? ? ? ? ? ?ret = !gpio_get_value(77); /* GPIO3_13 */ --
1.7.1

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#14 lore raw

PATCH 1/5 mx53loco: Use gpio_direction_input prior to gpio_get_value

In reply to Fabio Estevam
Quoted 5 lines · Fabio Estevam

Use gpio_direction_input prior to gpio_get_value.

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================