From patchwork Tue Jun 12 18:06:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9236 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 93D8F23E4F for ; Tue, 12 Jun 2012 18:06:45 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 47143A189B7 for ; Tue, 12 Jun 2012 18:06:45 +0000 (UTC) Received: by ghbz12 with SMTP id z12so4025800ghb.11 for ; Tue, 12 Jun 2012 11:06:44 -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=lFpDVzMbbFR5y0Q/o2uOTirWyB25UT/eT7jbyoQGWz8=; b=GJ0y0g872NfDBXa+kQ8NXtynqNGedREqPa9M4FegxgbNGQH0z6iounyeJt7nRO1M4c M+dlVGLcbV0RgYGONvdR2mtn7faKTHvwoEWSJcCKl15vCV+JZNny0f0WGN64MOP9p+lP 0vfLhfn9xlRT9swAwMJBSjfDhk6seeY5qgUalWY1oU3W3cDAAKI/ycLXwsaFRhAmGgj0 MNqin+MiZGz3yvNQApTykkrYP4Fb928QIFKHDvsDrYD14rKerVwfGgCBhdAmC+zLc/Jf AeUCEo72tDTbDkIpDHVnXq5EaUCIrWD5wSPy1FbfWwLrKnxvZS4TY9MjlVQXSNP7QnHe elzw== Received: by 10.50.163.99 with SMTP id yh3mr9025750igb.53.1339524404574; Tue, 12 Jun 2012 11:06:44 -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 v20csp181075ibb; Tue, 12 Jun 2012 11:06:43 -0700 (PDT) Received: by 10.14.37.2 with SMTP id x2mr7393059eea.72.1339524402316; Tue, 12 Jun 2012 11:06:42 -0700 (PDT) Received: from eu1sys200aog110.obsmtp.com (eu1sys200aog110.obsmtp.com. [207.126.144.129]) by mx.google.com with SMTP id t8si9605235eef.4.2012.06.12.11.06.32 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Jun 2012 11:06:42 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.129 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.129; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.129 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-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob110.postini.com ([207.126.147.11]) with SMTP ID DSNKT9eFKC2nzuTTb3ZitHrM9WdXdYyPiw5A@postini.com; Tue, 12 Jun 2012 18:06:41 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 EBAFEB4; Tue, 12 Jun 2012 17:58:07 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id AA551FC5; Tue, 12 Jun 2012 18:06:26 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 6402624C07C; Tue, 12 Jun 2012 20:06:16 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Tue, 12 Jun 2012 20:06:25 +0200 From: Linus Walleij To: Andrew Morton Cc: Alessandro Zummo , , Linus Walleij Subject: [PATCH 1/2] rtc: coh901331: use clk_prepare/unprepare Date: Tue, 12 Jun 2012 20:06:17 +0200 Message-ID: <1339524377-5457-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: ALoCoQlK6k6i7JuDz1/BidIlHJQhwl6uLaQDhcvpu4erEn0y7YNI+D1+tuuV+vNrgTPoDmIc5QbV From: Linus Walleij Make sure we prepare/unprepare the clock for the COH901331 RTC driver as is required by the clk API especially if you use common clock. Signed-off-by: Linus Walleij --- drivers/rtc/rtc-coh901331.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-coh901331.c b/drivers/rtc/rtc-coh901331.c index a5b8a0c..5866502 100644 --- a/drivers/rtc/rtc-coh901331.c +++ b/drivers/rtc/rtc-coh901331.c @@ -157,6 +157,7 @@ static int __exit coh901331_remove(struct platform_device *pdev) if (rtap) { free_irq(rtap->irq, rtap); rtc_device_unregister(rtap->rtc); + clk_unprepare(rtap->clk); clk_put(rtap->clk); iounmap(rtap->virtbase); release_mem_region(rtap->phybase, rtap->physize); @@ -213,10 +214,10 @@ static int __init coh901331_probe(struct platform_device *pdev) } /* We enable/disable the clock only to assure it works */ - ret = clk_enable(rtap->clk); + ret = clk_prepare_enable(rtap->clk); if (ret) { dev_err(&pdev->dev, "could not enable clock\n"); - goto out_no_clk_enable; + goto out_no_clk_prepenable; } clk_disable(rtap->clk); @@ -232,7 +233,8 @@ static int __init coh901331_probe(struct platform_device *pdev) out_no_rtc: platform_set_drvdata(pdev, NULL); - out_no_clk_enable: + clk_unprepare(rtap->clk); + out_no_clk_prepenable: clk_put(rtap->clk); out_no_clk: free_irq(rtap->irq, rtap); @@ -265,6 +267,7 @@ static int coh901331_suspend(struct platform_device *pdev, pm_message_t state) writel(0, rtap->virtbase + COH901331_IRQ_MASK); clk_disable(rtap->clk); } + clk_unprepare(rtap->clk); return 0; } @@ -272,6 +275,7 @@ static int coh901331_resume(struct platform_device *pdev) { struct coh901331_port *rtap = dev_get_drvdata(&pdev->dev); + clk_prepare(rtap->clk); if (device_may_wakeup(&pdev->dev)) { disable_irq_wake(rtap->irq); } else { @@ -293,6 +297,7 @@ static void coh901331_shutdown(struct platform_device *pdev) clk_enable(rtap->clk); writel(0, rtap->virtbase + COH901331_IRQ_MASK); clk_disable(rtap->clk); + clk_unprepare(rtap->clk); } static struct platform_driver coh901331_driver = {