public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] efikamx: Configure the pins as GPIOs prior to using gpio_get_value.
@ 2011-11-21 14:09 Fabio Estevam
  2011-11-21 14:09 ` [U-Boot] [PATCH 2/2] vision2: " Fabio Estevam
  2011-11-21 14:20 ` [U-Boot] [PATCH 1/2] efikamx: " Marek Vasut
  0 siblings, 2 replies; 14+ messages in thread
From: Fabio Estevam @ 2011-11-21 14:09 UTC (permalink / raw)
  To: u-boot

Configure the pins as GPIOs prior to using gpio_get_value

Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 board/efikamx/efikamx.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/board/efikamx/efikamx.c b/board/efikamx/efikamx.c
index 3d2cc1a..b911891 100644
--- a/board/efikamx/efikamx.c
+++ b/board/efikamx/efikamx.c
@@ -308,10 +308,14 @@ struct fsl_esdhc_cfg esdhc_cfg[2] = {
 
 static inline uint32_t efika_mmc_cd(void)
 {
-	if (machine_is_efikamx())
+	if (machine_is_efikamx()) {
+		mxc_request_iomux(MX51_PIN_GPIO1_0, IOMUX_CONFIG_ALT1);
 		return MX51_PIN_GPIO1_0;
-	else
+
+	} else {
+		mxc_request_iomux(MX51_PIN_EIM_CS2, IOMUX_CONFIG_ALT1);
 		return MX51_PIN_EIM_CS2;
+	}
 }
 
 int board_mmc_getcd(u8 *absent, struct mmc *mmc)
@@ -321,9 +325,10 @@ int board_mmc_getcd(u8 *absent, struct mmc *mmc)
 
 	if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
 		*absent = gpio_get_value(IOMUX_TO_GPIO(cd));
-	else
+	else {
+		mxc_request_iomux(MX51_PIN_GPIO1_8, IOMUX_CONFIG_ALT0);
 		*absent = gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_GPIO1_8));
-
+	}
 	return 0;
 }
 
-- 
1.6.0.4

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

end of thread, other threads:[~2011-11-23 19:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-21 14:09 [U-Boot] [PATCH 1/2] efikamx: Configure the pins as GPIOs prior to using gpio_get_value Fabio Estevam
2011-11-21 14:09 ` [U-Boot] [PATCH 2/2] vision2: " Fabio Estevam
2011-11-21 14:20 ` [U-Boot] [PATCH 1/2] efikamx: " Marek Vasut
2011-11-21 18:53   ` Mike Frysinger
2011-11-21 19:29     ` Marek Vasut
2011-11-21 20:14       ` Mike Frysinger
2011-11-21 20:53         ` Marek Vasut
2011-11-21 21:22           ` Mike Frysinger
2011-11-22  8:15             ` Stefano Babic
2011-11-22 21:07               ` Mike Frysinger
2011-11-23  7:02                 ` Igor Grinberg
2011-11-23 19:43                   ` Mike Frysinger
2011-11-23  8:19                 ` Stefano Babic
2011-11-23 19:44                   ` Mike Frysinger

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