Skip to content
Snippets Groups Projects
Commit 213e9e33 authored by Troy Kisky's avatar Troy Kisky Committed by Stefano Babic
Browse files

nitrogen6x: simplify board_mmc_getcd


The same logic applies to both SD card slots, only with different
GPIOs and the code should make that easier to see.

Signed-off-by: default avatarTroy Kisky <troy.kisky@boundarydevices.com>
parent c9c86bde
No related branches found
No related tags found
No related merge requests found
......@@ -279,17 +279,11 @@ struct fsl_esdhc_cfg usdhc_cfg[2] = {
int board_mmc_getcd(struct mmc *mmc)
{
struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
int ret;
if (cfg->esdhc_base == USDHC3_BASE_ADDR) {
gpio_direction_input(IMX_GPIO_NR(7, 0));
ret = !gpio_get_value(IMX_GPIO_NR(7, 0));
} else {
gpio_direction_input(IMX_GPIO_NR(2, 6));
ret = !gpio_get_value(IMX_GPIO_NR(2, 6));
}
int gp_cd = (cfg->esdhc_base == USDHC3_BASE_ADDR) ? IMX_GPIO_NR(7, 0) :
IMX_GPIO_NR(2, 6);
return ret;
gpio_direction_input(gp_cd);
return !gpio_get_value(gp_cd);
}
int board_mmc_init(bd_t *bis)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment