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

Commit d38dcad4 authored by Adrian Hunter's avatar Adrian Hunter Committed by Ulf Hansson
Browse files

mmc: sdhci: Let drivers decide whether to use mmc_retune_needed() with pm



Devices might save and restore tuning values so that re-tuning might not be
needed after a pm transition.  Let drivers decide by pushing the
mmc_retune_needed() logic down to them.

Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Tested-by: default avatarLudovic Desroches <ludovic.desroches@microchip.com>
parent 5a436cc0
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -524,8 +524,12 @@ static int sdhci_acpi_remove(struct platform_device *pdev)
static int sdhci_acpi_suspend(struct device *dev)
{
	struct sdhci_acpi_host *c = dev_get_drvdata(dev);
	struct sdhci_host *host = c->host;

	return sdhci_suspend_host(c->host);
	if (host->tuning_mode != SDHCI_TUNING_MODE_3)
		mmc_retune_needed(host->mmc);

	return sdhci_suspend_host(host);
}

static int sdhci_acpi_resume(struct device *dev)
@@ -544,8 +548,12 @@ static int sdhci_acpi_resume(struct device *dev)
static int sdhci_acpi_runtime_suspend(struct device *dev)
{
	struct sdhci_acpi_host *c = dev_get_drvdata(dev);
	struct sdhci_host *host = c->host;

	if (host->tuning_mode != SDHCI_TUNING_MODE_3)
		mmc_retune_needed(host->mmc);

	return sdhci_runtime_suspend_host(c->host);
	return sdhci_runtime_suspend_host(host);
}

static int sdhci_acpi_runtime_resume(struct device *dev)
+3 −0
Original line number Diff line number Diff line
@@ -29,6 +29,9 @@ static int sdhci_brcmstb_suspend(struct device *dev)
	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
	int res;

	if (host->tuning_mode != SDHCI_TUNING_MODE_3)
		mmc_retune_needed(host->mmc);

	res = sdhci_suspend_host(host);
	if (res)
		return res;
+6 −0
Original line number Diff line number Diff line
@@ -1323,6 +1323,9 @@ static int sdhci_esdhc_suspend(struct device *dev)
{
	struct sdhci_host *host = dev_get_drvdata(dev);

	if (host->tuning_mode != SDHCI_TUNING_MODE_3)
		mmc_retune_needed(host->mmc);

	return sdhci_suspend_host(host);
}

@@ -1347,6 +1350,9 @@ static int sdhci_esdhc_runtime_suspend(struct device *dev)

	ret = sdhci_runtime_suspend_host(host);

	if (host->tuning_mode != SDHCI_TUNING_MODE_3)
		mmc_retune_needed(host->mmc);

	if (!sdhci_sdio_irq_enabled(host)) {
		clk_disable_unprepare(imx_data->clk_per);
		clk_disable_unprepare(imx_data->clk_ipg);
+3 −0
Original line number Diff line number Diff line
@@ -315,6 +315,9 @@ static int sdhci_arasan_suspend(struct device *dev)
	struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host);
	int ret;

	if (host->tuning_mode != SDHCI_TUNING_MODE_3)
		mmc_retune_needed(host->mmc);

	ret = sdhci_suspend_host(host);
	if (ret)
		return ret;
+3 −0
Original line number Diff line number Diff line
@@ -140,6 +140,9 @@ static int sdhci_at91_runtime_suspend(struct device *dev)

	ret = sdhci_runtime_suspend_host(host);

	if (host->tuning_mode != SDHCI_TUNING_MODE_3)
		mmc_retune_needed(host->mmc);

	clk_disable_unprepare(priv->gck);
	clk_disable_unprepare(priv->hclock);
	clk_disable_unprepare(priv->mainck);
Loading