From patchwork Mon Jun 10 15:03:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 17740 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2BA392397B for ; Mon, 10 Jun 2013 15:04:24 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id f14sf4420536qak.7 for ; Mon, 10 Jun 2013 08:04:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=9/t68kNASRnBWuJYTf9qtFJog9Dgfq9cpk8p+jKusvI=; b=FXiJWkCJI3Tpb6DGAchVWOEyhUbL1aFEtJB+wm6+Il+9z5swAhqSj9ST1UDPdZiFVs JAqhjBtKlmT9I+HidRf6LksPhF0Ooc82iX1y7mP7u0RIMjW42MpXjwvFX5aWxPhLfWDs oyDqRVss4YAf022GVqdS3Mr1zTnUWWUMXBXevmrkRt/2WQHIRml/LlyxhW32leyNNN16 7IW0rKytDYzIroufELqmFouQm4Ce73Aq6lbJR3IMwtyspxybfSsFn/uSTxpN29I5F46f rdcXlepbVS7wDT0ItmumS9yXoA6Vwz2raI7jP/rKPpydJSjOnF3NDnJpJt4fR6sGaEj1 e/qg== X-Received: by 10.58.75.169 with SMTP id d9mr1533777vew.14.1370876663880; Mon, 10 Jun 2013 08:04:23 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.40.131 with SMTP id x3ls2618591qek.40.gmail; Mon, 10 Jun 2013 08:04:23 -0700 (PDT) X-Received: by 10.52.27.20 with SMTP id p20mr4941576vdg.123.1370876663559; Mon, 10 Jun 2013 08:04:23 -0700 (PDT) Received: from mail-vb0-x22b.google.com (mail-vb0-x22b.google.com [2607:f8b0:400c:c02::22b]) by mx.google.com with ESMTPS id zt2si5063575vdb.63.2013.06.10.08.04.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Jun 2013 08:04:23 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22b is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22b; Received: by mail-vb0-f43.google.com with SMTP id e12so1898724vbg.16 for ; Mon, 10 Jun 2013 08:04:23 -0700 (PDT) X-Received: by 10.58.29.42 with SMTP id g10mr5705357veh.59.1370876663263; Mon, 10 Jun 2013 08:04:23 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.10.206 with SMTP id pb14csp71494vcb; Mon, 10 Jun 2013 08:04:22 -0700 (PDT) X-Received: by 10.14.178.134 with SMTP id f6mr11605507eem.91.1370876662370; Mon, 10 Jun 2013 08:04:22 -0700 (PDT) Received: from eu1sys200aog121.obsmtp.com (eu1sys200aog121.obsmtp.com [207.126.144.151]) by mx.google.com with SMTP id n44si8538593eeu.151.2013.06.10.08.04.20 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 10 Jun 2013 08:04:22 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.151 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.151; Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob121.postini.com ([207.126.147.11]) with SMTP ID DSNKUbXq8/YTZcAhR07A8xDHzBiMffRz7BYs@postini.com; Mon, 10 Jun 2013 15:04:22 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A54D81F7; Mon, 10 Jun 2013 15:04:18 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 6D3F7541A; Mon, 10 Jun 2013 15:03:58 +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 BE10E24C07C; Mon, 10 Jun 2013 17:04:09 +0200 (CEST) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.279.5; Mon, 10 Jun 2013 17:04:17 +0200 From: Ulf Hansson To: , Chris Ball Cc: Ulf Hansson Subject: [PATCH 09/12] mmc: core: Add shutdown callback for (e)MMC bus_ops Date: Mon, 10 Jun 2013 17:03:44 +0200 Message-ID: <1370876627-13439-10-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1370876627-13439-1-git-send-email-ulf.hansson@stericsson.com> References: <1370876627-13439-1-git-send-email-ulf.hansson@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQk4w+7Hyu6F4bQVESjioIj1SJx65+VP+Tiu5E5z8DcKpxSXhxNQSigrkY613dCre68p0HCj X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22b is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Ulf Hansson The shutdown sequence of an (e)MMC is very similar to a suspend. We re-use the suspend function and tell it we are not in suspend context. Signed-off-by: Ulf Hansson --- drivers/mmc/core/mmc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index dcf0169..3aafb2e 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1509,6 +1509,14 @@ static int mmc_suspend(struct mmc_host *host) } /* + * Shutdown callback + */ +static int mmc_shutdown(struct mmc_host *host) +{ + return _mmc_suspend(host, false); +} + +/* * Resume callback from host. * * This function tries to determine if the same card is still present @@ -1597,6 +1605,7 @@ static const struct mmc_bus_ops mmc_ops = { .resume = NULL, .power_restore = mmc_power_restore, .alive = mmc_alive, + .shutdown = mmc_shutdown, }; static const struct mmc_bus_ops mmc_ops_unsafe = { @@ -1608,6 +1617,7 @@ static const struct mmc_bus_ops mmc_ops_unsafe = { .runtime_resume = mmc_runtime_resume, .power_restore = mmc_power_restore, .alive = mmc_alive, + .shutdown = mmc_shutdown, }; static void mmc_attach_bus_ops(struct mmc_host *host)