All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Nikula <jarkko.nikula@bitmer.com>
To: Chris Ball <cjb@laptop.org>
Cc: linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org,
	Tony Lindgren <tony@atomide.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	Jarkko Lavinen <j.lavinen@samsung.com>,
	Jarkko Nikula <jarkko.nikula@bitmer.com>
Subject: [PATCH 7/7] mmc: omap: Add erase capability
Date: Wed,  4 Dec 2013 21:14:14 +0000	[thread overview]
Message-ID: <1386191654-7686-8-git-send-email-jarkko.nikula@bitmer.com> (raw)
In-Reply-To: <1386191654-7686-1-git-send-email-jarkko.nikula@bitmer.com>

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>
---
 drivers/mmc/host/omap.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 42175cd..5c2e58b 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -26,6 +26,7 @@
 #include <linux/omap-dma.h>
 #include <linux/mmc/host.h>
 #include <linux/mmc/card.h>
+#include <linux/mmc/mmc.h>
 #include <linux/clk.h>
 #include <linux/scatterlist.h>
 #include <linux/slab.h>
@@ -336,6 +337,7 @@ mmc_omap_start_command(struct mmc_omap_host *host, struct mmc_command *cmd)
 	u32 cmdreg;
 	u32 resptype;
 	u32 cmdtype;
+	u16 irq_mask;
 
 	host->cmd = cmd;
 
@@ -388,12 +390,14 @@ mmc_omap_start_command(struct mmc_omap_host *host, struct mmc_command *cmd)
 	OMAP_MMC_WRITE(host, CTO, 200);
 	OMAP_MMC_WRITE(host, ARGL, cmd->arg & 0xffff);
 	OMAP_MMC_WRITE(host, ARGH, cmd->arg >> 16);
-	OMAP_MMC_WRITE(host, IE,
-		       OMAP_MMC_STAT_A_EMPTY    | OMAP_MMC_STAT_A_FULL    |
-		       OMAP_MMC_STAT_CMD_CRC    | OMAP_MMC_STAT_CMD_TOUT  |
-		       OMAP_MMC_STAT_DATA_CRC   | OMAP_MMC_STAT_DATA_TOUT |
-		       OMAP_MMC_STAT_END_OF_CMD | OMAP_MMC_STAT_CARD_ERR  |
-		       OMAP_MMC_STAT_END_OF_DATA);
+	irq_mask = OMAP_MMC_STAT_A_EMPTY    | OMAP_MMC_STAT_A_FULL    |
+		   OMAP_MMC_STAT_CMD_CRC    | OMAP_MMC_STAT_CMD_TOUT  |
+		   OMAP_MMC_STAT_DATA_CRC   | OMAP_MMC_STAT_DATA_TOUT |
+		   OMAP_MMC_STAT_END_OF_CMD | OMAP_MMC_STAT_CARD_ERR  |
+		   OMAP_MMC_STAT_END_OF_DATA;
+	if (cmd->opcode == MMC_ERASE)
+		irq_mask &= ~OMAP_MMC_STAT_DATA_TOUT;
+	OMAP_MMC_WRITE(host, IE, irq_mask);
 	OMAP_MMC_WRITE(host, CMD, cmdreg);
 }
 
@@ -1234,7 +1238,7 @@ static int mmc_omap_new_slot(struct mmc_omap_host *host, int id)
 
 	mmc->caps = 0;
 	if (host->pdata->slots[id].wires >= 4)
-		mmc->caps |= MMC_CAP_4_BIT_DATA;
+		mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_ERASE;
 
 	mmc->ops = &mmc_omap_ops;
 	mmc->f_min = 400000;
-- 
1.8.4.3


  parent reply	other threads:[~2013-12-04 21:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-02 19:34 [PATCH] mmc: omap: Fix error introduced by fix to release_mem_region() path Tony Lindgren
2013-12-03 18:16 ` Jarkko Nikula
2013-12-04 18:00   ` Tony Lindgren
2013-12-04 18:01 ` Tony Lindgren
2013-12-04 21:14 ` [PATCH 0/7] mmc: omap: Fixes, cleanup and add ERASE capability Jarkko Nikula
2013-12-04 21:14   ` [PATCH 1/7] mmc: omap: Fix NULL pointer dereference due uninitialized cover_tasklet Jarkko Nikula
2013-12-04 21:14   ` [PATCH 2/7] mmc: omap: Convert to devm_kzalloc Jarkko Nikula
2013-12-04 21:14   ` [PATCH 3/7] mmc: omap: Remove duplicate host->irq assignment Jarkko Nikula
2013-12-04 21:14   ` [PATCH 4/7] mmc: omap: Remove mem_res field from struct mmc_omap_host Jarkko Nikula
2013-12-04 21:14   ` [PATCH 5/7] mmc: omap: Convert to devm_ioremap_resource Jarkko Nikula
2013-12-04 21:14   ` [PATCH 6/7] mmc: omap: Remove always set use_dma flag from struct mmc_omap_host Jarkko Nikula
2013-12-04 21:14   ` Jarkko Nikula [this message]
2013-12-05 18:18   ` [PATCH 0/7] mmc: omap: Fixes, cleanup and add ERASE capability Tony Lindgren
2013-12-06 13:41   ` Aaro Koskinen
2013-12-06 19:54     ` Jarkko Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1386191654-7686-8-git-send-email-jarkko.nikula@bitmer.com \
    --to=jarkko.nikula@bitmer.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=cjb@laptop.org \
    --cc=dan.carpenter@oracle.com \
    --cc=j.lavinen@samsung.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.