summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/omap_hsmmc.c
diff options
context:
space:
mode:
authorIgor Grinberg <grinberg@compulab.co.il>2014-11-03 11:32:23 +0200
committerTom Rini <trini@ti.com>2014-11-06 11:04:41 -0500
commit0b03a931abcc7572489be07bee169a6d9a23832a (patch)
treecdca61e70196a5c00e34dced19567e8c1a977fbf /drivers/mmc/omap_hsmmc.c
parent0b6f358c01ab0e2828cb34a8b60e565c72b6a764 (diff)
downloadtalos-obmc-uboot-0b03a931abcc7572489be07bee169a6d9a23832a.tar.gz
talos-obmc-uboot-0b03a931abcc7572489be07bee169a6d9a23832a.zip
omap: hsmmc: assume cd gpio is active low
Switch the default CD GPIO polarity to active low. The current hsmmc driver assumption that the CD GPIO is active high, but in the real hardware, usually the opposite holds. The usual SD card socket has a mechanical switch which is grounded as soon as a card is inserted. Of course there might be some board logic which inverts the signal, but as far as current users are concerned, there is no such logic. Current U-Boot users either not using the CD functionality, or have a different way (e.g. external to SoC GPIO controller) for checking the card presence. This patch also brings the polarity assumption in line with the Linux kernel and adds appropriate comments. This patch also might spare issues once the TWL GPIO driver will be converted to the DM. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Cc: Dmitry Lifshitz <lifshitz@compulab.co.il> Reviewed-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'drivers/mmc/omap_hsmmc.c')
-rw-r--r--drivers/mmc/omap_hsmmc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index ef2cbf9e2f..ffb5284a00 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -611,7 +611,8 @@ static int omap_hsmmc_getcd(struct mmc *mmc)
if (cd_gpio < 0)
return 1;
- return gpio_get_value(cd_gpio);
+ /* NOTE: assumes card detect signal is active-low */
+ return !gpio_get_value(cd_gpio);
}
static int omap_hsmmc_getwp(struct mmc *mmc)
@@ -624,6 +625,7 @@ static int omap_hsmmc_getwp(struct mmc *mmc)
if (wp_gpio < 0)
return 0;
+ /* NOTE: assumes write protect signal is active-high */
return gpio_get_value(wp_gpio);
}
#endif
OpenPOWER on IntegriCloud