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

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

Merge "mmc: sdhci-msm: Disable controller clocks in suspend"

parents 715cf59e 4574a7e9
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -2706,7 +2706,24 @@ out:
	return rc;
}

static void sdhci_msm_disable_controller_clock(struct sdhci_host *host)
{
	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
	struct sdhci_msm_host *msm_host = pltfm_host->priv;

	if (atomic_read(&msm_host->controller_clock)) {
		if (!IS_ERR(msm_host->clk))
			clk_disable_unprepare(msm_host->clk);
		if (!IS_ERR(msm_host->pclk))
			clk_disable_unprepare(msm_host->pclk);
		if (!IS_ERR(msm_host->ice_clk))
			clk_disable_unprepare(msm_host->ice_clk);
		sdhci_msm_bus_voting(host, 0);
		atomic_set(&msm_host->controller_clock, 0);
		pr_debug("%s: %s: disabled controller clock\n",
			mmc_hostname(host->mmc), __func__);
	}
}

static int sdhci_msm_prepare_clocks(struct sdhci_host *host, bool enable)
{
@@ -4578,7 +4595,7 @@ static int sdhci_msm_suspend(struct device *dev)
	}
	ret = sdhci_msm_runtime_suspend(dev);
out:

	sdhci_msm_disable_controller_clock(host);
	if (host->mmc->card && mmc_card_sdio(host->mmc->card)) {
		sdio_cfg = sdhci_msm_cfg_sdio_wakeup(host, true);
		if (sdio_cfg)