linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* rtc: fsl-ftm-alarm: add shutdown interface
@ 2020-03-30 12:26 Biwen Li
  2020-03-30 16:44 ` Alexandre Belloni
  0 siblings, 1 reply; 4+ messages in thread
From: Biwen Li @ 2020-03-30 12:26 UTC (permalink / raw)
  To: alexandre.belloni, leoyang.li
  Cc: linux-rtc, linux-kernel, jiafei.pan, Biwen Li

From: Biwen Li <biwen.li@nxp.com>

Add shutdown interface

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 drivers/rtc/rtc-fsl-ftm-alarm.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c b/drivers/rtc/rtc-fsl-ftm-alarm.c
index d7fa6c16f47b..118a775e8316 100644
--- a/drivers/rtc/rtc-fsl-ftm-alarm.c
+++ b/drivers/rtc/rtc-fsl-ftm-alarm.c
@@ -307,6 +307,15 @@ static int ftm_rtc_probe(struct platform_device *pdev)
 	return 0;
 }
 
+static void ftm_rtc_shutdown(struct platform_device *pdev)
+{
+	struct ftm_rtc *rtc = platform_get_drvdata(pdev);
+
+	ftm_irq_acknowledge(rtc);
+	ftm_irq_disable(rtc);
+	ftm_clean_alarm(rtc);
+}
+
 static const struct of_device_id ftm_rtc_match[] = {
 	{ .compatible = "fsl,ls1012a-ftm-alarm", },
 	{ .compatible = "fsl,ls1021a-ftm-alarm", },
@@ -321,6 +330,7 @@ static const struct of_device_id ftm_rtc_match[] = {
 
 static struct platform_driver ftm_rtc_driver = {
 	.probe		= ftm_rtc_probe,
+	.shutdown	= ftm_rtc_shutdown,
 	.driver		= {
 		.name	= "ftm-alarm",
 		.of_match_table = ftm_rtc_match,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: rtc: fsl-ftm-alarm: add shutdown interface
  2020-03-30 12:26 rtc: fsl-ftm-alarm: add shutdown interface Biwen Li
@ 2020-03-30 16:44 ` Alexandre Belloni
  2020-09-15 10:28   ` Alexandre Belloni
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Belloni @ 2020-03-30 16:44 UTC (permalink / raw)
  To: Biwen Li; +Cc: leoyang.li, linux-rtc, linux-kernel, jiafei.pan, Biwen Li

On 30/03/2020 20:26:16+0800, Biwen Li wrote:
> From: Biwen Li <biwen.li@nxp.com>
> 
> Add shutdown interface
> 
> Signed-off-by: Biwen Li <biwen.li@nxp.com>
> ---
>  drivers/rtc/rtc-fsl-ftm-alarm.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c b/drivers/rtc/rtc-fsl-ftm-alarm.c
> index d7fa6c16f47b..118a775e8316 100644
> --- a/drivers/rtc/rtc-fsl-ftm-alarm.c
> +++ b/drivers/rtc/rtc-fsl-ftm-alarm.c
> @@ -307,6 +307,15 @@ static int ftm_rtc_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static void ftm_rtc_shutdown(struct platform_device *pdev)
> +{
> +	struct ftm_rtc *rtc = platform_get_drvdata(pdev);
> +
> +	ftm_irq_acknowledge(rtc);
> +	ftm_irq_disable(rtc);
> +	ftm_clean_alarm(rtc);

If the alarm is able to start the platform, then you probably don't want
to disable the alarm on shutdown.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: rtc: fsl-ftm-alarm: add shutdown interface
  2020-03-30 16:44 ` Alexandre Belloni
@ 2020-09-15 10:28   ` Alexandre Belloni
  2020-09-15 10:35     ` [EXT] " Biwen Li
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Belloni @ 2020-09-15 10:28 UTC (permalink / raw)
  To: Biwen Li; +Cc: leoyang.li, linux-rtc, linux-kernel, jiafei.pan, Biwen Li

Hi,

On 30/03/2020 18:44:01+0200, Alexandre Belloni wrote:
> On 30/03/2020 20:26:16+0800, Biwen Li wrote:
> > From: Biwen Li <biwen.li@nxp.com>
> > 
> > Add shutdown interface
> > 
> > Signed-off-by: Biwen Li <biwen.li@nxp.com>
> > ---
> >  drivers/rtc/rtc-fsl-ftm-alarm.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c b/drivers/rtc/rtc-fsl-ftm-alarm.c
> > index d7fa6c16f47b..118a775e8316 100644
> > --- a/drivers/rtc/rtc-fsl-ftm-alarm.c
> > +++ b/drivers/rtc/rtc-fsl-ftm-alarm.c
> > @@ -307,6 +307,15 @@ static int ftm_rtc_probe(struct platform_device *pdev)
> >  	return 0;
> >  }
> >  
> > +static void ftm_rtc_shutdown(struct platform_device *pdev)
> > +{
> > +	struct ftm_rtc *rtc = platform_get_drvdata(pdev);
> > +
> > +	ftm_irq_acknowledge(rtc);
> > +	ftm_irq_disable(rtc);
> > +	ftm_clean_alarm(rtc);
> 
> If the alarm is able to start the platform, then you probably don't want
> to disable the alarm on shutdown.
> 

I realise you never replied to that question. Is that patch still of
interest?

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [EXT] Re: rtc: fsl-ftm-alarm: add shutdown interface
  2020-09-15 10:28   ` Alexandre Belloni
@ 2020-09-15 10:35     ` Biwen Li
  0 siblings, 0 replies; 4+ messages in thread
From: Biwen Li @ 2020-09-15 10:35 UTC (permalink / raw)
  To: Alexandre Belloni, Biwen Li (OSS)
  Cc: Leo Li, linux-rtc, linux-kernel, Jiafei Pan

> 
> Hi,
> 
> On 30/03/2020 18:44:01+0200, Alexandre Belloni wrote:
> > On 30/03/2020 20:26:16+0800, Biwen Li wrote:
> > > From: Biwen Li <biwen.li@nxp.com>
> > >
> > > Add shutdown interface
> > >
> > > Signed-off-by: Biwen Li <biwen.li@nxp.com>
> > > ---
> > >  drivers/rtc/rtc-fsl-ftm-alarm.c | 10 ++++++++++
> > >  1 file changed, 10 insertions(+)
> > >
> > > diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c
> > > b/drivers/rtc/rtc-fsl-ftm-alarm.c index d7fa6c16f47b..118a775e8316
> > > 100644
> > > --- a/drivers/rtc/rtc-fsl-ftm-alarm.c
> > > +++ b/drivers/rtc/rtc-fsl-ftm-alarm.c
> > > @@ -307,6 +307,15 @@ static int ftm_rtc_probe(struct platform_device
> *pdev)
> > >     return 0;
> > >  }
> > >
> > > +static void ftm_rtc_shutdown(struct platform_device *pdev) {
> > > +   struct ftm_rtc *rtc = platform_get_drvdata(pdev);
> > > +
> > > +   ftm_irq_acknowledge(rtc);
> > > +   ftm_irq_disable(rtc);
> > > +   ftm_clean_alarm(rtc);
> >
> > If the alarm is able to start the platform, then you probably don't
> > want to disable the alarm on shutdown.
> >
> 
> I realise you never replied to that question. Is that patch still of interest?
Hi Alex, you can drop it. Thanks.
Best Regards,
Biwen Li
> 
> --
> Alexandre Belloni, Bootlin
> Embedded Linux and Kernel engineering
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbootlin.c
> om%2F&amp;data=02%7C01%7Cbiwen.li%40nxp.com%7Cd688030894714bca7
> 5c708d8596210ec%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63
> 7357625013809281&amp;sdata=pOBMmsxi7DVlywuLZ2LOLVgK4r4GtvW1PYq1
> p9JVv74%3D&amp;reserved=0

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-15 10:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-30 12:26 rtc: fsl-ftm-alarm: add shutdown interface Biwen Li
2020-03-30 16:44 ` Alexandre Belloni
2020-09-15 10:28   ` Alexandre Belloni
2020-09-15 10:35     ` [EXT] " Biwen Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).