parent
adc75fb180
commit
a8b758b889
|
|
@ -424,26 +424,12 @@ static int mmc_send_op_cond_iter(struct mmc *mmc, struct mmc_cmd *cmd,
|
|||
|
||||
int mmc_send_op_cond(struct mmc *mmc)
|
||||
{
|
||||
struct mmc_cmd cmd;
|
||||
int err, i;
|
||||
|
||||
/* Some cards seem to need this */
|
||||
mmc_go_idle(mmc);
|
||||
|
||||
/* Asking to the card its capabilities */
|
||||
mmc->op_cond_pending = 1;
|
||||
for (i = 0; i < 2; i++) {
|
||||
err = mmc_send_op_cond_iter(mmc, &cmd, i != 0);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
/* exit if not busy (flag seems to be inverted) and it is not the first command*/
|
||||
if (i && mmc->op_cond_response & OCR_BUSY) {
|
||||
mmc->op_cond_pending = 0; /* op_cond compilted */
|
||||
return 0;
|
||||
}
|
||||
udelay(1000);
|
||||
}
|
||||
return IN_PROGRESS;
|
||||
}
|
||||
|
||||
|
|
@ -1016,6 +1002,12 @@ static int mmc_startup(struct mmc *mmc)
|
|||
case 6:
|
||||
mmc->version = MMC_VERSION_4_5;
|
||||
break;
|
||||
case 7:
|
||||
mmc->version = MMC_VERSION_5_0;
|
||||
break;
|
||||
case 8:
|
||||
mmc->version = MMC_VERSION_5_1;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@
|
|||
#define MMC_VERSION_4_3 (MMC_VERSION_MMC | 0x403)
|
||||
#define MMC_VERSION_4_41 (MMC_VERSION_MMC | 0x429)
|
||||
#define MMC_VERSION_4_5 (MMC_VERSION_MMC | 0x405)
|
||||
#define MMC_VERSION_5_0 (MMC_VERSION_MMC | 0x500)
|
||||
#define MMC_VERSION_5_1 (MMC_VERSION_MMC | 0x501)
|
||||
|
||||
#define MMC_MODE_HS 0x001
|
||||
#define MMC_MODE_HS_52MHz 0x010
|
||||
|
|
|
|||
Loading…
Reference in New Issue