diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-08-26 22:22:58 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-08-26 22:22:58 -0700 |
| commit | 844331baa5aaef74435356fb6bfc92cb00f44e6f (patch) | |
| tree | 71c174f0672d31f69c1a4146a51f88e25e38212f | |
| parent | 9c34e4b38dd0adb6e846041f2c799325c5fe3ed5 (diff) | |
| parent | 53688837e03b04dc3d0ad172a7bc62224090aaef (diff) | |
Merge "host: sdhci: fix current caps when there is no host->vmmc"
| -rw-r--r-- | drivers/mmc/host/sdhci.c | 11 | ||||
| -rw-r--r-- | drivers/mmc/host/sdhci.h | 1 |
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 5f7eac922c54..14ed8e775e6a 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -4076,10 +4076,15 @@ int sdhci_add_host(struct sdhci_host *host) * value. */ max_current_caps = sdhci_readl(host, SDHCI_MAX_CURRENT); - if (!max_current_caps && !IS_ERR(mmc->supply.vmmc)) { - int curr = regulator_get_current_limit(mmc->supply.vmmc); - if (curr > 0) { + if (!max_current_caps) { + u32 curr = 0; + + if (!IS_ERR(mmc->supply.vmmc)) + curr = regulator_get_current_limit(mmc->supply.vmmc); + else if (host->ops->get_current_limit) + curr = host->ops->get_current_limit(host); + if (curr > 0) { /* convert to SDHCI_MAX_CURRENT format */ curr = curr/1000; /* convert to mA */ curr = curr/SDHCI_MAX_CURRENT_MULTIPLIER; diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index a1f9c48879fa..6ef2005c8d4c 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -687,6 +687,7 @@ struct sdhci_ops { void (*init)(struct sdhci_host *host); void (*pre_req)(struct sdhci_host *host, struct mmc_request *req); void (*post_req)(struct sdhci_host *host, struct mmc_request *req); + unsigned int (*get_current_limit)(struct sdhci_host *host); }; #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS |
