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

Commit 9150a94a authored by Sahitya Tummala's avatar Sahitya Tummala Committed by Xiaonian Wang
Browse files

host: sdhci-msm: implement get_current_limit() host op



This is needed to get the current capabilities of vdd
regulator that is not managed by SDHCI driver.

Change-Id: Ib41f9892caca7f9d39675c6adf3b5eb8fdf88159
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
Signed-off-by: default avatarSayali Lokhande <sayalil@codeaurora.org>
[xiaonian@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: default avatarXiaonian Wang <xiaonian@codeaurora.org>
parent cba7e83e
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -3614,6 +3614,19 @@ static void sdhci_msm_init(struct sdhci_host *host)
				msm_host->pdata->pm_qos_data.latency);
}

static unsigned int sdhci_msm_get_current_limit(struct sdhci_host *host)
{
	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
	struct sdhci_msm_host *msm_host = pltfm_host->priv;
	struct sdhci_msm_slot_reg_data *curr_slot = msm_host->pdata->vreg_data;
	u32 max_curr = 0;

	if (curr_slot && curr_slot->vdd_data)
		max_curr = curr_slot->vdd_data->hpm_uA;

	return max_curr;
}

static struct sdhci_ops sdhci_msm_ops = {
	.set_uhs_signaling = sdhci_msm_set_uhs_signaling,
	.check_power_status = sdhci_msm_check_power_status,
@@ -3635,6 +3648,7 @@ static struct sdhci_ops sdhci_msm_ops = {
	.init = sdhci_msm_init,
	.pre_req = sdhci_msm_pre_req,
	.post_req = sdhci_msm_post_req,
	.get_current_limit = sdhci_msm_get_current_limit,
};

static void sdhci_set_default_hw_caps(struct sdhci_msm_host *msm_host,