Skip to contentSkip to conversation

mmc: mxs-mmc: Add support for non-removable cards

PATCH In review Alexandre Pereira da Silva 4 participants 6 messages Apr 5, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: mxs-mmc: Add support for non-removable cards

Some boards and card slots doesn't have card detect feature available. In that case allow to mark the cards as non-removable, via devicetree.

---
 drivers/mmc/host/mxs-mmc.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/mmc/host/mxs-mmc.c +6 -0
index 4efe302..7d2cd74 100644
@@ -95,6 +95,9 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc)
 	struct mxs_mmc_host *host = mmc_priv(mmc);
 	struct mxs_ssp *ssp = &host->ssp;
 
+	if (mmc->caps & MMC_CAP_NONREMOVABLE)
+		return 1;
+
 	return !(readl(ssp->base + HW_SSP_STATUS(ssp)) &
 		 BM_SSP_STATUS_CARD_DETECT);
 }
@@ -691,6 +694,9 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	if (flags & OF_GPIO_ACTIVE_LOW)
 		host->wp_inverted = 1;
 
+	if (of_find_property(np, "non-removable", NULL))
+		mmc->caps |= MMC_CAP_NONREMOVABLE;
+
 	mmc->f_min = 400000;
 	mmc->f_max = 288000000;
 	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
Signature · 1 line
1.7.10
Reviewed-by on v1 1/1
#1 lore raw

Dear Alexandre Pereira da Silva,

Quoted 4 lines

Some boards and card slots doesn't have card detect feature available. In that case allow to mark the cards as non-removable, via devicetree.

Looks good,

btw. did you know you can let git send-email automatically handle CC for you so you don't have to type it into the command line by simply sticking

in the commit message? Preferably under the SoB line.

Quoted 19 lines
---
 drivers/mmc/host/mxs-mmc.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/mmc/host/mxs-mmc.c +3 -0
index 4efe302..7d2cd74 100644
@@ -95,6 +95,9 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc)
 	struct mxs_mmc_host *host = mmc_priv(mmc);
 	struct mxs_ssp *ssp = &host->ssp;
 
+	if (mmc->caps & MMC_CAP_NONREMOVABLE)
+		return 1;
+
 	return !(readl(ssp->base + HW_SSP_STATUS(ssp)) &
 		 BM_SSP_STATUS_CARD_DETECT);
 }

drivers/mmc/host/mxs-mmc.c static int mxs_mmc_probe(struct platform_device *pdev) · line 702

Quoted 9 lines
drivers/mmc/host/mxs-mmc.c +3 -0
@@ -691,6 +694,9 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	if (flags & OF_GPIO_ACTIVE_LOW)
 		host->wp_inverted = 1;
 
+	if (of_find_property(np, "non-removable", NULL))
+		mmc->caps |= MMC_CAP_NONREMOVABLE;
+
 	mmc->f_min = 400000;
 	mmc->f_max = 288000000;
 	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;

Best regards,
Marek Vasut

#2 lore raw
Quoted 6 lines · Marek Vasut

btw. did you know you can let git send-email automatically handle CC for you so you don't have to type it into the command line by simply sticking

in the commit message? Preferably under the SoB line.

Though not everyone likes seeing things like that end up in the commit log (or having to edit them out of commit logs).

#3 lore raw

Dear Mark Brown,

Quoted 11 lines · Marek Vasut
Quoted 7 lines

btw. did you know you can let git send-email automatically handle CC for you so you don't have to type it into the command line by simply sticking

in the commit message? Preferably under the SoB line.

Though not everyone likes seeing things like that end up in the commit log (or having to edit them out of commit logs).

Ah, all right.

Best regards,
Marek Vasut

#4 lore raw
In reply to Alexandre Pereira da Silva
Quoted 4 lines · Alexandre Pereira da Silva

Some boards and card slots doesn't have card detect feature available. In that case allow to mark the cards as non-removable, via devicetree.

Marc already sent a similar patch[1] for that.

Shawn

[1] http://thread.gmane.org/gmane.linux.kernel.mmc/19823/focus=19825

Quoted 31 lines
---
 drivers/mmc/host/mxs-mmc.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/mmc/host/mxs-mmc.c +6 -0
index 4efe302..7d2cd74 100644
@@ -95,6 +95,9 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc)
 	struct mxs_mmc_host *host = mmc_priv(mmc);
 	struct mxs_ssp *ssp = &host->ssp;
 
+	if (mmc->caps & MMC_CAP_NONREMOVABLE)
+		return 1;
+
 	return !(readl(ssp->base + HW_SSP_STATUS(ssp)) &
 		 BM_SSP_STATUS_CARD_DETECT);
 }
@@ -691,6 +694,9 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	if (flags & OF_GPIO_ACTIVE_LOW)
 		host->wp_inverted = 1;
 
+	if (of_find_property(np, "non-removable", NULL))
+		mmc->caps |= MMC_CAP_NONREMOVABLE;
+
 	mmc->f_min = 400000;
 	mmc->f_max = 288000000;
 	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
Signature · 1 line
1.7.10