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

Commit 8cc33097 authored by Venkat Gopalakrishnan's avatar Venkat Gopalakrishnan Committed by Matt Wagantall
Browse files

mmc: sdhci-msm: Disable pm functionalities



Disable the following pm functionalities till they are functional:
 * clk scaling (need to verify full functionality)
 * clk gating (crashes when ungating the clock)

Change-Id: I0962d46d85415e77b978e1f7dd9f2f49446655bb
Signed-off-by: default avatarVenkat Gopalakrishnan <venkatg@codeaurora.org>
parent 5033d563
Loading
Loading
Loading
Loading
+6 −5
Original line number Original line Diff line number Diff line
@@ -1769,9 +1769,11 @@ static void sdhci_msm_bus_voting(struct sdhci_host *host, u32 enable)
		 * after SDHCI_MSM_MMC_CLK_GATE_DELAY and thus no
		 * after SDHCI_MSM_MMC_CLK_GATE_DELAY and thus no
		 * additional delay is required to remove the bus vote.
		 * additional delay is required to remove the bus vote.
		 */
		 */
#ifdef MMC_CLKGATE
		if (host->mmc->clkgate_delay)
		if (host->mmc->clkgate_delay)
			sdhci_msm_bus_cancel_work_and_set_vote(host, 0);
			sdhci_msm_bus_cancel_work_and_set_vote(host, 0);
		else
		else
#endif
			sdhci_msm_bus_queue_work(host);
			sdhci_msm_bus_queue_work(host);
	}
	}
}
}
@@ -2506,7 +2508,7 @@ static void sdhci_msm_set_clock(struct sdhci_host *host, unsigned int clock)
	curr_pwrsave = !!(readl_relaxed(host->ioaddr + CORE_VENDOR_SPEC) &
	curr_pwrsave = !!(readl_relaxed(host->ioaddr + CORE_VENDOR_SPEC) &
			  CORE_CLK_PWRSAVE);
			  CORE_CLK_PWRSAVE);
	if ((clock > 400000) &&
	if ((clock > 400000) &&
	    !curr_pwrsave && mmc_host_may_gate_card(host->mmc->card))
	    !curr_pwrsave)
		writel_relaxed(readl_relaxed(host->ioaddr + CORE_VENDOR_SPEC)
		writel_relaxed(readl_relaxed(host->ioaddr + CORE_VENDOR_SPEC)
				| CORE_CLK_PWRSAVE,
				| CORE_CLK_PWRSAVE,
				host->ioaddr + CORE_VENDOR_SPEC);
				host->ioaddr + CORE_VENDOR_SPEC);
@@ -2514,7 +2516,7 @@ static void sdhci_msm_set_clock(struct sdhci_host *host, unsigned int clock)
	 * Disable pwrsave for a newly added card if doesn't allow clock
	 * Disable pwrsave for a newly added card if doesn't allow clock
	 * gating.
	 * gating.
	 */
	 */
	else if (curr_pwrsave && !mmc_host_may_gate_card(host->mmc->card))
	else if (curr_pwrsave)
		writel_relaxed(readl_relaxed(host->ioaddr + CORE_VENDOR_SPEC)
		writel_relaxed(readl_relaxed(host->ioaddr + CORE_VENDOR_SPEC)
				& ~CORE_CLK_PWRSAVE,
				& ~CORE_CLK_PWRSAVE,
				host->ioaddr + CORE_VENDOR_SPEC);
				host->ioaddr + CORE_VENDOR_SPEC);
@@ -3075,10 +3077,10 @@ static int sdhci_msm_probe(struct platform_device *pdev)


	/* Enable pwr irq interrupts */
	/* Enable pwr irq interrupts */
	writel_relaxed(INT_MASK, (msm_host->core_mem + CORE_PWRCTL_MASK));
	writel_relaxed(INT_MASK, (msm_host->core_mem + CORE_PWRCTL_MASK));

#ifdef MMC_CLKGATE
	/* Set clock gating delay to be used when CONFIG_MMC_CLKGATE is set */
	/* Set clock gating delay to be used when CONFIG_MMC_CLKGATE is set */
	msm_host->mmc->clkgate_delay = SDHCI_MSM_MMC_CLK_GATE_DELAY;
	msm_host->mmc->clkgate_delay = SDHCI_MSM_MMC_CLK_GATE_DELAY;

#endif
	/* Set host capabilities */
	/* Set host capabilities */
	msm_host->mmc->caps |= msm_host->pdata->mmc_bus_width;
	msm_host->mmc->caps |= msm_host->pdata->mmc_bus_width;
	msm_host->mmc->caps |= msm_host->pdata->caps;
	msm_host->mmc->caps |= msm_host->pdata->caps;
@@ -3087,7 +3089,6 @@ static int sdhci_msm_probe(struct platform_device *pdev)
	msm_host->mmc->caps2 |= MMC_CAP2_PACKED_WR_CONTROL;
	msm_host->mmc->caps2 |= MMC_CAP2_PACKED_WR_CONTROL;
	msm_host->mmc->caps2 |= MMC_CAP2_BOOTPART_NOACC;
	msm_host->mmc->caps2 |= MMC_CAP2_BOOTPART_NOACC;
	msm_host->mmc->caps2 |= MMC_CAP2_FULL_PWR_CYCLE;
	msm_host->mmc->caps2 |= MMC_CAP2_FULL_PWR_CYCLE;
	msm_host->mmc->caps2 |= MMC_CAP2_CLK_SCALE;
	msm_host->mmc->caps2 |= MMC_CAP2_ASYNC_SDIO_IRQ_4BIT_MODE;
	msm_host->mmc->caps2 |= MMC_CAP2_ASYNC_SDIO_IRQ_4BIT_MODE;
	msm_host->mmc->caps2 |= MMC_CAP2_HS400_POST_TUNING;
	msm_host->mmc->caps2 |= MMC_CAP2_HS400_POST_TUNING;
	msm_host->mmc->pm_caps |= MMC_PM_KEEP_POWER;
	msm_host->mmc->pm_caps |= MMC_PM_KEEP_POWER;
+2 −1
Original line number Original line Diff line number Diff line
@@ -89,10 +89,11 @@ static void sdhci_runtime_pm_bus_off(struct sdhci_host *host)
static void sdhci_dump_state(struct sdhci_host *host)
static void sdhci_dump_state(struct sdhci_host *host)
{
{
	struct mmc_host *mmc = host->mmc;
	struct mmc_host *mmc = host->mmc;

#ifdef MMC_CLKGATE
	pr_info("%s: clk: %d clk-gated: %d claimer: %s pwr: %d\n",
	pr_info("%s: clk: %d clk-gated: %d claimer: %s pwr: %d\n",
		mmc_hostname(mmc), host->clock, mmc->clk_gated,
		mmc_hostname(mmc), host->clock, mmc->clk_gated,
		mmc->claimer->comm, host->pwr);
		mmc->claimer->comm, host->pwr);
#endif
	pr_info("%s: rpmstatus[pltfm](runtime-suspend:usage_count:disable_depth)(%d:%d:%d)\n",
	pr_info("%s: rpmstatus[pltfm](runtime-suspend:usage_count:disable_depth)(%d:%d:%d)\n",
		mmc_hostname(mmc), mmc->parent->power.runtime_status,
		mmc_hostname(mmc), mmc->parent->power.runtime_status,
		atomic_read(&mmc->parent->power.usage_count),
		atomic_read(&mmc->parent->power.usage_count),