* [PATCH] rtc: mt6397: implement suspend/resume function in rtc-mt6397 driver
@ 2015-07-30 14:53 ` Henry Chen
0 siblings, 0 replies; 11+ messages in thread
From: Henry Chen @ 2015-07-30 14:53 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Alessandro Zummo, Eddie Huang, Matthias Brugger, linux-arm-kernel,
linux-mediatek, rtc-linux, linux-kernel, Henry Chen
Implement the suspend/resume function in order to control rtc's irq_wake flag and handle as wakeup source.
Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
---
drivers/rtc/rtc-mt6397.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index c0090b6..9f6c9f8 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -373,6 +373,31 @@ static int mtk_rtc_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_PM_SLEEP
+static int mt6397_rtc_suspend(struct device *dev)
+{
+ struct mt6397_rtc *rtc = dev_get_drvdata(dev);
+
+ if (device_may_wakeup(dev))
+ enable_irq_wake(rtc->irq);
+
+ return 0;
+}
+
+static int mt6397_rtc_resume(struct device *dev)
+{
+ struct mt6397_rtc *rtc = dev_get_drvdata(dev);
+
+ if (device_may_wakeup(dev))
+ disable_irq_wake(rtc->irq);
+
+ return 0;
+}
+#endif
+
+static SIMPLE_DEV_PM_OPS(mt6397_pm_ops, mt6397_rtc_suspend,
+ mt6397_rtc_resume);
+
static const struct of_device_id mt6397_rtc_of_match[] = {
{ .compatible = "mediatek,mt6397-rtc", },
{ }
@@ -382,6 +407,7 @@ static struct platform_driver mtk_rtc_driver = {
.driver = {
.name = "mt6397-rtc",
.of_match_table = mt6397_rtc_of_match,
+ .pm = &mt6397_pm_ops,
},
.probe = mtk_rtc_probe,
.remove = mtk_rtc_remove,
--
1.8.1.1.dirty
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH] rtc: mt6397: implement suspend/resume function in rtc-mt6397 driver
@ 2015-07-30 14:53 ` Henry Chen
0 siblings, 0 replies; 11+ messages in thread
From: Henry Chen @ 2015-07-30 14:53 UTC (permalink / raw)
To: linux-arm-kernel
Implement the suspend/resume function in order to control rtc's irq_wake flag and handle as wakeup source.
Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
---
drivers/rtc/rtc-mt6397.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index c0090b6..9f6c9f8 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -373,6 +373,31 @@ static int mtk_rtc_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_PM_SLEEP
+static int mt6397_rtc_suspend(struct device *dev)
+{
+ struct mt6397_rtc *rtc = dev_get_drvdata(dev);
+
+ if (device_may_wakeup(dev))
+ enable_irq_wake(rtc->irq);
+
+ return 0;
+}
+
+static int mt6397_rtc_resume(struct device *dev)
+{
+ struct mt6397_rtc *rtc = dev_get_drvdata(dev);
+
+ if (device_may_wakeup(dev))
+ disable_irq_wake(rtc->irq);
+
+ return 0;
+}
+#endif
+
+static SIMPLE_DEV_PM_OPS(mt6397_pm_ops, mt6397_rtc_suspend,
+ mt6397_rtc_resume);
+
static const struct of_device_id mt6397_rtc_of_match[] = {
{ .compatible = "mediatek,mt6397-rtc", },
{ }
@@ -382,6 +407,7 @@ static struct platform_driver mtk_rtc_driver = {
.driver = {
.name = "mt6397-rtc",
.of_match_table = mt6397_rtc_of_match,
+ .pm = &mt6397_pm_ops,
},
.probe = mtk_rtc_probe,
.remove = mtk_rtc_remove,
--
1.8.1.1.dirty
^ permalink raw reply related [flat|nested] 11+ messages in thread* [rtc-linux] [PATCH] rtc: mt6397: implement suspend/resume function in rtc-mt6397 driver
@ 2015-07-30 14:53 ` Henry Chen
0 siblings, 0 replies; 11+ messages in thread
From: Henry Chen @ 2015-07-30 14:53 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Alessandro Zummo, Eddie Huang, Matthias Brugger, linux-arm-kernel,
linux-mediatek, rtc-linux, linux-kernel, Henry Chen
Implement the suspend/resume function in order to control rtc's irq_wake flag and handle as wakeup source.
Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
---
drivers/rtc/rtc-mt6397.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index c0090b6..9f6c9f8 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -373,6 +373,31 @@ static int mtk_rtc_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_PM_SLEEP
+static int mt6397_rtc_suspend(struct device *dev)
+{
+ struct mt6397_rtc *rtc = dev_get_drvdata(dev);
+
+ if (device_may_wakeup(dev))
+ enable_irq_wake(rtc->irq);
+
+ return 0;
+}
+
+static int mt6397_rtc_resume(struct device *dev)
+{
+ struct mt6397_rtc *rtc = dev_get_drvdata(dev);
+
+ if (device_may_wakeup(dev))
+ disable_irq_wake(rtc->irq);
+
+ return 0;
+}
+#endif
+
+static SIMPLE_DEV_PM_OPS(mt6397_pm_ops, mt6397_rtc_suspend,
+ mt6397_rtc_resume);
+
static const struct of_device_id mt6397_rtc_of_match[] = {
{ .compatible = "mediatek,mt6397-rtc", },
{ }
@@ -382,6 +407,7 @@ static struct platform_driver mtk_rtc_driver = {
.driver = {
.name = "mt6397-rtc",
.of_match_table = mt6397_rtc_of_match,
+ .pm = &mt6397_pm_ops,
},
.probe = mtk_rtc_probe,
.remove = mtk_rtc_remove,
--
1.8.1.1.dirty
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH] rtc: mt6397: implement suspend/resume function in rtc-mt6397 driver
2015-07-30 14:53 ` [rtc-linux] " Henry Chen
(?)
(?)
@ 2015-07-31 1:32 ` Eddie Huang
-1 siblings, 0 replies; 11+ messages in thread
From: Eddie Huang @ 2015-07-31 1:32 UTC (permalink / raw)
To: Henry Chen
Cc: Alexandre Belloni, Alessandro Zummo, Matthias Brugger,
linux-arm-kernel, linux-mediatek, rtc-linux, linux-kernel
On Thu, 2015-07-30 at 22:53 +0800, Henry Chen wrote:
> Implement the suspend/resume function in order to control rtc's irq_wake flag and handle as wakeup source.
>
> Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
> ---
> drivers/rtc/rtc-mt6397.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
> index c0090b6..9f6c9f8 100644
> --- a/drivers/rtc/rtc-mt6397.c
> +++ b/drivers/rtc/rtc-mt6397.c
> @@ -373,6 +373,31 @@ static int mtk_rtc_remove(struct platform_device *pdev)
> return 0;
> }
>
> +#ifdef CONFIG_PM_SLEEP
> +static int mt6397_rtc_suspend(struct device *dev)
> +{
> + struct mt6397_rtc *rtc = dev_get_drvdata(dev);
> +
> + if (device_may_wakeup(dev))
> + enable_irq_wake(rtc->irq);
> +
> + return 0;
> +}
> +
> +static int mt6397_rtc_resume(struct device *dev)
> +{
> + struct mt6397_rtc *rtc = dev_get_drvdata(dev);
> +
> + if (device_may_wakeup(dev))
> + disable_irq_wake(rtc->irq);
> +
> + return 0;
> +}
> +#endif
> +
> +static SIMPLE_DEV_PM_OPS(mt6397_pm_ops, mt6397_rtc_suspend,
> + mt6397_rtc_resume);
> +
> static const struct of_device_id mt6397_rtc_of_match[] = {
> { .compatible = "mediatek,mt6397-rtc", },
> { }
> @@ -382,6 +407,7 @@ static struct platform_driver mtk_rtc_driver = {
> .driver = {
> .name = "mt6397-rtc",
> .of_match_table = mt6397_rtc_of_match,
> + .pm = &mt6397_pm_ops,
> },
> .probe = mtk_rtc_probe,
> .remove = mtk_rtc_remove,
It looks good to me.
Acked-by: Eddie Huang <eddie.huang@mediatek.com>
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH] rtc: mt6397: implement suspend/resume function in rtc-mt6397 driver
@ 2015-07-31 1:32 ` Eddie Huang
0 siblings, 0 replies; 11+ messages in thread
From: Eddie Huang @ 2015-07-31 1:32 UTC (permalink / raw)
To: Henry Chen
Cc: Alexandre Belloni, Alessandro Zummo, Matthias Brugger,
linux-arm-kernel, linux-mediatek, rtc-linux, linux-kernel
On Thu, 2015-07-30 at 22:53 +0800, Henry Chen wrote:
> Implement the suspend/resume function in order to control rtc's irq_wake flag and handle as wakeup source.
>
> Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
> ---
> drivers/rtc/rtc-mt6397.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
> index c0090b6..9f6c9f8 100644
> --- a/drivers/rtc/rtc-mt6397.c
> +++ b/drivers/rtc/rtc-mt6397.c
> @@ -373,6 +373,31 @@ static int mtk_rtc_remove(struct platform_device *pdev)
> return 0;
> }
>
> +#ifdef CONFIG_PM_SLEEP
> +static int mt6397_rtc_suspend(struct device *dev)
> +{
> + struct mt6397_rtc *rtc = dev_get_drvdata(dev);
> +
> + if (device_may_wakeup(dev))
> + enable_irq_wake(rtc->irq);
> +
> + return 0;
> +}
> +
> +static int mt6397_rtc_resume(struct device *dev)
> +{
> + struct mt6397_rtc *rtc = dev_get_drvdata(dev);
> +
> + if (device_may_wakeup(dev))
> + disable_irq_wake(rtc->irq);
> +
> + return 0;
> +}
> +#endif
> +
> +static SIMPLE_DEV_PM_OPS(mt6397_pm_ops, mt6397_rtc_suspend,
> + mt6397_rtc_resume);
> +
> static const struct of_device_id mt6397_rtc_of_match[] = {
> { .compatible = "mediatek,mt6397-rtc", },
> { }
> @@ -382,6 +407,7 @@ static struct platform_driver mtk_rtc_driver = {
> .driver = {
> .name = "mt6397-rtc",
> .of_match_table = mt6397_rtc_of_match,
> + .pm = &mt6397_pm_ops,
> },
> .probe = mtk_rtc_probe,
> .remove = mtk_rtc_remove,
It looks good to me.
Acked-by: Eddie Huang <eddie.huang@mediatek.com>
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH] rtc: mt6397: implement suspend/resume function in rtc-mt6397 driver
@ 2015-07-31 1:32 ` Eddie Huang
0 siblings, 0 replies; 11+ messages in thread
From: Eddie Huang @ 2015-07-31 1:32 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, 2015-07-30 at 22:53 +0800, Henry Chen wrote:
> Implement the suspend/resume function in order to control rtc's irq_wake flag and handle as wakeup source.
>
> Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
> ---
> drivers/rtc/rtc-mt6397.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
> index c0090b6..9f6c9f8 100644
> --- a/drivers/rtc/rtc-mt6397.c
> +++ b/drivers/rtc/rtc-mt6397.c
> @@ -373,6 +373,31 @@ static int mtk_rtc_remove(struct platform_device *pdev)
> return 0;
> }
>
> +#ifdef CONFIG_PM_SLEEP
> +static int mt6397_rtc_suspend(struct device *dev)
> +{
> + struct mt6397_rtc *rtc = dev_get_drvdata(dev);
> +
> + if (device_may_wakeup(dev))
> + enable_irq_wake(rtc->irq);
> +
> + return 0;
> +}
> +
> +static int mt6397_rtc_resume(struct device *dev)
> +{
> + struct mt6397_rtc *rtc = dev_get_drvdata(dev);
> +
> + if (device_may_wakeup(dev))
> + disable_irq_wake(rtc->irq);
> +
> + return 0;
> +}
> +#endif
> +
> +static SIMPLE_DEV_PM_OPS(mt6397_pm_ops, mt6397_rtc_suspend,
> + mt6397_rtc_resume);
> +
> static const struct of_device_id mt6397_rtc_of_match[] = {
> { .compatible = "mediatek,mt6397-rtc", },
> { }
> @@ -382,6 +407,7 @@ static struct platform_driver mtk_rtc_driver = {
> .driver = {
> .name = "mt6397-rtc",
> .of_match_table = mt6397_rtc_of_match,
> + .pm = &mt6397_pm_ops,
> },
> .probe = mtk_rtc_probe,
> .remove = mtk_rtc_remove,
It looks good to me.
Acked-by: Eddie Huang <eddie.huang@mediatek.com>
^ permalink raw reply [flat|nested] 11+ messages in thread* [rtc-linux] Re: [PATCH] rtc: mt6397: implement suspend/resume function in rtc-mt6397 driver
@ 2015-07-31 1:32 ` Eddie Huang
0 siblings, 0 replies; 11+ messages in thread
From: Eddie Huang @ 2015-07-31 1:32 UTC (permalink / raw)
To: Henry Chen
Cc: Alexandre Belloni, Alessandro Zummo, Matthias Brugger,
linux-arm-kernel, linux-mediatek, rtc-linux, linux-kernel
On Thu, 2015-07-30 at 22:53 +0800, Henry Chen wrote:
> Implement the suspend/resume function in order to control rtc's irq_wake flag and handle as wakeup source.
>
> Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
> ---
> drivers/rtc/rtc-mt6397.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
> index c0090b6..9f6c9f8 100644
> --- a/drivers/rtc/rtc-mt6397.c
> +++ b/drivers/rtc/rtc-mt6397.c
> @@ -373,6 +373,31 @@ static int mtk_rtc_remove(struct platform_device *pdev)
> return 0;
> }
>
> +#ifdef CONFIG_PM_SLEEP
> +static int mt6397_rtc_suspend(struct device *dev)
> +{
> + struct mt6397_rtc *rtc = dev_get_drvdata(dev);
> +
> + if (device_may_wakeup(dev))
> + enable_irq_wake(rtc->irq);
> +
> + return 0;
> +}
> +
> +static int mt6397_rtc_resume(struct device *dev)
> +{
> + struct mt6397_rtc *rtc = dev_get_drvdata(dev);
> +
> + if (device_may_wakeup(dev))
> + disable_irq_wake(rtc->irq);
> +
> + return 0;
> +}
> +#endif
> +
> +static SIMPLE_DEV_PM_OPS(mt6397_pm_ops, mt6397_rtc_suspend,
> + mt6397_rtc_resume);
> +
> static const struct of_device_id mt6397_rtc_of_match[] = {
> { .compatible = "mediatek,mt6397-rtc", },
> { }
> @@ -382,6 +407,7 @@ static struct platform_driver mtk_rtc_driver = {
> .driver = {
> .name = "mt6397-rtc",
> .of_match_table = mt6397_rtc_of_match,
> + .pm = &mt6397_pm_ops,
> },
> .probe = mtk_rtc_probe,
> .remove = mtk_rtc_remove,
It looks good to me.
Acked-by: Eddie Huang <eddie.huang@mediatek.com>
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] rtc: mt6397: implement suspend/resume function in rtc-mt6397 driver
2015-07-30 14:53 ` [rtc-linux] " Henry Chen
(?)
@ 2015-08-05 1:46 ` Alexandre Belloni
-1 siblings, 0 replies; 11+ messages in thread
From: Alexandre Belloni @ 2015-08-05 1:46 UTC (permalink / raw)
To: Henry Chen
Cc: Alessandro Zummo, Eddie Huang, Matthias Brugger, linux-arm-kernel,
linux-mediatek, rtc-linux, linux-kernel
On 30/07/2015 at 22:53:14 +0800, Henry Chen wrote :
> Implement the suspend/resume function in order to control rtc's irq_wake flag and handle as wakeup source.
>
> Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
> ---
> drivers/rtc/rtc-mt6397.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
Applied, thanks.
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] rtc: mt6397: implement suspend/resume function in rtc-mt6397 driver
@ 2015-08-05 1:46 ` Alexandre Belloni
0 siblings, 0 replies; 11+ messages in thread
From: Alexandre Belloni @ 2015-08-05 1:46 UTC (permalink / raw)
To: linux-arm-kernel
On 30/07/2015 at 22:53:14 +0800, Henry Chen wrote :
> Implement the suspend/resume function in order to control rtc's irq_wake flag and handle as wakeup source.
>
> Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
> ---
> drivers/rtc/rtc-mt6397.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
Applied, thanks.
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* [rtc-linux] Re: [PATCH] rtc: mt6397: implement suspend/resume function in rtc-mt6397 driver
@ 2015-08-05 1:46 ` Alexandre Belloni
0 siblings, 0 replies; 11+ messages in thread
From: Alexandre Belloni @ 2015-08-05 1:46 UTC (permalink / raw)
To: Henry Chen
Cc: Alessandro Zummo, Eddie Huang, Matthias Brugger, linux-arm-kernel,
linux-mediatek, rtc-linux, linux-kernel
On 30/07/2015 at 22:53:14 +0800, Henry Chen wrote :
> Implement the suspend/resume function in order to control rtc's irq_wake flag and handle as wakeup source.
>
> Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
> ---
> drivers/rtc/rtc-mt6397.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
Applied, thanks.
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 11+ messages in thread