diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2013-04-10 05:13:44 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-04-12 14:17:46 -0400 |
commit | 5086e5f41fd107539911edf62f2d202753ed1980 (patch) | |
tree | c1fc4ce54584d57390316412d7402bb2d9729c0d | |
parent | 4c0c9be05004d1eb674b7586216b3d93cc04531c (diff) |
mmc: mxs-mmc: add non-removable property
Some boards have non removable cards like eMMC. Handle such case.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r-- | drivers/mmc/host/mxs-mmc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c index 0cdf1f6f3f43..c23188129314 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c | |||
@@ -73,6 +73,7 @@ struct mxs_mmc_host { | |||
73 | int wp_gpio; | 73 | int wp_gpio; |
74 | bool wp_inverted; | 74 | bool wp_inverted; |
75 | bool cd_inverted; | 75 | bool cd_inverted; |
76 | bool non_removable; | ||
76 | }; | 77 | }; |
77 | 78 | ||
78 | static int mxs_mmc_get_ro(struct mmc_host *mmc) | 79 | static int mxs_mmc_get_ro(struct mmc_host *mmc) |
@@ -96,8 +97,9 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc) | |||
96 | struct mxs_mmc_host *host = mmc_priv(mmc); | 97 | struct mxs_mmc_host *host = mmc_priv(mmc); |
97 | struct mxs_ssp *ssp = &host->ssp; | 98 | struct mxs_ssp *ssp = &host->ssp; |
98 | 99 | ||
99 | return !(readl(ssp->base + HW_SSP_STATUS(ssp)) & | 100 | return host->non_removable || |
100 | BM_SSP_STATUS_CARD_DETECT)) ^ host->cd_inverted; | 101 | !(readl(ssp->base + HW_SSP_STATUS(ssp)) & |
102 | BM_SSP_STATUS_CARD_DETECT) ^ host->cd_inverted; | ||
101 | } | 103 | } |
102 | 104 | ||
103 | static void mxs_mmc_reset(struct mxs_mmc_host *host) | 105 | static void mxs_mmc_reset(struct mxs_mmc_host *host) |
@@ -687,8 +689,10 @@ static int mxs_mmc_probe(struct platform_device *pdev) | |||
687 | mmc->caps |= MMC_CAP_4_BIT_DATA; | 689 | mmc->caps |= MMC_CAP_4_BIT_DATA; |
688 | else if (bus_width == 8) | 690 | else if (bus_width == 8) |
689 | mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA; | 691 | mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA; |
692 | host->non_removable = of_property_read_bool(np, "non-removable"); | ||
693 | if (host->non_removable) | ||
694 | mmc->caps |= MMC_CAP_NONREMOVABLE; | ||
690 | host->wp_gpio = of_get_named_gpio_flags(np, "wp-gpios", 0, &flags); | 695 | host->wp_gpio = of_get_named_gpio_flags(np, "wp-gpios", 0, &flags); |
691 | |||
692 | if (flags & OF_GPIO_ACTIVE_LOW) | 696 | if (flags & OF_GPIO_ACTIVE_LOW) |
693 | host->wp_inverted = 1; | 697 | host->wp_inverted = 1; |
694 | 698 | ||