Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208444
b: refs/heads/master
c: 9bea3c8
h: refs/heads/master
v: v3
  • Loading branch information
Marek Szyprowski authored and Linus Torvalds committed Aug 11, 2010
1 parent 775cd43 commit b448512
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 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: 17866e14f3a4f219e94f1374ece7226479418ff8
refs/heads/master: 9bea3c850dbff2296892298614388bdc71ad2170
26 changes: 25 additions & 1 deletion trunk/drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <linux/scatterlist.h>
#include <linux/regulator/consumer.h>

#include <linux/leds.h>

Expand Down Expand Up @@ -1608,7 +1609,10 @@ int sdhci_suspend_host(struct sdhci_host *host, pm_message_t state)

free_irq(host->irq, host);

return 0;
if (host->vmmc)
ret = regulator_disable(host->vmmc);

return ret;
}

EXPORT_SYMBOL_GPL(sdhci_suspend_host);
Expand All @@ -1617,6 +1621,13 @@ int sdhci_resume_host(struct sdhci_host *host)
{
int ret;

if (host->vmmc) {
int ret = regulator_enable(host->vmmc);
if (ret)
return ret;
}


if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) {
if (host->ops->enable_dma)
host->ops->enable_dma(host);
Expand Down Expand Up @@ -1889,6 +1900,14 @@ int sdhci_add_host(struct sdhci_host *host)
if (ret)
goto untasklet;

host->vmmc = regulator_get(mmc_dev(mmc), "vmmc");
if (IS_ERR(host->vmmc)) {
printk(KERN_INFO "%s: no vmmc regulator found\n", mmc_hostname(mmc));
host->vmmc = NULL;
} else {
regulator_enable(host->vmmc);
}

sdhci_init(host, 0);

#ifdef CONFIG_MMC_DEBUG
Expand Down Expand Up @@ -1973,6 +1992,11 @@ void sdhci_remove_host(struct sdhci_host *host, int dead)
tasklet_kill(&host->card_tasklet);
tasklet_kill(&host->finish_tasklet);

if (host->vmmc) {
regulator_disable(host->vmmc);
regulator_put(host->vmmc);
}

kfree(host->adma_desc);
kfree(host->align_buffer);

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/mmc/host/sdhci.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ struct sdhci_host {

const struct sdhci_ops *ops; /* Low level hw interface */

struct regulator *vmmc; /* Power regulator */

/* Internal data */
struct mmc_host *mmc; /* MMC structure */
u64 dma_mask; /* custom DMA mask */
Expand Down

0 comments on commit b448512

Please sign in to comment.