Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359894
b: refs/heads/master
c: 22c07f3
h: refs/heads/master
v: v3
  • Loading branch information
Andy Shevchenko authored and Chris Ball committed Jan 28, 2013
1 parent 64d2901 commit 8c71ae0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 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: 9ddc4f27cf9ebb413c713fb4419c4f5e80c6a5f3
refs/heads/master: 22c07f36269befbf092d833d2c7cf0e27a3e9d1f
27 changes: 13 additions & 14 deletions trunk/drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,15 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int 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;
Expand Down Expand Up @@ -1418,7 +1427,6 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)

if (host->version >= SDHCI_SPEC_300) {
u16 clk, ctrl_2;
unsigned int clock;

/* In case of UHS-I modes, set High Speed Enable */
if ((ios->timing == MMC_TIMING_MMC_HS200) ||
Expand Down Expand Up @@ -1458,9 +1466,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);

/* Re-enable SD Clock */
clock = host->clock;
host->clock = 0;
sdhci_set_clock(host, clock);
sdhci_update_clock(host);
}


Expand Down Expand Up @@ -1491,9 +1497,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
}

/* Re-enable SD Clock */
clock = host->clock;
host->clock = 0;
sdhci_set_clock(host, clock);
sdhci_update_clock(host);
} else
sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);

Expand Down Expand Up @@ -2083,14 +2087,9 @@ static void sdhci_tasklet_finish(unsigned long param)
(host->quirks & SDHCI_QUIRK_RESET_AFTER_REQUEST))) {

/* Some controllers need this kick or reset won't work here */
if (host->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET) {
unsigned int clock;

if (host->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET)
/* This is to force an update */
clock = host->clock;
host->clock = 0;
sdhci_set_clock(host, clock);
}
sdhci_update_clock(host);

/* Spec says we should do both at the same time, but Ricoh
controllers do not like that. */
Expand Down

0 comments on commit 8c71ae0

Please sign in to comment.