From patchwork Wed Dec 14 15:20:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 5700 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7B64623E11 for ; Wed, 14 Dec 2011 15:21:52 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 6F544A1808F for ; Wed, 14 Dec 2011 15:21:52 +0000 (UTC) Received: by eaak10 with SMTP id k10so727201eaa.11 for ; Wed, 14 Dec 2011 07:21:52 -0800 (PST) Received: by 10.204.133.213 with SMTP id g21mr1197366bkt.126.1323876112192; Wed, 14 Dec 2011 07:21:52 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.129.2 with SMTP id hg2cs11637bkc; Wed, 14 Dec 2011 07:21:52 -0800 (PST) Received: by 10.205.118.12 with SMTP id fo12mr1165703bkc.33.1323876111868; Wed, 14 Dec 2011 07:21:51 -0800 (PST) Received: from eu1sys200aog105.obsmtp.com (eu1sys200aog105.obsmtp.com. [207.126.144.119]) by mx.google.com with SMTP id 26si2235972eeh.75.2011.12.14.07.21.47 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Dec 2011 07:21:51 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.119 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.119; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.119 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) smtp.mail=ulf.hansson@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob105.postini.com ([207.126.147.11]) with SMTP ID DSNKTui+0GULFX3n2PZw3E9mWV7XFtpY9HnG@postini.com; Wed, 14 Dec 2011 15:21:51 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 9050CAA; Wed, 14 Dec 2011 15:12:19 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 2E6E411C9; Wed, 14 Dec 2011 15:20:45 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id BF66824C07C; Wed, 14 Dec 2011 16:20:36 +0100 (CET) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 14 Dec 2011 16:20:44 +0100 From: Ulf Hansson To: , Chris Ball Cc: Per Forlin , Ulf Hansson , Johan Rudholm , Lee Jones Subject: [PATCH] mmc: core: Add option to prevent eMMC sleep command Date: Wed, 14 Dec 2011 16:20:36 +0100 Message-ID: <1323876036-10206-1-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 Host may now use MMC_CAP2_NOSLEEP to disable the use of eMMC sleep/awake command. Signed-off-by: Ulf Hansson Reviewed-by: Hanumath Prasad Reviewed-by: Srinidhi Kasagar --- drivers/mmc/core/core.c | 6 ++++++ include/linux/mmc/host.h | 1 + 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index a2aa860..5a1ce37 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2246,6 +2246,9 @@ int mmc_card_awake(struct mmc_host *host) { int err = -ENOSYS; + if (host->caps2 & MMC_CAP2_NOSLEEP) + return 0; + mmc_bus_get(host); if (host->bus_ops && !host->bus_dead && host->bus_ops->awake) @@ -2261,6 +2264,9 @@ int mmc_card_sleep(struct mmc_host *host) { int err = -ENOSYS; + if (host->caps2 & MMC_CAP2_NOSLEEP) + return 0; + mmc_bus_get(host); if (host->bus_ops && !host->bus_dead && host->bus_ops->sleep) diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 9a03d03..d07fb27 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -242,6 +242,7 @@ struct mmc_host { #define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ #define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */ #define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */ +#define MMC_CAP2_NOSLEEP (1 << 4) /* Don't allow sleep command */ mmc_pm_flag_t pm_caps; /* supported pm features */ unsigned int power_notify_type;