]> Git Repo - buildroot-mgba.git/blob - board/olimex/imx233_olinuxino/linux-01-mmc-mxs-mmc-add-cd-inverted-property.patch
configs: add sample for olimex mx233 olinuxino
[buildroot-mgba.git] / board / olimex / imx233_olinuxino / linux-01-mmc-mxs-mmc-add-cd-inverted-property.patch
1 From 4c0c9be05004d1eb674b7586216b3d93cc04531c Mon Sep 17 00:00:00 2001
2 From: Marc Kleine-Budde <[email protected]>
3 Date: Wed, 10 Apr 2013 11:13:43 +0200
4 Subject: [PATCH 1/3] mmc: mxs-mmc: add cd-inverted property
5
6 The card-detect GPIO is inverted on some boards. Handle such case.
7
8 Acked-by: Shawn Guo <[email protected]>
9 Signed-off-by: Marc Kleine-Budde <[email protected]>
10 Signed-off-by: Chris Ball <[email protected]>
11 ---
12  drivers/mmc/host/mxs-mmc.c | 5 ++++-
13  1 file changed, 4 insertions(+), 1 deletion(-)
14
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 {
20         int                             sdio_irq_en;
21         int                             wp_gpio;
22         bool                            wp_inverted;
23 +       bool                            cd_inverted;
24  };
25
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;
29
30         return !(readl(ssp->base + HW_SSP_STATUS(ssp)) &
31 -                BM_SSP_STATUS_CARD_DETECT);
32 +                BM_SSP_STATUS_CARD_DETECT)) ^ host->cd_inverted;
33  }
34
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;
39
40 +       host->cd_inverted = of_property_read_bool(np, "cd-inverted");
41 +
42         mmc->f_min = 400000;
43         mmc->f_max = 288000000;
44         mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
45 --
46 1.8.1.5
47
This page took 0.026296 seconds and 4 git commands to generate.