1 From 4c0c9be05004d1eb674b7586216b3d93cc04531c Mon Sep 17 00:00:00 2001
3 Date: Wed, 10 Apr 2013 11:13:43 +0200
4 Subject: [PATCH 1/3] mmc: mxs-mmc: add cd-inverted property
6 The card-detect GPIO is inverted on some boards. Handle such case.
12 drivers/mmc/host/mxs-mmc.c | 5 ++++-
13 1 file changed, 4 insertions(+), 1 deletion(-)
15 diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
16 index 4efe302..0cdf1f6 100644
17 --- a/drivers/mmc/host/mxs-mmc.c
18 +++ b/drivers/mmc/host/mxs-mmc.c
19 @@ -72,6 +72,7 @@ struct mxs_mmc_host {
26 static int mxs_mmc_get_ro(struct mmc_host *mmc)
27 @@ -96,7 +97,7 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc)
28 struct mxs_ssp *ssp = &host->ssp;
30 return !(readl(ssp->base + HW_SSP_STATUS(ssp)) &
31 - BM_SSP_STATUS_CARD_DETECT);
32 + BM_SSP_STATUS_CARD_DETECT)) ^ host->cd_inverted;
35 static void mxs_mmc_reset(struct mxs_mmc_host *host)
36 @@ -691,6 +692,8 @@ static int mxs_mmc_probe(struct platform_device *pdev)
37 if (flags & OF_GPIO_ACTIVE_LOW)
38 host->wp_inverted = 1;
40 + host->cd_inverted = of_property_read_bool(np, "cd-inverted");
43 mmc->f_max = 288000000;
44 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;