Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312810
b: refs/heads/master
c: e137788
h: refs/heads/master
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Chris Ball committed Jul 21, 2012
1 parent d323abf commit d773532
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 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: 6de707f200f73af7a58b58b3a5b956cff7b6e228
refs/heads/master: e137788dd115dd9d21759a768dba5fff9685e587
23 changes: 23 additions & 0 deletions trunk/drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,29 @@ int mmc_regulator_set_ocr(struct mmc_host *mmc,
}
EXPORT_SYMBOL_GPL(mmc_regulator_set_ocr);

int mmc_regulator_get_supply(struct mmc_host *mmc)
{
struct device *dev = mmc_dev(mmc);
struct regulator *supply;
int ret;

supply = devm_regulator_get(dev, "vmmc");
mmc->supply.vmmc = supply;
mmc->supply.vqmmc = devm_regulator_get(dev, "vqmmc");

if (IS_ERR(supply))
return PTR_ERR(supply);

ret = mmc_regulator_get_ocrmask(supply);
if (ret > 0)
mmc->ocr_avail = ret;
else
dev_warn(mmc_dev(mmc), "Failed getting OCR mask: %d\n", ret);

return 0;
}
EXPORT_SYMBOL_GPL(mmc_regulator_get_supply);

#endif /* CONFIG_REGULATOR */

/*
Expand Down
16 changes: 14 additions & 2 deletions trunk/include/linux/mmc/host.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ struct mmc_hotplug {
void *handler_priv;
};

struct regulator;

struct mmc_supply {
struct regulator *vmmc; /* Card power supply */
struct regulator *vqmmc; /* Optional Vccq supply */
};

struct mmc_host {
struct device *parent;
struct device class_dev;
Expand Down Expand Up @@ -309,6 +316,7 @@ struct mmc_host {
#ifdef CONFIG_REGULATOR
bool regulator_enabled; /* regulator state */
#endif
struct mmc_supply supply;

struct dentry *debugfs_root;

Expand Down Expand Up @@ -357,13 +365,12 @@ static inline void mmc_signal_sdio_irq(struct mmc_host *host)
wake_up_process(host->sdio_irq_thread);
}

struct regulator;

#ifdef CONFIG_REGULATOR
int mmc_regulator_get_ocrmask(struct regulator *supply);
int mmc_regulator_set_ocr(struct mmc_host *mmc,
struct regulator *supply,
unsigned short vdd_bit);
int mmc_regulator_get_supply(struct mmc_host *mmc);
#else
static inline int mmc_regulator_get_ocrmask(struct regulator *supply)
{
Expand All @@ -376,6 +383,11 @@ static inline int mmc_regulator_set_ocr(struct mmc_host *mmc,
{
return 0;
}

static inline int mmc_regulator_get_supply(struct mmc_host *mmc)
{
return 0;
}
#endif

int mmc_card_awake(struct mmc_host *host);
Expand Down

0 comments on commit d773532

Please sign in to comment.