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

Commit 94096bd1 authored by Sayali Lokhande's avatar Sayali Lokhande Committed by Gerrit - the friendly Code Review server
Browse files

mmc: core: Fix mmc sleep/awake functionality



Currently as part of mmc suspend and resume, we are using
different api's to check support for cmd5 (sleep/awake),
which results in suspend sending cmd5 for sleep, while
in resume it's always going for full init instead of sending
cmd5 for awake. Fix this by using same api in both suspend
and resume paths so that partial init functionality is
actually utilized.

Change-Id: Ia84b7790fe00f1f24a63d6dc509646ebcbd4d3ef
Signed-off-by: default avatarSayali Lokhande <sayalil@codeaurora.org>
parent c7f857a0
Loading
Loading
Loading
Loading
+2 −13
Original line number Diff line number Diff line
@@ -2094,17 +2094,6 @@ static int mmc_can_sleep(struct mmc_card *card)
	return (card && card->ext_csd.rev >= 3);
}

static int mmc_can_sleepawake(struct mmc_host *host)
{
#if defined(CONFIG_SDC_QTI)
	return host && (host->caps2 & MMC_CAP2_SLEEP_AWAKE) && host->card &&
		(host->card->ext_csd.rev >= 3);
#else
	return host && host->card && (host->card->ext_csd.rev >= 3);
#endif

}

static int mmc_sleepawake(struct mmc_host *host, bool sleep)
{
	struct mmc_command cmd = {};
@@ -2329,7 +2318,7 @@ static int _mmc_suspend(struct mmc_host *host, bool is_suspend)
	if (mmc_can_poweroff_notify(host->card) &&
		((host->caps2 & MMC_CAP2_FULL_PWR_CYCLE) || !is_suspend))
		err = mmc_poweroff_notify(host->card, notify_type);
	if (mmc_can_sleepawake(host)) {
	if (mmc_can_sleep(host->card)) {
#if defined(CONFIG_SDC_QTI)
		memcpy(&host->cached_ios, &host->ios, sizeof(host->cached_ios));
#endif
@@ -2441,7 +2430,7 @@ static int _mmc_resume(struct mmc_host *host)
	mmc_log_string(host, "Enter\n");
	mmc_power_up(host, host->card->ocr);

	if (mmc_can_sleepawake(host)) {
	if (mmc_can_sleep(host->card)) {
		err = mmc_sleepawake(host, false);
		if (!err)
			err = mmc_partial_init(host);
+0 −1
Original line number Diff line number Diff line
@@ -479,7 +479,6 @@ struct mmc_host {
#define MMC_CAP2_CRYPTO		(1 << 27)	/* Host supports inline encryption */
#if defined(CONFIG_SDC_QTI)
#define MMC_CAP2_CLK_SCALE      (1 << 28)       /* Allow dynamic clk scaling */
#define MMC_CAP2_SLEEP_AWAKE	(1 << 29)	/* Use Sleep/Awake (CMD5) */
#endif

	int			fixed_drv_type;	/* fixed driver type for non-removable media */