
We should call gpio_request() prior to reading the GPIO value.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- Applied on top of:
https://patchwork.ozlabs.org/patch/820477/
and
https://patchwork.ozlabs.org/patch/820298/
board/freescale/mx6slevk/mx6slevk.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c index e9a9bbf..ab72765 100644 --- a/board/freescale/mx6slevk/mx6slevk.c +++ b/board/freescale/mx6slevk/mx6slevk.c @@ -309,12 +309,15 @@ int board_mmc_getcd(struct mmc *mmc)
switch (cfg->esdhc_base) { case USDHC1_BASE_ADDR: + gpio_request(USDHC1_CD_GPIO, "cd1_gpio"); ret = !gpio_get_value(USDHC1_CD_GPIO); break; case USDHC2_BASE_ADDR: + gpio_request(USDHC2_CD_GPIO, "cd2_gpio"); ret = !gpio_get_value(USDHC2_CD_GPIO); break; case USDHC3_BASE_ADDR: + gpio_request(USDHC3_CD_GPIO, "cd3_gpio"); ret = !gpio_get_value(USDHC3_CD_GPIO); break; }