[U-Boot,1/2] mx6slevk: Call gpio_request()

Message ID 1507653823-16651-1-git-send-email-fabio.estevam@nxp.com
State New
Delegated to: Stefano Babic
Headers show
Series
  • [U-Boot,1/2] mx6slevk: Call gpio_request()
Related show

Commit Message

Fabio Estevam Oct. 10, 2017, 4:43 p.m.
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(+)

Patch

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;
 	}