mmc: msm_sdcc: Snoop SDIO_CCCR_ABORT register
authorSan Mehat <san@google.com>
Tue, 3 Nov 2009 02:46:09 +0000 (18:46 -0800)
committerDaniel Walker <dwalker@codeaurora.org>
Thu, 18 Mar 2010 19:57:57 +0000 (12:57 -0700)
Signed-off-by: San Mehat <san@google.com>
Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
drivers/mmc/host/msm_sdcc.c

index 977932a4bf4b630f2b70e1e46dbe3904a61ccc63..f4f7883271f0a4d0e171b6eac91a92bb62302017 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/log2.h>
 #include <linux/mmc/host.h>
 #include <linux/mmc/card.h>
+#include <linux/mmc/sdio.h>
 #include <linux/clk.h>
 #include <linux/scatterlist.h>
 #include <linux/platform_device.h>
@@ -355,6 +356,16 @@ msmsdcc_start_data(struct msmsdcc_host *host, struct mmc_data *data)
        }
 }
 
+static int
+snoop_cccr_abort(struct mmc_command *cmd)
+{
+       if ((cmd->opcode == 52) &&
+           (cmd->arg & 0x80000000) &&
+           (((cmd->arg >> 9) & 0x1ffff) == SDIO_CCCR_ABORT))
+               return 1;
+       return 0;
+}
+
 static void
 msmsdcc_start_command(struct msmsdcc_host *host, struct mmc_command *cmd, u32 c)
 {
@@ -381,6 +392,9 @@ msmsdcc_start_command(struct msmsdcc_host *host, struct mmc_command *cmd, u32 c)
        if (cmd == cmd->mrq->stop)
                c |= MCI_CSPM_MCIABORT;
 
+       if (snoop_cccr_abort(cmd))
+               c |= MCI_CSPM_MCIABORT;
+
        host->curr.cmd = cmd;
 
        host->stats.cmds++;