[PATCH 2/2] glamo-mci: add a "nonremovable" field to glamo_mmc_platform_data

Thibaut Girka thib at sitedethib.com
Wed Jun 30 19:02:05 CEST 2010


On the FR, the µSD can't be removed without removing the battery first.
So, we can safely assume that the µSD is not removable.

This patch make the MMC subsystem know that the card isn't removable if the new
"nonremovable" field in the platform data is true.

This affects, amongst other things, the suspend/resume process, the default
behaviour being to remove the card (after syncind any mounted FS) on suspend,
and re-detect it on resume, to prevent errors when removing the card while
the device is suspended.
---
 drivers/mmc/host/glamo-mci.c |    4 ++++
 include/linux/mfd/glamo.h    |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/glamo-mci.c b/drivers/mmc/host/glamo-mci.c
index 923c1ce..f07ad09 100644
--- a/drivers/mmc/host/glamo-mci.c
+++ b/drivers/mmc/host/glamo-mci.c
@@ -812,6 +812,10 @@ static int glamo_mci_probe(struct platform_device *pdev)
 	mmc->caps	= MMC_CAP_4_BIT_DATA |
 			    MMC_CAP_MMC_HIGHSPEED |
 			    MMC_CAP_SD_HIGHSPEED;
+
+	if (host->pdata->nonremovable)
+		mmc->caps |= MMC_CAP_NONREMOVABLE;
+
 	mmc->f_min	= host->clk_rate / 256;
 	mmc->f_max	= sd_max_clk;
 
diff --git a/include/linux/mfd/glamo.h b/include/linux/mfd/glamo.h
index 529d4f0..ae52f3d 100644
--- a/include/linux/mfd/glamo.h
+++ b/include/linux/mfd/glamo.h
@@ -8,6 +8,8 @@ struct glamo_fb_platform_data;
 struct glamo_mmc_platform_data {
 	int	(*glamo_mmc_use_slow)(void);
 
+	unsigned nonremovable:1;
+
 	struct glamo_core *core;
 };
 
-- 
1.7.1




More information about the openmoko-kernel mailing list