summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2005-09-06 15:18:56 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-07 16:57:51 -0700
commite619524fe5f5b0c13db34ed0f6320d2dcccf6e8d (patch)
tree1a87719691e0b9382693010c148efd4b26138395 /drivers/mmc
parent5b4fd9aef778e223968dfab1b90f905b3f2bd23d (diff)
downloadblackbird-op-linux-e619524fe5f5b0c13db34ed0f6320d2dcccf6e8d.tar.gz
blackbird-op-linux-e619524fe5f5b0c13db34ed0f6320d2dcccf6e8d.zip
[PATCH] Add write protection switch handling to the PXA MMC driver
Add a write protection switch handling code to the PXA MMC driver so that platform specific code can provide it if available. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/pxamci.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c
index b78beb1b0159..e99a53b09e32 100644
--- a/drivers/mmc/pxamci.c
+++ b/drivers/mmc/pxamci.c
@@ -362,6 +362,16 @@ static void pxamci_request(struct mmc_host *mmc, struct mmc_request *mrq)
pxamci_start_cmd(host, mrq->cmd, cmdat);
}
+static int pxamci_get_ro(struct mmc_host *mmc)
+{
+ struct pxamci_host *host = mmc_priv(mmc);
+
+ if (host->pdata && host->pdata->get_ro)
+ return host->pdata->get_ro(mmc->dev);
+ /* Host doesn't support read only detection so assume writeable */
+ return 0;
+}
+
static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{
struct pxamci_host *host = mmc_priv(mmc);
@@ -401,6 +411,7 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
static struct mmc_host_ops pxamci_ops = {
.request = pxamci_request,
+ .get_ro = pxamci_get_ro,
.set_ios = pxamci_set_ios,
};
OpenPOWER on IntegriCloud