]> git.sur5r.net Git - u-boot/blobdiff - board/freescale/mx51evk/mx51evk.c
mx51evk: Use gpio_direction_input prior to gpio_get_value
[u-boot] / board / freescale / mx51evk / mx51evk.c
index e43aaf726ec605959e257aefce05553e0e2b7d81..b505a710543f362b6f94c4f7354a48d5af271344 100644 (file)
@@ -321,19 +321,22 @@ static void power_init(void)
 }
 
 #ifdef CONFIG_FSL_ESDHC
-int board_mmc_getcd(u8 *cd, struct mmc *mmc)
+int board_mmc_getcd(struct mmc *mmc)
 {
        struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
+       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)
-               *cd = gpio_get_value(0);
+               ret = !gpio_get_value(0);
        else
-               *cd = gpio_get_value(6);
+               ret = !gpio_get_value(6);
 
-       return 0;
+       return ret;
 }
 
 int board_mmc_init(bd_t *bis)