summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)
static int s3cmci_get_ro(struct mmc_host *mmc)
{
struct s3cmci_host *host = mmc_priv(mmc);
+ struct s3c24xx_mci_pdata *pdata = host->pdata;
+ int ret;
- if (host->pdata->gpio_wprotect == 0)
+ if (pdata->gpio_wprotect == 0)
return 0;
- return s3c2410_gpio_getpin(host->pdata->gpio_wprotect);
+ ret = s3c2410_gpio_getpin(pdata->gpio_wprotect);
+
+ if (pdata->wprotect_invert)
+ ret = !ret;
+
+ return ret;
}
static 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 @@
#define _ARCH_MCI_H
struct s3c24xx_mci_pdata {
+ unsigned int wprotect_invert : 1;
+
unsigned int gpio_detect;
unsigned int gpio_wprotect;
unsigned long ocr_avail;