u16 clk = 0;
unsigned long timeout;
- if (clock && clock == host->clock)
- return;
-
host->mmc->actual_clock = 0;
if (host->ops->set_clock) {
host->clock = clock;
}
-static inline void sdhci_update_clock(struct sdhci_host *host)
-{
- unsigned int clock;
-
- clock = host->clock;
- host->clock = 0;
- sdhci_set_clock(host, clock);
-}
-
static int sdhci_set_power(struct sdhci_host *host, unsigned short power)
{
u8 pwr = 0;
!(host->quirks2 & SDHCI_QUIRK2_PRESET_VALUE_BROKEN))
sdhci_enable_preset_value(host, false);
- sdhci_set_clock(host, ios->clock);
+ if (!ios->clock || ios->clock != host->clock)
+ sdhci_set_clock(host, ios->clock);
if (ios->power_mode == MMC_POWER_OFF)
vdd_bit = sdhci_set_power(host, -1);
sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
/* Re-enable SD Clock */
- sdhci_update_clock(host);
+ sdhci_set_clock(host, host->clock);
}
}
/* Re-enable SD Clock */
- sdhci_update_clock(host);
+ sdhci_set_clock(host, host->clock);
} else
sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
/* Some controllers need this kick or reset won't work here */
if (host->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET)
/* This is to force an update */
- sdhci_update_clock(host);
+ sdhci_set_clock(host, host->clock);
/* Spec says we should do both at the same time, but Ricoh
controllers do not like that. */