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: 19701 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f69.google.com (mail-qe0-f69.google.com [209.85.128.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F1D8124869 for ; Tue, 3 Sep 2013 09:30:09 +0000 (UTC) Received: by mail-qe0-f69.google.com with SMTP id 5sf6301668qeb.0 for ; Tue, 03 Sep 2013 02:30:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=ynXGiKO99JKz6y4wSv7xJInGUyMWGE6N497TqjVM2d0=; b=Dv2KGnD+HYpavpmPv2w2TOr84UZ2UIOhE3dE6lnJ/XLHhS5FEwzTAhb1g3IlJwUpsk qRbWbFT71MOumaBkFNZpdfxwqy3VUDLinF4ur+6aP/yhxDD0ikKgNDSeyp8ghUPRqF1p 4kS0yu3cs5GIXGcMkdfTISEdppfT6B1+ixBjcpMQrnzlrSENjsvDzCmYFHYVCFZOt24E 1RKVRjCO1FOamLq32PljBOPHau3DOzusSZ/bgYptSL61e0ZQtvyXWJzoGLx6zAUp4mjb 1cSwuEN2UGGrvsa+uR6UiaEXUZszWPhFGcBMI2mNswDUXLMmJvyjzmUuv03L9jkYFqDc PKQw== X-Received: by 10.236.69.35 with SMTP id m23mr10084482yhd.6.1378200609798; Tue, 03 Sep 2013 02:30:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.60.9 with SMTP id d9ls2477990qer.55.gmail; Tue, 03 Sep 2013 02:30:09 -0700 (PDT) X-Received: by 10.220.91.16 with SMTP id k16mr7481289vcm.21.1378200609688; Tue, 03 Sep 2013 02:30:09 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id sk7si4205920vdc.77.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Sep 2013 02:30:09 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id m1so3750409ves.41 for ; Tue, 03 Sep 2013 02:30:09 -0700 (PDT) X-Gm-Message-State: ALoCoQn++f56SeA0GBJibLC4r6sL05LwuiQ57KoL55gmK1tgZwhQT4K7+eILrDk7dV9pXqTb03Q7 X-Received: by 10.220.144.68 with SMTP id y4mr20508vcu.28.1378200609433; Tue, 03 Sep 2013 02:30:09 -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.220.174.196 with SMTP id u4csp160146vcz; Tue, 3 Sep 2013 02:30:08 -0700 (PDT) X-Received: by 10.14.223.1 with SMTP id u1mr45207544eep.10.1378200608438; Tue, 03 Sep 2013 02:30:08 -0700 (PDT) Received: from mail-ea0-f180.google.com (mail-ea0-f180.google.com [209.85.215.180]) by mx.google.com with ESMTPS id p9si13774107eeu.114.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Sep 2013 02:30:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.180 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.215.180; Received: by mail-ea0-f180.google.com with SMTP id h10so2876364eaj.11 for ; Tue, 03 Sep 2013 02:30:08 -0700 (PDT) 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 Cc: linux-mmc@vger.kernel.org, Chris Ball , Daniel Lezcano , Linus Walleij , Ulf Hansson 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 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: , 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 --- 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;