From patchwork Wed Jul 13 14:36:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balaji T K X-Patchwork-Id: 972382 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6DEbJ3i008429 for ; Wed, 13 Jul 2011 14:37:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754654Ab1GMOhS (ORCPT ); Wed, 13 Jul 2011 10:37:18 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:46347 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753964Ab1GMOhS (ORCPT ); Wed, 13 Jul 2011 10:37:18 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id p6DEbE5t002797 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 13 Jul 2011 09:37:17 -0500 Received: from dbde70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p6DEbE60008630 for ; Wed, 13 Jul 2011 20:07:14 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 8.3.106.1; Wed, 13 Jul 2011 20:07:14 +0530 Received: from localhost.localdomain (a0393241pc.india.ti.com [172.24.136.78]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p6DEbAYM023585; Wed, 13 Jul 2011 20:07:12 +0530 (IST) From: Balaji T K To: CC: Balaji T K Subject: [RFC/RFT] MMC: CORE: eMMC in Sleep mode before suspend Date: Wed, 13 Jul 2011 20:06:27 +0530 Message-ID: <1310567787-14697-1-git-send-email-balajitk@ti.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 13 Jul 2011 14:37:20 +0000 (UTC) Put MMC to sleep if it supports SLEEP/AWAKE (CMD5) in the mmc suspend to minimize power consumption. Signed-off-by: Balaji T K Acked-by: Venkatraman S --- drivers/mmc/core/mmc.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index afabdc3..e8dfcde 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -900,16 +900,20 @@ static void mmc_detect(struct mmc_host *host) */ static int mmc_suspend(struct mmc_host *host) { + int err = 0; + BUG_ON(!host); BUG_ON(!host->card); mmc_claim_host(host); - if (!mmc_host_is_spi(host)) + if (mmc_card_can_sleep(host)) + err = mmc_card_sleep(host); + else if (!mmc_host_is_spi(host)) mmc_deselect_cards(host); host->card->state &= ~MMC_STATE_HIGHSPEED; mmc_release_host(host); - return 0; + return err; } /*