From: Daniel Mack <zonque@gmail.com>
To: rtc-linux@googlegroups.com
Cc: a.zummo@towertech.it, david-b@pacbell.net,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
koen@dominion.thruhere.net, Daniel Mack <zonque@gmail.com>
Subject: [PATCH 2/3] RTC: omap-rtc: enable pm_runtime
Date: Thu, 18 Oct 2012 17:53:50 +0200 [thread overview]
Message-ID: <1350575631-15523-2-git-send-email-zonque@gmail.com> (raw)
In-Reply-To: <1350575631-15523-1-git-send-email-zonque@gmail.com>
This is needed as preparation for platforms where using pm runtime usage
is mandatory.
Signed-off-by: Daniel Mack <zonque@gmail.com>
---
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 <linux/module.h>
#include <linux/ioport.h>
#include <linux/delay.h>
+#include <linux/pm_runtime.h>
#include <linux/rtc.h>
#include <linux/bcd.h>
#include <linux/platform_device.h>
@@ -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
--
1.7.11.7
WARNING: multiple messages have this Message-ID (diff)
From: zonque@gmail.com (Daniel Mack)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] RTC: omap-rtc: enable pm_runtime
Date: Thu, 18 Oct 2012 17:53:50 +0200 [thread overview]
Message-ID: <1350575631-15523-2-git-send-email-zonque@gmail.com> (raw)
In-Reply-To: <1350575631-15523-1-git-send-email-zonque@gmail.com>
This is needed as preparation for platforms where using pm runtime usage
is mandatory.
Signed-off-by: Daniel Mack <zonque@gmail.com>
---
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 <linux/module.h>
#include <linux/ioport.h>
#include <linux/delay.h>
+#include <linux/pm_runtime.h>
#include <linux/rtc.h>
#include <linux/bcd.h>
#include <linux/platform_device.h>
@@ -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
--
1.7.11.7
next prev parent reply other threads:[~2012-10-18 15:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-18 15:53 [PATCH 1/3] RTC: omap-rtc: enable for SOC_AM33XX Daniel Mack
2012-10-18 15:53 ` Daniel Mack
2012-10-18 15:53 ` Daniel Mack [this message]
2012-10-18 15:53 ` [PATCH 2/3] RTC: omap-rtc: enable pm_runtime Daniel Mack
2012-10-18 16:12 ` Vaibhav Hiremath
2012-10-18 16:12 ` Vaibhav Hiremath
2012-10-18 16:19 ` Daniel Mack
2012-10-18 16:19 ` Daniel Mack
2012-10-18 16:33 ` Hiremath, Vaibhav
2012-10-18 16:33 ` Hiremath, Vaibhav
2012-10-19 10:58 ` Mohammed, Afzal
2012-10-19 10:58 ` Mohammed, Afzal
2012-10-21 19:51 ` Daniel Mack
2012-10-21 19:51 ` Daniel Mack
2012-10-22 5:59 ` Hiremath, Vaibhav
2012-10-22 5:59 ` Hiremath, Vaibhav
2012-10-18 15:53 ` [PATCH 3/3] RTC: omap-rtc: add DT bindings Daniel Mack
2012-10-18 15:53 ` Daniel Mack
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1350575631-15523-2-git-send-email-zonque@gmail.com \
--to=zonque@gmail.com \
--cc=a.zummo@towertech.it \
--cc=david-b@pacbell.net \
--cc=koen@dominion.thruhere.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=rtc-linux@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.