[PATCH 1/3] MMC compatibility fix - GO_IDLE

From: Pierre Ossman
Date: Sat Sep 18 2004 - 05:02:36 EST


This patch adds a GO_IDLE before sending a new SEND_OP_COND (as required by MMC standard). Index: linux-wbsd/drivers/mmc/mmc.c
===================================================================
--- linux-wbsd/drivers/mmc/mmc.c (revision 57)
+++ linux-wbsd/drivers/mmc/mmc.c (revision 58)
@@ -579,6 +579,8 @@

static void mmc_setup(struct mmc_host *host)
{
+ struct mmc_command cmd;
+
if (host->ios.power_mode != MMC_POWER_ON) {
int err;
u32 ocr;
@@ -613,6 +615,16 @@
if (host->ocr == 0)
return;

+ /* Put cards in idle before sending new OCR */
+
+ cmd.opcode = MMC_GO_IDLE_STATE;
+ cmd.arg = 0;
+ cmd.flags = MMC_RSP_NONE;
+
+ mmc_wait_for_cmd(host, &cmd, 0);
+
+ mmc_delay(1);
+
/*
* Send the selected OCR multiple times... until the cards
* all get the idea that they should be ready for CMD2.