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.
|
||||
*/
|
||||
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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue