aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2008-06-30 17:40:30 -0400
committerPierre Ossman <drzeus@drzeus.cx>2008-07-15 08:14:47 -0400
commitcf0984c8edf63017fcc2ead212ca057877e345df (patch)
treebcd9e4b23eb0da4b201e1ff4e0f86d3d3420b514
parentedb5a98e43682d66c98ddd1dee863d867807546e (diff)
MMC: S3C24XX: Add support to invert write protect line
Support for inverting the sense of the MMC driver's write protect detection line. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
-rw-r--r--drivers/mmc/host/s3cmci.c11
-rw-r--r--include/asm-arm/plat-s3c24xx/mci.h2
2 files changed, 11 insertions, 2 deletions
diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index 684a10ca2e8f..4fd11d8864eb 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -1083,11 +1083,18 @@ static void s3cmci_reset(struct s3cmci_host *host)
1083static int s3cmci_get_ro(struct mmc_host *mmc) 1083static int s3cmci_get_ro(struct mmc_host *mmc)
1084{ 1084{
1085 struct s3cmci_host *host = mmc_priv(mmc); 1085 struct s3cmci_host *host = mmc_priv(mmc);
1086 struct s3c24xx_mci_pdata *pdata = host->pdata;
1087 int ret;
1086 1088
1087 if (host->pdata->gpio_wprotect == 0) 1089 if (pdata->gpio_wprotect == 0)
1088 return 0; 1090 return 0;
1089 1091
1090 return s3c2410_gpio_getpin(host->pdata->gpio_wprotect); 1092 ret = s3c2410_gpio_getpin(pdata->gpio_wprotect);
1093
1094 if (pdata->wprotect_invert)
1095 ret = !ret;
1096
1097 return ret;
1091} 1098}
1092 1099
1093static struct mmc_host_ops s3cmci_ops = { 1100static struct mmc_host_ops s3cmci_ops = {
diff --git a/include/asm-arm/plat-s3c24xx/mci.h b/include/asm-arm/plat-s3c24xx/mci.h
index 5be2c1449c6d..4f4ccd18f0cb 100644
--- a/include/asm-arm/plat-s3c24xx/mci.h
+++ b/include/asm-arm/plat-s3c24xx/mci.h
@@ -2,6 +2,8 @@
2#define _ARCH_MCI_H 2#define _ARCH_MCI_H
3 3
4struct s3c24xx_mci_pdata { 4struct s3c24xx_mci_pdata {
5 unsigned int wprotect_invert : 1;
6
5 unsigned int gpio_detect; 7 unsigned int gpio_detect;
6 unsigned int gpio_wprotect; 8 unsigned int gpio_wprotect;
7 unsigned long ocr_avail; 9 unsigned long ocr_avail;