From patchwork Thu Oct 18 15:53:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 1611751 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 90685DFB34 for ; Thu, 18 Oct 2012 15:56:19 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TOsQV-0007lU-2j; Thu, 18 Oct 2012 15:54:27 +0000 Received: from bombadil.infradead.org ([2001:4830:2446:ff00:4687:fcff:fea6:5117]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TOsQJ-0007kS-77 for linux-arm-kernel@merlin.infradead.org; Thu, 18 Oct 2012 15:54:15 +0000 Received: from svenfoo.org ([82.94.215.22] helo=mail.zonque.de) by bombadil.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TOsQH-0001aD-EI for linux-arm-kernel@lists.infradead.org; Thu, 18 Oct 2012 15:54:14 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.zonque.de (Postfix) with ESMTP id EA5F9C00DD; Thu, 18 Oct 2012 17:54:01 +0200 (CEST) Received: from mail.zonque.de ([127.0.0.1]) by localhost (rambrand.bugwerft.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ml4KDYiMRkjT; Thu, 18 Oct 2012 17:54:01 +0200 (CEST) Received: from tamtam.taperay.com (i59F76258.versanet.de [89.247.98.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.zonque.de (Postfix) with ESMTPSA id 81A03C009B; Thu, 18 Oct 2012 17:54:01 +0200 (CEST) From: Daniel Mack To: rtc-linux@googlegroups.com Subject: [PATCH 2/3] RTC: omap-rtc: enable pm_runtime Date: Thu, 18 Oct 2012 17:53:50 +0200 Message-Id: <1350575631-15523-2-git-send-email-zonque@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1350575631-15523-1-git-send-email-zonque@gmail.com> References: <1350575631-15523-1-git-send-email-zonque@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121018_115413_659847_1E57CE02 X-CRM114-Status: GOOD ( 10.36 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (zonque[at]gmail.com) 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED 0.8 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.9 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list Cc: a.zummo@towertech.it, koen@dominion.thruhere.net, Daniel Mack , david-b@pacbell.net, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This is needed as preparation for platforms where using pm runtime usage is mandatory. Signed-off-by: Daniel Mack --- drivers/rtc/rtc-omap.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c index 0b614e3..baa876e 100644 --- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -322,6 +323,9 @@ static int __init omap_rtc_probe(struct platform_device *pdev) goto fail; } + pm_runtime_enable(&pdev->dev); + pm_runtime_get_sync(&pdev->dev); + rtc = rtc_device_register(pdev->name, &pdev->dev, &omap_rtc_ops, THIS_MODULE); if (IS_ERR(rtc)) { @@ -420,6 +424,8 @@ static int __exit omap_rtc_remove(struct platform_device *pdev) free_irq(omap_rtc_alarm, rtc); rtc_device_unregister(rtc); + pm_runtime_put_sync(&pdev->dev); + pm_runtime_disable(&pdev->dev); iounmap(rtc_base); release_mem_region(mem->start, resource_size(mem)); return 0; @@ -442,11 +448,15 @@ static int omap_rtc_suspend(struct platform_device *pdev, pm_message_t state) else rtc_write(0, OMAP_RTC_INTERRUPTS_REG); + pm_runtime_put_sync(&pdev->dev); + return 0; } static int omap_rtc_resume(struct platform_device *pdev) { + pm_runtime_get_sync(&pdev->dev); + if (device_may_wakeup(&pdev->dev)) disable_irq_wake(omap_rtc_alarm); else