From 40b0dae15159bf14f24cf7714ddd690ae3ca65e3 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Tue, 10 Oct 2017 13:43:42 -0300 Subject: [PATCH] mx6slevk: Call gpio_request() We should call gpio_request() prior to reading the GPIO value. Signed-off-by: Fabio Estevam --- 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 0597dbe8be..e98aa106ba 100644 --- a/board/freescale/mx6slevk/mx6slevk.c +++ b/board/freescale/mx6slevk/mx6slevk.c @@ -273,12 +273,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; } -- 2.39.5