Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 228891
b: refs/heads/master
c: d078d24
h: refs/heads/master
i:
  228889: 5c97645
  228887: c532b5a
v: v3
  • Loading branch information
Alberto Panizzo authored and Chris Ball committed Jan 9, 2011
1 parent 82994cd commit 8c9fde3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 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: 74b66954ebfcef9bc26d9c377d32fbd46b4ddc32
refs/heads/master: d078d24242ff6c36338991627f9c63b2d48a6eee
20 changes: 12 additions & 8 deletions trunk/drivers/mmc/host/mxcmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ static void mxcmci_set_clk_rate(struct mxcmci_host *host, unsigned int clk_ios);

static inline void mxcmci_init_ocr(struct mxcmci_host *host)
{
#ifdef CONFIG_REGULATOR
host->vcc = regulator_get(mmc_dev(host->mmc), "vmmc");

if (IS_ERR(host->vcc)) {
Expand All @@ -161,7 +160,7 @@ static inline void mxcmci_init_ocr(struct mxcmci_host *host)
dev_warn(mmc_dev(host->mmc),
"pdata->ocr_avail will not be used\n");
}
#endif

if (host->vcc == NULL) {
/* fall-back to platform data */
if (host->pdata && host->pdata->ocr_avail)
Expand All @@ -171,12 +170,17 @@ static inline void mxcmci_init_ocr(struct mxcmci_host *host)
}
}

static inline void mxcmci_set_power(struct mxcmci_host *host, unsigned int vdd)
static inline void mxcmci_set_power(struct mxcmci_host *host,
unsigned char power_mode,
unsigned int vdd)
{
#ifdef CONFIG_REGULATOR
if (host->vcc)
mmc_regulator_set_ocr(host->vcc, vdd);
#endif
if (host->vcc) {
if (power_mode == MMC_POWER_UP)
mmc_regulator_set_ocr(host->mmc, host->vcc, vdd);
else if (power_mode == MMC_POWER_OFF)
mmc_regulator_set_ocr(host->mmc, host->vcc, 0);
}

if (host->pdata && host->pdata->setpower)
host->pdata->setpower(mmc_dev(host->mmc), vdd);
}
Expand Down Expand Up @@ -716,7 +720,7 @@ static void mxcmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
host->cmdat &= ~CMD_DAT_CONT_BUS_WIDTH_4;

if (host->power_mode != ios->power_mode) {
mxcmci_set_power(host, ios->vdd);
mxcmci_set_power(host, ios->power_mode, ios->vdd);
host->power_mode = ios->power_mode;

if (ios->power_mode == MMC_POWER_ON)
Expand Down

0 comments on commit 8c9fde3

Please sign in to comment.