Patchwork [U-Boot,2/2] vision2: Configure the pins as GPIOs prior to using gpio_get_value.

login
register
mail settings
Submitter Fabio Estevam
Date Nov. 21, 2011, 2:09 p.m.
Message ID <1321884585-12501-2-git-send-email-fabio.estevam@freescale.com>
Download mbox | patch
Permalink /patch/126795/
State Rejected
Delegated to: Stefano Babic
Headers show

Comments

Fabio Estevam - Nov. 21, 2011, 2:09 p.m.
Configure the pin as GPIO prior to using gpio_get_value

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 board/ttcontrol/vision2/vision2.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Patch

diff --git a/board/ttcontrol/vision2/vision2.c b/board/ttcontrol/vision2/vision2.c
index f556d30..e0fa39d 100644
--- a/board/ttcontrol/vision2/vision2.c
+++ b/board/ttcontrol/vision2/vision2.c
@@ -529,8 +529,11 @@  int get_mmc_getcd(u8 *cd, struct mmc *mmc)
 {
 	struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
 
-	if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
+	if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR) {
+		mxc_request_iomux(MX51_PIN_GPIO1_0, IOMUX_CONFIG_ALT1);
 		*cd = gpio_get_value(0);
+	}
+
 	else
 		*cd = 0;