Merge "host: sdhci: fix current caps when there is no host->vmmc"
This commit is contained in:
commit
844331baa5
2 changed files with 9 additions and 3 deletions
|
@ -4076,10 +4076,15 @@ int sdhci_add_host(struct sdhci_host *host)
|
||||||
* value.
|
* value.
|
||||||
*/
|
*/
|
||||||
max_current_caps = sdhci_readl(host, SDHCI_MAX_CURRENT);
|
max_current_caps = sdhci_readl(host, SDHCI_MAX_CURRENT);
|
||||||
if (!max_current_caps && !IS_ERR(mmc->supply.vmmc)) {
|
if (!max_current_caps) {
|
||||||
int curr = regulator_get_current_limit(mmc->supply.vmmc);
|
u32 curr = 0;
|
||||||
if (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 */
|
/* convert to SDHCI_MAX_CURRENT format */
|
||||||
curr = curr/1000; /* convert to mA */
|
curr = curr/1000; /* convert to mA */
|
||||||
curr = curr/SDHCI_MAX_CURRENT_MULTIPLIER;
|
curr = curr/SDHCI_MAX_CURRENT_MULTIPLIER;
|
||||||
|
|
|
@ -687,6 +687,7 @@ struct sdhci_ops {
|
||||||
void (*init)(struct sdhci_host *host);
|
void (*init)(struct sdhci_host *host);
|
||||||
void (*pre_req)(struct sdhci_host *host, struct mmc_request *req);
|
void (*pre_req)(struct sdhci_host *host, struct mmc_request *req);
|
||||||
void (*post_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
|
#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
|
||||||
|
|
Loading…
Add table
Reference in a new issue