From patchwork Tue Jan 4 21:10:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ohad Ben Cohen X-Patchwork-Id: 451821 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p04LB1Z6026668 for ; Tue, 4 Jan 2011 21:11:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750994Ab1ADVKr (ORCPT ); Tue, 4 Jan 2011 16:10:47 -0500 Received: from mail-ey0-f174.google.com ([209.85.215.174]:59865 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751482Ab1ADVKq (ORCPT ); Tue, 4 Jan 2011 16:10:46 -0500 Received: by mail-ey0-f174.google.com with SMTP id 27so6488007eye.19 for ; Tue, 04 Jan 2011 13:10:45 -0800 (PST) Received: by 10.213.22.142 with SMTP id n14mr16556535ebb.57.1294175445445; Tue, 04 Jan 2011 13:10:45 -0800 (PST) Received: from localhost.localdomain (93-172-227-56.bb.netvision.net.il [93.172.227.56]) by mx.google.com with ESMTPS id t50sm15979763eeh.6.2011.01.04.13.10.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 04 Jan 2011 13:10:44 -0800 (PST) From: Ohad Ben-Cohen To: Cc: Chris Ball , Ohad Ben-Cohen Subject: [PATCH 2/4] mmc: do not switch to 1-bit mode if not required Date: Tue, 4 Jan 2011 23:10:14 +0200 Message-Id: <1294175416-12358-2-git-send-email-ohad@wizery.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1294175416-12358-1-git-send-email-ohad@wizery.com> References: <1294175416-12358-1-git-send-email-ohad@wizery.com> 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.3 (demeter1.kernel.org [140.211.167.41]); Tue, 04 Jan 2011 21:11:02 +0000 (UTC) diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 97a6182..78be7d9 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -616,7 +616,7 @@ static int mmc_sdio_suspend(struct mmc_host *host) } } - if (!err && mmc_card_keep_power(host)) { + if (!err && mmc_card_keep_power(host) && mmc_card_wake_sdio_irq(host)) { mmc_claim_host(host); sdio_disable_wide(host->card); mmc_release_host(host); @@ -639,7 +639,7 @@ static int mmc_sdio_resume(struct mmc_host *host) if (mmc_card_is_removable(host) || !mmc_card_keep_power(host)) err = mmc_sdio_init_card(host, host->ocr, host->card, mmc_card_keep_power(host)); - else if (mmc_card_keep_power(host)) { + else if (mmc_card_keep_power(host) && mmc_card_wake_sdio_irq(host)) { /* We may have switched to 1-bit mode during suspend */ err = sdio_enable_4bit_bus(host->card); if (err > 0) { diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index cccb5cf..4f705eb 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -326,5 +326,9 @@ static inline int mmc_card_keep_power(struct mmc_host *host) return host->pm_flags & MMC_PM_KEEP_POWER; } +static inline int mmc_card_wake_sdio_irq(struct mmc_host *host) +{ + return host->pm_flags & MMC_PM_WAKE_SDIO_IRQ; +} #endif