From patchwork Tue Sep 3 09:29:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 2853163 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 27B8B9F3DC for ; Tue, 3 Sep 2013 09:31:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7D4F820266 for ; Tue, 3 Sep 2013 09:31:29 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B3324201C0 for ; Tue, 3 Sep 2013 09:31:24 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VGmwe-0007C2-JG; Tue, 03 Sep 2013 09:30:44 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VGmwS-0002KR-OD; Tue, 03 Sep 2013 09:30:32 +0000 Received: from mail-ea0-f178.google.com ([209.85.215.178]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VGmwP-0002IA-Jp for linux-arm-kernel@lists.infradead.org; Tue, 03 Sep 2013 09:30:30 +0000 Received: by mail-ea0-f178.google.com with SMTP id a15so2878549eae.9 for ; Tue, 03 Sep 2013 02:30:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ynXGiKO99JKz6y4wSv7xJInGUyMWGE6N497TqjVM2d0=; b=bdIvaEi2R5bPi/t3fnvMRvKzEB8VyzeX5racCm7YeUk9zeLe3KmbrrwVHyThpfZ84t Xoy3HOmGG5f0TUOFxKXJBbaiL7D/0lRZ4o15M1QJAS9AnaWiv9MPrgHZCze/YzuwCoOq jMiYpBdM4+MsG6jW4MBjIomZn4VDdceHLdEWxPr7qom21Dk05kJC5dvh45829kHhunMh TCsSJiAFsAI1VOhVF2SLJ9KoRjnBZt7H1DElO1vEj21waK2y4jJmpgX2lD/ocETqOrxZ NSz0fsSYSrrsBmEjONyM3z7f1X32TfCb4kYca2/0t7gOXmKbgvg68DSKA8p3k4orREEL 4ctw== X-Gm-Message-State: ALoCoQnwslsTQfj4Xe/1REiXgVH26flsiLPTaeVQCHRxoWwCsDaCj+GDeLyRabmBFYC/NnrO11JU X-Received: by 10.15.95.9 with SMTP id bc9mr184518eeb.97.1378200607898; Tue, 03 Sep 2013 02:30:07 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id z12sm29882771eev.6.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Sep 2013 02:30:07 -0700 (PDT) From: Ulf Hansson To: linux-arm-kernel@lists.infradead.org, Russell King Subject: [PATCH V3 2/4] mmc: mmci: Use optional sleep pinctrl state Date: Tue, 3 Sep 2013 11:29:34 +0200 Message-Id: <1378200576-13413-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1378200576-13413-1-git-send-email-ulf.hansson@linaro.org> References: <1378200576-13413-1-git-send-email-ulf.hansson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130903_053029_777369_E7E58EAD X-CRM114-Status: GOOD ( 11.86 ) X-Spam-Score: -2.6 (--) Cc: Linus Walleij , Chris Ball , linux-mmc@vger.kernel.org, Daniel Lezcano , Ulf Hansson X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP By optionally putting the pins into sleep state in the .runtime_suspend callback we can accomplish two things. One is to minimize current leakage from pins and thus save power, second we can prevent the IP from driving pins output in an uncontrolled manner, which may happen if the power domain drops the domain regulator. When returning from idle, entering .runtime_resume callback, the pins are restored to default state. Signed-off-by: Ulf Hansson Acked-by: Rickard Andersson Cc: Linus Walleij Reviewed-by: Linus Walleij --- drivers/mmc/host/mmci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 5dffbbd..c550b3e 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1750,6 +1750,7 @@ static int mmci_runtime_suspend(struct device *dev) if (mmc) { struct mmci_host *host = mmc_priv(mmc); + pinctrl_pm_select_sleep_state(dev); clk_disable_unprepare(host->clk); } @@ -1764,6 +1765,7 @@ static int mmci_runtime_resume(struct device *dev) if (mmc) { struct mmci_host *host = mmc_priv(mmc); clk_prepare_enable(host->clk); + pinctrl_pm_select_default_state(dev); } return 0;