From patchwork Tue Jun 12 14:20:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9231 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 3FBE123EB4 for ; Tue, 12 Jun 2012 14:20:37 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 11065A189C1 for ; Tue, 12 Jun 2012 14:20:36 +0000 (UTC) Received: by mail-gg0-f180.google.com with SMTP id f1so3765006ggn.11 for ; Tue, 12 Jun 2012 07:20:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=3MTIieOCJJDghYblyQyddddBEfIz1ffgyJr2xGJcajE=; b=C9Glk8K7YGOrC9tnggdhPNBAivTgCr8j1dT3gh2pfAURkpb2uALdQVgDBBLLVMq9FN HmMDRuzSBmxBIt7lbmv8PBhWXFrHGC4By4O1KIUOX19ErBUcfkZ8GnAWpn0tvhd/MQSj 5N1rs3i+P7jTcu7XSNUrkpqarbyp9TFRF8vvBytKwXBDhdAYWDIDFcGhxTzdPt7E6Tx6 IMMkZPpmmXUFyAOC6qp7rfxmOckwu9GI4GRwm9+6Cp5JSaJ5trnloSkwthJkWLYUKM0l 0WlPpD8IqydaLy+Dhh0ZEN/pSi0xl03eR5mT3wwqJu/nOPhMpd21jfeyxe/udCRrR22S rtOg== Received: by 10.50.203.39 with SMTP id kn7mr8339015igc.53.1339510836544; Tue, 12 Jun 2012 07:20:36 -0700 (PDT) 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.231.24.148 with SMTP id v20csp169392ibb; Tue, 12 Jun 2012 07:20:35 -0700 (PDT) Received: by 10.14.101.73 with SMTP id a49mr1159126eeg.34.1339510835257; Tue, 12 Jun 2012 07:20:35 -0700 (PDT) Received: from eu1sys200aog109.obsmtp.com (eu1sys200aog109.obsmtp.com. [207.126.144.127]) by mx.google.com with SMTP id y8si9241089eef.75.2012.06.12.07.20.27 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Jun 2012 07:20:35 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.127 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.127; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.127 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob109.postini.com ([207.126.147.11]) with SMTP ID DSNKT9dQK42twVCuuhjzCAcM2FG7sHZ3p2C7@postini.com; Tue, 12 Jun 2012 14:20:35 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 CCC12164; Tue, 12 Jun 2012 14:20:21 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7FE6844AA; Tue, 12 Jun 2012 14:20:21 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 55EAFA8093; Tue, 12 Jun 2012 16:20:15 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Tue, 12 Jun 2012 16:20:21 +0200 From: Linus Walleij To: Grant Likely , Cc: Viresh Kumar , Linus Walleij , Vinit Shenoy Subject: [PATCH 3/3] spi/pl022: enable runtime PM Date: Tue, 12 Jun 2012 16:20:16 +0200 Message-ID: <1339510816-13404-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.9.2 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkd5Ks70hJp9ZnuCQzrKsnkVvl2newNBgqrAya2GEL8RM0/XHM8AtHD02GpYUn9wY/DsL6T From: Linus Walleij If we're gonna use runtime PM it's a pretty good idea to actually enable it in probe() and disable it in remove() too, so it gets used for real. Up until now we only fooled around with the reference count. Cc: Vinit Shenoy Signed-off-by: Linus Walleij --- drivers/spi/spi-pl022.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index 5eab281..aab518e 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -2053,6 +2053,9 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id) printk(KERN_INFO "pl022: mapped registers from 0x%08x to %p\n", adev->res.start, pl022->virtbase); + pm_runtime_enable(dev); + pm_runtime_resume(dev); + pl022->clk = clk_get(&adev->dev, NULL); if (IS_ERR(pl022->clk)) { status = PTR_ERR(pl022->clk); @@ -2163,6 +2166,7 @@ pl022_remove(struct amba_device *adev) clk_disable(pl022->clk); clk_unprepare(pl022->clk); clk_put(pl022->clk); + pm_runtime_disable(&adev->dev); iounmap(pl022->virtbase); amba_release_regions(adev); tasklet_disable(&pl022->pump_transfers);