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>
 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 = {
 
 #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;