Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57522
b: refs/heads/master
c: 3373c0a
h: refs/heads/master
v: v3
  • Loading branch information
Pierre Ossman committed Jun 7, 2007
1 parent 9ed5787 commit ecee1cc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 71651297a448289353b2493c6c3c183f9be7be7c
refs/heads/master: 3373c0ae6a51085b10a95fd9d2214a9995ef7563
24 changes: 20 additions & 4 deletions trunk/drivers/mmc/core/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/mmc/host.h>
#include <linux/mmc/card.h>
#include <linux/mmc/mmc.h>
#include <linux/mmc/sd.h>

#include "core.h"
#include "sysfs.h"
Expand Down Expand Up @@ -192,6 +193,16 @@ static int mmc_read_switch(struct mmc_card *card)
int err;
u8 *status;

if (card->scr.sda_vsn < SCR_SPEC_VER_1)
return MMC_ERR_NONE;

if (!(card->csd.cmdclass & CCC_SWITCH)) {
printk(KERN_WARNING "%s: card lacks mandatory switch "
"function, performance might suffer.\n",
mmc_hostname(card->host));
return MMC_ERR_NONE;
}

err = MMC_ERR_FAILED;

status = kmalloc(64, GFP_KERNEL);
Expand All @@ -204,10 +215,9 @@ static int mmc_read_switch(struct mmc_card *card)

err = mmc_sd_switch(card, 0, 0, 1, status);
if (err != MMC_ERR_NONE) {
/*
* Card not supporting high-speed will ignore the
* command.
*/
printk(KERN_WARNING "%s: problem reading switch "
"capabilities, performance might suffer.\n",
mmc_hostname(card->host));
err = MMC_ERR_NONE;
goto out;
}
Expand All @@ -229,6 +239,12 @@ static int mmc_switch_hs(struct mmc_card *card)
int err;
u8 *status;

if (card->scr.sda_vsn < SCR_SPEC_VER_1)
return MMC_ERR_NONE;

if (!(card->csd.cmdclass & CCC_SWITCH))
return MMC_ERR_NONE;

if (!(card->host->caps & MMC_CAP_SD_HIGHSPEED))
return MMC_ERR_NONE;

Expand Down

0 comments on commit ecee1cc

Please sign in to comment.