mmc: remove tran_speed from struct mmc

The clock element is updated by mmc_set_clock every time, it denotes the
current transfer speed.

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
This commit is contained in:
Ziyuan Xu 2017-05-15 14:07:06 +08:00 committed by Kever Yang
parent caa21a21f1
commit 3e3ff0ac77
4 changed files with 7 additions and 8 deletions

View File

@ -23,7 +23,7 @@ static void print_mmcinfo(struct mmc *mmc)
(mmc->cid[1] >> 24), (mmc->cid[1] >> 16) & 0xff,
(mmc->cid[1] >> 8) & 0xff, mmc->cid[1] & 0xff);
printf("Tran Speed: %d\n", mmc->tran_speed);
printf("Tran Speed: %d\n", mmc->clock);
printf("Rd Block Len: %d\n", mmc->read_bl_len);
printf("%s version %d.%d", IS_SD(mmc) ? "SD" : "MMC",

View File

@ -1449,7 +1449,7 @@ static bool mmc_can_card_busy(struct mmc *)
static int mmc_startup(struct mmc *mmc)
{
int err, i;
uint mult, freq;
uint mult, freq, tran_speed;
u64 cmult, csize, capacity;
struct mmc_cmd cmd;
ALLOC_CACHE_ALIGN_BUFFER(u8, ext_csd, MMC_MAX_BLOCK_LEN);
@ -1545,7 +1545,7 @@ static int mmc_startup(struct mmc *mmc)
freq = fbase[(cmd.response[0] & 0x7)];
mult = multipliers[((cmd.response[0] >> 3) & 0xf)];
mmc->tran_speed = freq * mult;
tran_speed = freq * mult;
mmc->dsr_imp = ((cmd.response[1] >> 12) & 0x1);
mmc->read_bl_len = 1 << ((cmd.response[1] >> 16) & 0xf);
@ -1792,11 +1792,11 @@ static int mmc_startup(struct mmc *mmc)
return err;
if (mmc->card_caps & MMC_MODE_HS)
mmc->tran_speed = 50000000;
tran_speed = 50000000;
else
mmc->tran_speed = 25000000;
tran_speed = 25000000;
mmc_set_clock(mmc, mmc->tran_speed);
mmc_set_clock(mmc, tran_speed);
}
/* Fix the block length for DDR mode */

View File

@ -318,7 +318,7 @@ static void xenon_mask_cmd_conflict_err(struct sdhci_host *host)
static void xenon_sdhci_set_ios_post(struct sdhci_host *host)
{
struct xenon_sdhci_priv *priv = host->mmc->priv;
uint speed = host->mmc->tran_speed;
uint speed = host->mmc->clock;
int pwr_18v = 0;
if ((sdhci_readb(host, SDHCI_POWER_CONTROL) & ~SDHCI_POWER_ON) ==

View File

@ -508,7 +508,6 @@ struct mmc {
u8 part_attr;
u8 wr_rel_set;
u8 part_config;
uint tran_speed;
uint read_bl_len;
uint write_bl_len;
uint erase_grp_size; /* in 512-byte sectors */