From 1b3b2631842ab60c1b7923bef102c610439ba3dd Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Aguiar Date: Mon, 15 Jan 2007 06:38:15 +0100 Subject: omap: Update MMC response types This patch is a fix in order to update MMC response types. This modification is needed to allow SD card support on OMAP platforms. Signed-off-by: Carlos Eduardo Aguiar Signed-off-by: Yuha Yrjola Signed-off-by: Pierre Ossman --- drivers/mmc/omap.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/omap.c b/drivers/mmc/omap.c index 9488408308f..1e5407d44df 100644 --- a/drivers/mmc/omap.c +++ b/drivers/mmc/omap.c @@ -91,7 +91,6 @@ #define DRIVER_NAME "mmci-omap" -#define RSP_TYPE(x) ((x) & ~(MMC_RSP_BUSY|MMC_RSP_OPCODE)) /* Specifies how often in millisecs to poll for card status changes * when the cover switch is open */ @@ -204,18 +203,25 @@ mmc_omap_start_command(struct mmc_omap_host *host, struct mmc_command *cmd) cmdtype = 0; /* Our hardware needs to know exact type */ - switch (RSP_TYPE(mmc_resp_type(cmd))) { - case RSP_TYPE(MMC_RSP_R1): + switch (mmc_resp_type(cmd)) { + case MMC_RSP_NONE: + break; + case MMC_RSP_R1: + case MMC_RSP_R1B: /* resp 1, resp 1b */ resptype = 1; break; - case RSP_TYPE(MMC_RSP_R2): + case MMC_RSP_R2: resptype = 2; break; - case RSP_TYPE(MMC_RSP_R3): + case MMC_RSP_R3: resptype = 3; break; + case MMC_RSP_R6: + resptype = 6; + break; default: + dev_err(mmc_dev(host->mmc), "Invalid response type: %04x\n", mmc_resp_type(cmd)); break; } -- cgit v1.2.3 From 6f949909e8f9e5d7e5584dc48d9a5e060c52aed1 Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Thu, 4 Jan 2007 07:04:47 -0800 Subject: mmc: Correct definition of R6 During development of SDHC support, it was discovered that the definition for R6 was incorrect. This patch fixes that and patches the drivers that do switch on the response type. Signed-off-by: Philip Langdale Cc: Alex Dubov Cc: Pavel Pisa Signed-off-by: Pierre Ossman --- drivers/mmc/imxmmc.c | 3 --- drivers/mmc/omap.c | 5 +---- drivers/mmc/pxamci.c | 2 +- drivers/mmc/tifm_sd.c | 3 --- include/linux/mmc/mmc.h | 2 +- 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/imxmmc.c b/drivers/mmc/imxmmc.c index 06e7fcd1922..bfb9ff69320 100644 --- a/drivers/mmc/imxmmc.c +++ b/drivers/mmc/imxmmc.c @@ -351,9 +351,6 @@ static void imxmci_start_cmd(struct imxmci_host *host, struct mmc_command *cmd, case MMC_RSP_R3: /* short */ cmdat |= CMD_DAT_CONT_RESPONSE_FORMAT_R3; break; - case MMC_RSP_R6: /* short CRC */ - cmdat |= CMD_DAT_CONT_RESPONSE_FORMAT_R6; - break; default: break; } diff --git a/drivers/mmc/omap.c b/drivers/mmc/omap.c index 1e5407d44df..d30540b2761 100644 --- a/drivers/mmc/omap.c +++ b/drivers/mmc/omap.c @@ -208,7 +208,7 @@ mmc_omap_start_command(struct mmc_omap_host *host, struct mmc_command *cmd) break; case MMC_RSP_R1: case MMC_RSP_R1B: - /* resp 1, resp 1b */ + /* resp 1, 1b, 6, 7 */ resptype = 1; break; case MMC_RSP_R2: @@ -217,9 +217,6 @@ mmc_omap_start_command(struct mmc_omap_host *host, struct mmc_command *cmd) case MMC_RSP_R3: resptype = 3; break; - case MMC_RSP_R6: - resptype = 6; - break; default: dev_err(mmc_dev(host->mmc), "Invalid response type: %04x\n", mmc_resp_type(cmd)); break; diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c index 45a9283ce49..6073d998b11 100644 --- a/drivers/mmc/pxamci.c +++ b/drivers/mmc/pxamci.c @@ -171,7 +171,7 @@ static void pxamci_start_cmd(struct pxamci_host *host, struct mmc_command *cmd, #define RSP_TYPE(x) ((x) & ~(MMC_RSP_BUSY|MMC_RSP_OPCODE)) switch (RSP_TYPE(mmc_resp_type(cmd))) { - case RSP_TYPE(MMC_RSP_R1): /* r1, r1b, r6 */ + case RSP_TYPE(MMC_RSP_R1): /* r1, r1b, r6, r7 */ cmdat |= CMDAT_RESP_SHORT; break; case RSP_TYPE(MMC_RSP_R3): diff --git a/drivers/mmc/tifm_sd.c b/drivers/mmc/tifm_sd.c index f18ad998b3c..fa4a52886b9 100644 --- a/drivers/mmc/tifm_sd.c +++ b/drivers/mmc/tifm_sd.c @@ -173,9 +173,6 @@ static unsigned int tifm_sd_op_flags(struct mmc_command *cmd) case MMC_RSP_R3: rc |= TIFM_MMCSD_RSP_R3; break; - case MMC_RSP_R6: - rc |= TIFM_MMCSD_RSP_R6; - break; default: BUG(); } diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index a3594dfd696..bcf24909d67 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h @@ -42,7 +42,7 @@ struct mmc_command { #define MMC_RSP_R1B (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY) #define MMC_RSP_R2 (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC) #define MMC_RSP_R3 (MMC_RSP_PRESENT) -#define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC) +#define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE) #define mmc_resp_type(cmd) ((cmd)->flags & (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC|MMC_RSP_BUSY|MMC_RSP_OPCODE)) -- cgit v1.2.3