diff options
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/core/sd.c | 26 | ||||
-rw-r--r-- | drivers/mmc/host/at91_mci.c | 5 | ||||
-rw-r--r-- | drivers/mmc/host/au1xmmc.c | 3 |
3 files changed, 24 insertions, 10 deletions
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index c1dfd03d559a..41bfb5dfe6ff 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/mmc/host.h> | 15 | #include <linux/mmc/host.h> |
16 | #include <linux/mmc/card.h> | 16 | #include <linux/mmc/card.h> |
17 | #include <linux/mmc/mmc.h> | 17 | #include <linux/mmc/mmc.h> |
18 | #include <linux/mmc/sd.h> | ||
18 | 19 | ||
19 | #include "core.h" | 20 | #include "core.h" |
20 | #include "sysfs.h" | 21 | #include "sysfs.h" |
@@ -192,6 +193,16 @@ static int mmc_read_switch(struct mmc_card *card) | |||
192 | int err; | 193 | int err; |
193 | u8 *status; | 194 | u8 *status; |
194 | 195 | ||
196 | if (card->scr.sda_vsn < SCR_SPEC_VER_1) | ||
197 | return MMC_ERR_NONE; | ||
198 | |||
199 | if (!(card->csd.cmdclass & CCC_SWITCH)) { | ||
200 | printk(KERN_WARNING "%s: card lacks mandatory switch " | ||
201 | "function, performance might suffer.\n", | ||
202 | mmc_hostname(card->host)); | ||
203 | return MMC_ERR_NONE; | ||
204 | } | ||
205 | |||
195 | err = MMC_ERR_FAILED; | 206 | err = MMC_ERR_FAILED; |
196 | 207 | ||
197 | status = kmalloc(64, GFP_KERNEL); | 208 | status = kmalloc(64, GFP_KERNEL); |
@@ -204,10 +215,9 @@ static int mmc_read_switch(struct mmc_card *card) | |||
204 | 215 | ||
205 | err = mmc_sd_switch(card, 0, 0, 1, status); | 216 | err = mmc_sd_switch(card, 0, 0, 1, status); |
206 | if (err != MMC_ERR_NONE) { | 217 | if (err != MMC_ERR_NONE) { |
207 | /* | 218 | printk(KERN_WARNING "%s: problem reading switch " |
208 | * Card not supporting high-speed will ignore the | 219 | "capabilities, performance might suffer.\n", |
209 | * command. | 220 | mmc_hostname(card->host)); |
210 | */ | ||
211 | err = MMC_ERR_NONE; | 221 | err = MMC_ERR_NONE; |
212 | goto out; | 222 | goto out; |
213 | } | 223 | } |
@@ -229,6 +239,12 @@ static int mmc_switch_hs(struct mmc_card *card) | |||
229 | int err; | 239 | int err; |
230 | u8 *status; | 240 | u8 *status; |
231 | 241 | ||
242 | if (card->scr.sda_vsn < SCR_SPEC_VER_1) | ||
243 | return MMC_ERR_NONE; | ||
244 | |||
245 | if (!(card->csd.cmdclass & CCC_SWITCH)) | ||
246 | return MMC_ERR_NONE; | ||
247 | |||
232 | if (!(card->host->caps & MMC_CAP_SD_HIGHSPEED)) | 248 | if (!(card->host->caps & MMC_CAP_SD_HIGHSPEED)) |
233 | return MMC_ERR_NONE; | 249 | return MMC_ERR_NONE; |
234 | 250 | ||
@@ -402,7 +418,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, | |||
402 | /* | 418 | /* |
403 | * Switch to wider bus (if supported). | 419 | * Switch to wider bus (if supported). |
404 | */ | 420 | */ |
405 | if ((host->caps && MMC_CAP_4_BIT_DATA) && | 421 | if ((host->caps & MMC_CAP_4_BIT_DATA) && |
406 | (card->scr.bus_widths & SD_SCR_BUS_WIDTH_4)) { | 422 | (card->scr.bus_widths & SD_SCR_BUS_WIDTH_4)) { |
407 | err = mmc_app_set_bus_width(card, MMC_BUS_WIDTH_4); | 423 | err = mmc_app_set_bus_width(card, MMC_BUS_WIDTH_4); |
408 | if (err != MMC_ERR_NONE) | 424 | if (err != MMC_ERR_NONE) |
diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c index e37943c314cb..5b00c194b628 100644 --- a/drivers/mmc/host/at91_mci.c +++ b/drivers/mmc/host/at91_mci.c | |||
@@ -417,7 +417,7 @@ static unsigned int at91_mci_send_command(struct at91mci_host *host, struct mmc_ | |||
417 | blocks = 0; | 417 | blocks = 0; |
418 | } | 418 | } |
419 | 419 | ||
420 | if (cmd->opcode == MMC_STOP_TRANSMISSION) | 420 | if (host->flags & FL_SENT_STOP) |
421 | cmdr |= AT91_MCI_TRCMD_STOP; | 421 | cmdr |= AT91_MCI_TRCMD_STOP; |
422 | 422 | ||
423 | if (host->bus_mode == MMC_BUSMODE_OPENDRAIN) | 423 | if (host->bus_mode == MMC_BUSMODE_OPENDRAIN) |
@@ -563,8 +563,7 @@ static void at91mci_completed_command(struct at91mci_host *host) | |||
563 | if (status & (AT91_MCI_RINDE | AT91_MCI_RDIRE | AT91_MCI_RCRCE | | 563 | if (status & (AT91_MCI_RINDE | AT91_MCI_RDIRE | AT91_MCI_RCRCE | |
564 | AT91_MCI_RENDE | AT91_MCI_RTOE | AT91_MCI_DCRCE | | 564 | AT91_MCI_RENDE | AT91_MCI_RTOE | AT91_MCI_DCRCE | |
565 | AT91_MCI_DTOE | AT91_MCI_OVRE | AT91_MCI_UNRE)) { | 565 | AT91_MCI_DTOE | AT91_MCI_OVRE | AT91_MCI_UNRE)) { |
566 | if ((status & AT91_MCI_RCRCE) && | 566 | if ((status & AT91_MCI_RCRCE) && !(mmc_resp_type(cmd) & MMC_RSP_CRC)) { |
567 | ((cmd->opcode == MMC_SEND_OP_COND) || (cmd->opcode == SD_APP_OP_COND))) { | ||
568 | cmd->error = MMC_ERR_NONE; | 567 | cmd->error = MMC_ERR_NONE; |
569 | } | 568 | } |
570 | else { | 569 | else { |
diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c index f967226d7505..52b63f11ddd6 100644 --- a/drivers/mmc/host/au1xmmc.c +++ b/drivers/mmc/host/au1xmmc.c | |||
@@ -76,8 +76,7 @@ const struct { | |||
76 | #endif | 76 | #endif |
77 | }; | 77 | }; |
78 | 78 | ||
79 | #define AU1XMMC_CONTROLLER_COUNT \ | 79 | #define AU1XMMC_CONTROLLER_COUNT (ARRAY_SIZE(au1xmmc_card_table)) |
80 | (sizeof(au1xmmc_card_table) / sizeof(au1xmmc_card_table[0])) | ||
81 | 80 | ||
82 | /* This array stores pointers for the hosts (used by the IRQ handler) */ | 81 | /* This array stores pointers for the hosts (used by the IRQ handler) */ |
83 | struct au1xmmc_host *au1xmmc_hosts[AU1XMMC_CONTROLLER_COUNT]; | 82 | struct au1xmmc_host *au1xmmc_hosts[AU1XMMC_CONTROLLER_COUNT]; |