From 63a5b919da63ab9e446883ec367d33dc4a41b33f Mon Sep 17 00:00:00 2001 From: jsg Date: Sun, 17 May 2015 11:18:05 +0000 Subject: [PATCH] add missing calls to set the gpio direction before reading the card detect gpio on phyflex/sabre lite/wandboard --- sys/arch/armv7/imx/imxesdhc.c | 6 ++++-- 1 file 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 * Copyright (c) 2006 Uwe Stuehler @@ -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__); -- 2.20.1