diff options
author | Adrian Hunter <adrian.hunter@nokia.com> | 2010-08-11 17:17:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-12 11:43:30 -0400 |
commit | 93caf8e69eac763f6a20cf253ace8e7fc1ab7953 (patch) | |
tree | 0c8e4832caba4c3c5caa6b64ba54aac194637b80 /drivers/mmc | |
parent | bd788c9665fb7c543aac21317059375632343337 (diff) |
omap_hsmmc: add erase capability
Disable the data (busy) timeout for erases and set the MMC_CAP_ERASE
capability.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: Jens Axboe <axboe@kernel.dk>
Cc: Kyungmin Park <kmpark@infradead.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ben Gardiner <bengardiner@nanometrics.ca>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index dc57ef6aef4f..4a8776f8afdd 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/clk.h> | 28 | #include <linux/clk.h> |
29 | #include <linux/mmc/host.h> | 29 | #include <linux/mmc/host.h> |
30 | #include <linux/mmc/core.h> | 30 | #include <linux/mmc/core.h> |
31 | #include <linux/mmc/mmc.h> | ||
31 | #include <linux/io.h> | 32 | #include <linux/io.h> |
32 | #include <linux/semaphore.h> | 33 | #include <linux/semaphore.h> |
33 | #include <linux/gpio.h> | 34 | #include <linux/gpio.h> |
@@ -78,6 +79,7 @@ | |||
78 | #define INT_EN_MASK 0x307F0033 | 79 | #define INT_EN_MASK 0x307F0033 |
79 | #define BWR_ENABLE (1 << 4) | 80 | #define BWR_ENABLE (1 << 4) |
80 | #define BRR_ENABLE (1 << 5) | 81 | #define BRR_ENABLE (1 << 5) |
82 | #define DTO_ENABLE (1 << 20) | ||
81 | #define INIT_STREAM (1 << 1) | 83 | #define INIT_STREAM (1 << 1) |
82 | #define DP_SELECT (1 << 21) | 84 | #define DP_SELECT (1 << 21) |
83 | #define DDIR (1 << 4) | 85 | #define DDIR (1 << 4) |
@@ -523,7 +525,8 @@ static void omap_hsmmc_stop_clock(struct omap_hsmmc_host *host) | |||
523 | dev_dbg(mmc_dev(host->mmc), "MMC Clock is not stoped\n"); | 525 | dev_dbg(mmc_dev(host->mmc), "MMC Clock is not stoped\n"); |
524 | } | 526 | } |
525 | 527 | ||
526 | static void omap_hsmmc_enable_irq(struct omap_hsmmc_host *host) | 528 | static void omap_hsmmc_enable_irq(struct omap_hsmmc_host *host, |
529 | struct mmc_command *cmd) | ||
527 | { | 530 | { |
528 | unsigned int irq_mask; | 531 | unsigned int irq_mask; |
529 | 532 | ||
@@ -532,6 +535,10 @@ static void omap_hsmmc_enable_irq(struct omap_hsmmc_host *host) | |||
532 | else | 535 | else |
533 | irq_mask = INT_EN_MASK; | 536 | irq_mask = INT_EN_MASK; |
534 | 537 | ||
538 | /* Disable timeout for erases */ | ||
539 | if (cmd->opcode == MMC_ERASE) | ||
540 | irq_mask &= ~DTO_ENABLE; | ||
541 | |||
535 | OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR); | 542 | OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR); |
536 | OMAP_HSMMC_WRITE(host->base, ISE, irq_mask); | 543 | OMAP_HSMMC_WRITE(host->base, ISE, irq_mask); |
537 | OMAP_HSMMC_WRITE(host->base, IE, irq_mask); | 544 | OMAP_HSMMC_WRITE(host->base, IE, irq_mask); |
@@ -782,7 +789,7 @@ omap_hsmmc_start_command(struct omap_hsmmc_host *host, struct mmc_command *cmd, | |||
782 | mmc_hostname(host->mmc), cmd->opcode, cmd->arg); | 789 | mmc_hostname(host->mmc), cmd->opcode, cmd->arg); |
783 | host->cmd = cmd; | 790 | host->cmd = cmd; |
784 | 791 | ||
785 | omap_hsmmc_enable_irq(host); | 792 | omap_hsmmc_enable_irq(host, cmd); |
786 | 793 | ||
787 | host->response_busy = 0; | 794 | host->response_busy = 0; |
788 | if (cmd->flags & MMC_RSP_PRESENT) { | 795 | if (cmd->flags & MMC_RSP_PRESENT) { |
@@ -2107,7 +2114,7 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) | |||
2107 | mmc->max_seg_size = mmc->max_req_size; | 2114 | mmc->max_seg_size = mmc->max_req_size; |
2108 | 2115 | ||
2109 | mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | | 2116 | mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | |
2110 | MMC_CAP_WAIT_WHILE_BUSY; | 2117 | MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_ERASE; |
2111 | 2118 | ||
2112 | switch (mmc_slot(host).wires) { | 2119 | switch (mmc_slot(host).wires) { |
2113 | case 8: | 2120 | case 8: |