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

Commit 4028cd30 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: core: Fix mmc sleep/awake functionality"

parents d915a465 94096bd1
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 */