diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2015-05-17 11:18:06 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2015-05-17 11:18:06 +0000 |
commit | 7bd76046c439a611dc2360ec9b59b027c85c1564 (patch) | |
tree | feb31204627e8ba7cecae6915da237600195e220 | |
parent | 7429ae0cdd9c49a7720855e6d6eba49ffc42b789 (diff) |
add missing calls to set the gpio direction before reading the
card detect gpio on phyflex/sabre lite/wandboard
-rw-r--r-- | sys/arch/armv7/imx/imxesdhc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/arch/armv7/imx/imxesdhc.c b/sys/arch/armv7/imx/imxesdhc.c index 14e26707782..857d47c9076 100644 --- a/sys/arch/armv7/imx/imxesdhc.c +++ b/sys/arch/armv7/imx/imxesdhc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imxesdhc.c,v 1.8 2015/05/15 17:01:18 jsg Exp $ */ +/* $OpenBSD: imxesdhc.c,v 1.9 2015/05/17 11:18:05 jsg Exp $ */ /* * Copyright (c) 2009 Dale Rahn <drahn@openbsd.org> * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> @@ -452,6 +452,7 @@ imxesdhc_card_detect(sdmmc_chipset_handle_t sch) default: return 0; } + imxgpio_set_dir(gpio, IMXGPIO_DIR_IN); return imxgpio_get_bit(gpio) ? 0 : 1; case BOARD_ID_IMX6_SABRELITE: switch (sc->unit) { @@ -464,6 +465,7 @@ imxesdhc_card_detect(sdmmc_chipset_handle_t sch) default: return 0; } + imxgpio_set_dir(gpio, IMXGPIO_DIR_IN); return imxgpio_get_bit(gpio) ? 0 : 1; case BOARD_ID_IMX6_SABRESD: switch (sc->unit) { @@ -492,7 +494,6 @@ imxesdhc_card_detect(sdmmc_chipset_handle_t sch) case 3: gpio = 3*32 + 9; break; - return 1; default: return 0; } @@ -531,6 +532,7 @@ imxesdhc_card_detect(sdmmc_chipset_handle_t sch) default: return 0; } + imxgpio_set_dir(gpio, IMXGPIO_DIR_IN); return imxgpio_get_bit(gpio) ? 0 : 1; default: printf("%s: unhandled board\n", __func__); |