diff options
author | Jarkko Nikula <jarkko.nikula@bitmer.com> | 2014-02-22 11:01:43 -0500 |
---|---|---|
committer | Chris Ball <chris@printf.net> | 2014-02-22 13:17:42 -0500 |
commit | b13d1f0f9ad64bc498ced07344495ba27321419e (patch) | |
tree | 989ab276a071cf979de2c9fcbedca91b7483db2c /drivers/mmc/host/omap.c | |
parent | a6c668fb95ac655fe94c08c1fb419f685040cf23 (diff) |
mmc: omap: Add erase capability
This patch adds the erase capability to OMAP1/OMAP2420 MMC driver. Idea is
the same than in commit 93caf8e ("omap_hsmmc: add erase capability") that we
disable the data timeout interrupt for erases.
Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Chris Ball <chris@printf.net>
Diffstat (limited to 'drivers/mmc/host/omap.c')
-rw-r--r-- | drivers/mmc/host/omap.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index 42175cd90435..5c2e58b29305 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/omap-dma.h> | 26 | #include <linux/omap-dma.h> |
27 | #include <linux/mmc/host.h> | 27 | #include <linux/mmc/host.h> |
28 | #include <linux/mmc/card.h> | 28 | #include <linux/mmc/card.h> |
29 | #include <linux/mmc/mmc.h> | ||
29 | #include <linux/clk.h> | 30 | #include <linux/clk.h> |
30 | #include <linux/scatterlist.h> | 31 | #include <linux/scatterlist.h> |
31 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
@@ -336,6 +337,7 @@ mmc_omap_start_command(struct mmc_omap_host *host, struct mmc_command *cmd) | |||
336 | u32 cmdreg; | 337 | u32 cmdreg; |
337 | u32 resptype; | 338 | u32 resptype; |
338 | u32 cmdtype; | 339 | u32 cmdtype; |
340 | u16 irq_mask; | ||
339 | 341 | ||
340 | host->cmd = cmd; | 342 | host->cmd = cmd; |
341 | 343 | ||
@@ -388,12 +390,14 @@ mmc_omap_start_command(struct mmc_omap_host *host, struct mmc_command *cmd) | |||
388 | OMAP_MMC_WRITE(host, CTO, 200); | 390 | OMAP_MMC_WRITE(host, CTO, 200); |
389 | OMAP_MMC_WRITE(host, ARGL, cmd->arg & 0xffff); | 391 | OMAP_MMC_WRITE(host, ARGL, cmd->arg & 0xffff); |
390 | OMAP_MMC_WRITE(host, ARGH, cmd->arg >> 16); | 392 | OMAP_MMC_WRITE(host, ARGH, cmd->arg >> 16); |
391 | OMAP_MMC_WRITE(host, IE, | 393 | irq_mask = OMAP_MMC_STAT_A_EMPTY | OMAP_MMC_STAT_A_FULL | |
392 | OMAP_MMC_STAT_A_EMPTY | OMAP_MMC_STAT_A_FULL | | 394 | OMAP_MMC_STAT_CMD_CRC | OMAP_MMC_STAT_CMD_TOUT | |
393 | OMAP_MMC_STAT_CMD_CRC | OMAP_MMC_STAT_CMD_TOUT | | 395 | OMAP_MMC_STAT_DATA_CRC | OMAP_MMC_STAT_DATA_TOUT | |
394 | OMAP_MMC_STAT_DATA_CRC | OMAP_MMC_STAT_DATA_TOUT | | 396 | OMAP_MMC_STAT_END_OF_CMD | OMAP_MMC_STAT_CARD_ERR | |
395 | OMAP_MMC_STAT_END_OF_CMD | OMAP_MMC_STAT_CARD_ERR | | 397 | OMAP_MMC_STAT_END_OF_DATA; |
396 | OMAP_MMC_STAT_END_OF_DATA); | 398 | if (cmd->opcode == MMC_ERASE) |
399 | irq_mask &= ~OMAP_MMC_STAT_DATA_TOUT; | ||
400 | OMAP_MMC_WRITE(host, IE, irq_mask); | ||
397 | OMAP_MMC_WRITE(host, CMD, cmdreg); | 401 | OMAP_MMC_WRITE(host, CMD, cmdreg); |
398 | } | 402 | } |
399 | 403 | ||
@@ -1234,7 +1238,7 @@ static int mmc_omap_new_slot(struct mmc_omap_host *host, int id) | |||
1234 | 1238 | ||
1235 | mmc->caps = 0; | 1239 | mmc->caps = 0; |
1236 | if (host->pdata->slots[id].wires >= 4) | 1240 | if (host->pdata->slots[id].wires >= 4) |
1237 | mmc->caps |= MMC_CAP_4_BIT_DATA; | 1241 | mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_ERASE; |
1238 | 1242 | ||
1239 | mmc->ops = &mmc_omap_ops; | 1243 | mmc->ops = &mmc_omap_ops; |
1240 | mmc->f_min = 400000; | 1244 | mmc->f_min = 400000; |