Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255239
b: refs/heads/master
c: c9b0cef
h: refs/heads/master
i:
  255237: 73e14e3
  255235: 60ad0d0
  255231: 76aa864
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Chris Ball committed Jul 21, 2011
1 parent a5e8541 commit 703453f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 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: 71d111cd34ee119c93d056ad9e84dc0e82367f82
refs/heads/master: c9b0cef23f8d2a16c97623d25d6e8f8e93a56e4b
27 changes: 18 additions & 9 deletions trunk/drivers/mmc/host/sh_mmcif.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ struct sh_mmcif_host {
enum mmcif_state state;
spinlock_t lock;
bool power;
bool card_present;

/* DMA support */
struct dma_chan *chan_rx;
Expand Down Expand Up @@ -877,32 +878,40 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
spin_unlock_irqrestore(&host->lock, flags);

if (ios->power_mode == MMC_POWER_UP) {
if (p->set_pwr)
p->set_pwr(host->pd, ios->power_mode);
if (!host->power) {
if (!host->card_present) {
/* See if we also get DMA */
sh_mmcif_request_dma(host, host->pd->dev.platform_data);
pm_runtime_get_sync(&host->pd->dev);
host->power = true;
host->card_present = true;
}
} else if (ios->power_mode == MMC_POWER_OFF || !ios->clock) {
/* clock stop */
sh_mmcif_clock_control(host, 0);
if (ios->power_mode == MMC_POWER_OFF) {
if (host->power) {
pm_runtime_put(&host->pd->dev);
if (host->card_present) {
sh_mmcif_release_dma(host);
host->power = false;
host->card_present = false;
}
}
if (host->power) {
pm_runtime_put(&host->pd->dev);
host->power = false;
if (p->down_pwr)
p->down_pwr(host->pd);
}
host->state = STATE_IDLE;
return;
}

if (ios->clock)
if (ios->clock) {
if (!host->power) {
if (p->set_pwr)
p->set_pwr(host->pd, ios->power_mode);
pm_runtime_get_sync(&host->pd->dev);
host->power = true;
sh_mmcif_sync_reset(host);
}
sh_mmcif_clock_control(host, ios->clock);
}

host->bus_width = ios->bus_width;
host->state = STATE_IDLE;
Expand Down

0 comments on commit 703453f

Please sign in to comment.