diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-06-30 22:40:30 +0100 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2008-07-15 14:14:47 +0200 |
commit | cf0984c8edf63017fcc2ead212ca057877e345df (patch) | |
tree | bcd9e4b23eb0da4b201e1ff4e0f86d3d3420b514 /drivers/mmc/host/s3cmci.c | |
parent | edb5a98e43682d66c98ddd1dee863d867807546e (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>
Diffstat (limited to 'drivers/mmc/host/s3cmci.c')
-rw-r--r-- | drivers/mmc/host/s3cmci.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c index 684a10ca2e8..4fd11d8864e 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 = { |