diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2005-09-06 18:18:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:51 -0400 |
commit | e619524fe5f5b0c13db34ed0f6320d2dcccf6e8d (patch) | |
tree | 1a87719691e0b9382693010c148efd4b26138395 | |
parent | 5b4fd9aef778e223968dfab1b90f905b3f2bd23d (diff) |
[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>
-rw-r--r-- | drivers/mmc/pxamci.c | 11 | ||||
-rw-r--r-- | include/asm-arm/arch-pxa/mmc.h | 1 |
2 files changed, 12 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) | |||
362 | pxamci_start_cmd(host, mrq->cmd, cmdat); | 362 | pxamci_start_cmd(host, mrq->cmd, cmdat); |
363 | } | 363 | } |
364 | 364 | ||
365 | static int pxamci_get_ro(struct mmc_host *mmc) | ||
366 | { | ||
367 | struct pxamci_host *host = mmc_priv(mmc); | ||
368 | |||
369 | if (host->pdata && host->pdata->get_ro) | ||
370 | return host->pdata->get_ro(mmc->dev); | ||
371 | /* Host doesn't support read only detection so assume writeable */ | ||
372 | return 0; | ||
373 | } | ||
374 | |||
365 | static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | 375 | static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) |
366 | { | 376 | { |
367 | struct pxamci_host *host = mmc_priv(mmc); | 377 | struct pxamci_host *host = mmc_priv(mmc); |
@@ -401,6 +411,7 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
401 | 411 | ||
402 | static struct mmc_host_ops pxamci_ops = { | 412 | static struct mmc_host_ops pxamci_ops = { |
403 | .request = pxamci_request, | 413 | .request = pxamci_request, |
414 | .get_ro = pxamci_get_ro, | ||
404 | .set_ios = pxamci_set_ios, | 415 | .set_ios = pxamci_set_ios, |
405 | }; | 416 | }; |
406 | 417 | ||
diff --git a/include/asm-arm/arch-pxa/mmc.h b/include/asm-arm/arch-pxa/mmc.h index 7492ea7ea614..9718063a2119 100644 --- a/include/asm-arm/arch-pxa/mmc.h +++ b/include/asm-arm/arch-pxa/mmc.h | |||
@@ -10,6 +10,7 @@ struct mmc_host; | |||
10 | struct pxamci_platform_data { | 10 | struct pxamci_platform_data { |
11 | unsigned int ocr_mask; /* available voltages */ | 11 | unsigned int ocr_mask; /* available voltages */ |
12 | int (*init)(struct device *, irqreturn_t (*)(int, void *, struct pt_regs *), void *); | 12 | int (*init)(struct device *, irqreturn_t (*)(int, void *, struct pt_regs *), void *); |
13 | int (*get_ro)(struct device *); | ||
13 | void (*setpower)(struct device *, unsigned int); | 14 | void (*setpower)(struct device *, unsigned int); |
14 | void (*exit)(struct device *, void *); | 15 | void (*exit)(struct device *, void *); |
15 | }; | 16 | }; |