Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34911c58 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "host: sdhci: fix current caps when there is no host->vmmc" into msm-4.9

parents dad6e468 cba7e83e
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -4178,10 +4178,15 @@ int sdhci_setup_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;
+1 −0
Original line number Diff line number Diff line
@@ -696,6 +696,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