Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336295
b: refs/heads/master
c: ab26912
h: refs/heads/master
i:
  336293: 4c5c2ef
  336291: d24b9a4
  336287: 87a5e5c
v: v3
  • Loading branch information
Abhilash Kesavan authored and Chris Ball committed Dec 6, 2012
1 parent 4cf6578 commit 68d8875
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 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: f5ccfd4174639119664b6d76495ea1388f13b838
refs/heads/master: ab269128a2cff7abee06f023e6466fc29991738c
20 changes: 17 additions & 3 deletions trunk/drivers/mmc/host/dw_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,13 +617,13 @@ static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg)
cmd, arg, cmd_status);
}

static void dw_mci_setup_bus(struct dw_mci_slot *slot)
static void dw_mci_setup_bus(struct dw_mci_slot *slot, bool force_clkinit)
{
struct dw_mci *host = slot->host;
u32 div;
u32 clk_en_a;

if (slot->clock != host->current_speed) {
if (slot->clock != host->current_speed || force_clkinit) {
div = host->bus_hz / slot->clock;
if (host->bus_hz % slot->clock && host->bus_hz > slot->clock)
/*
Expand Down Expand Up @@ -684,7 +684,7 @@ static void __dw_mci_start_request(struct dw_mci *host,
host->pdata->select_slot(slot->id);

/* Slot specific timing and width adjustment */
dw_mci_setup_bus(slot);
dw_mci_setup_bus(slot, false);

host->cur_slot = slot;
host->mrq = mrq;
Expand Down Expand Up @@ -1850,6 +1850,9 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
if (host->pdata->caps)
mmc->caps = host->pdata->caps;

if (host->pdata->pm_caps)
mmc->pm_caps = host->pdata->pm_caps;

if (host->dev->of_node) {
ctrl_id = of_alias_get_id(host->dev->of_node, "mshc");
if (ctrl_id < 0)
Expand Down Expand Up @@ -2072,6 +2075,12 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
return ERR_PTR(ret);
}

if (of_find_property(np, "keep-power-in-suspend", NULL))
pdata->pm_caps |= MMC_PM_KEEP_POWER;

if (of_find_property(np, "enable-sdio-wakeup", NULL))
pdata->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;

return pdata;
}

Expand Down Expand Up @@ -2411,6 +2420,11 @@ int dw_mci_resume(struct dw_mci *host)
struct dw_mci_slot *slot = host->slot[i];
if (!slot)
continue;
if (slot->mmc->pm_flags & MMC_PM_KEEP_POWER) {
dw_mci_set_ios(slot->mmc, &slot->mmc->ios);
dw_mci_setup_bus(slot, true);
}

ret = mmc_resume_host(host->slot[i]->mmc);
if (ret < 0)
return ret;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/mmc/dw_mmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ struct dw_mci_board {

u32 caps; /* Capabilities */
u32 caps2; /* More capabilities */
u32 pm_caps; /* PM capabilities */
/*
* Override fifo depth. If 0, autodetect it from the FIFOTH register,
* but note that this may not be reliable after a bootloader has used
Expand Down

0 comments on commit 68d8875

Please sign in to comment.