linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: test: enable wakeup flags
@ 2019-05-15 11:14 roman.stratiienko
  2019-05-15 12:32 ` Alexandre Belloni
  0 siblings, 1 reply; 3+ messages in thread
From: roman.stratiienko @ 2019-05-15 11:14 UTC (permalink / raw)
  To: a.zummo, alexandre.belloni, linux-rtc, linux-kernel; +Cc: Roman Stratiienko

From: Roman Stratiienko <roman.stratiienko@globallogic.com>

Alarmtimer interface uses only the RTC with wekeup flags enabled.
Allow to use rtc-test driver with alarmtimer interface.

Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
---
 drivers/rtc/rtc-test.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c
index 6c5f09c815e8..c839ae575c77 100644
--- a/drivers/rtc/rtc-test.c
+++ b/drivers/rtc/rtc-test.c
@@ -123,6 +123,8 @@ static int test_probe(struct platform_device *plat_dev)
 
 	platform_set_drvdata(plat_dev, rtd);
 
+	device_init_wakeup(&plat_dev->dev, 1);
+
 	rtd->rtc = devm_rtc_allocate_device(&plat_dev->dev);
 	if (IS_ERR(rtd->rtc))
 		return PTR_ERR(rtd->rtc);
-- 
2.17.1


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

* Re: [PATCH] rtc: test: enable wakeup flags
  2019-05-15 11:14 [PATCH] rtc: test: enable wakeup flags roman.stratiienko
@ 2019-05-15 12:32 ` Alexandre Belloni
       [not found]   ` <CAODwZ7vuBndm2i7CFm0RT1wM3phyQkQ+g0Gyjb1GE7k1-bHccQ@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Belloni @ 2019-05-15 12:32 UTC (permalink / raw)
  To: roman.stratiienko; +Cc: a.zummo, linux-rtc, linux-kernel

Hi,

(You didn't use my correct email address, please update your kernel)

On 15/05/2019 14:14:36+0300, roman.stratiienko@globallogic.com wrote:
> From: Roman Stratiienko <roman.stratiienko@globallogic.com>
> 
> Alarmtimer interface uses only the RTC with wekeup flags enabled.
> Allow to use rtc-test driver with alarmtimer interface.
> 
> Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
> ---
>  drivers/rtc/rtc-test.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c
> index 6c5f09c815e8..c839ae575c77 100644
> --- a/drivers/rtc/rtc-test.c
> +++ b/drivers/rtc/rtc-test.c
> @@ -123,6 +123,8 @@ static int test_probe(struct platform_device *plat_dev)
>  
>  	platform_set_drvdata(plat_dev, rtd);
>  
> +	device_init_wakeup(&plat_dev->dev, 1);
> +

The first created RTC doesn't have any alarm, so this must not be done
for all the devices.

Also, this driver will never wake up the platform so I'm not sure it is
relevant to test alarmtimers.

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

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

* Re: [PATCH] rtc: test: enable wakeup flags
       [not found]   ` <CAODwZ7vuBndm2i7CFm0RT1wM3phyQkQ+g0Gyjb1GE7k1-bHccQ@mail.gmail.com>
@ 2019-05-15 13:53     ` Roman Stratiienko
  0 siblings, 0 replies; 3+ messages in thread
From: Roman Stratiienko @ 2019-05-15 13:53 UTC (permalink / raw)
  To: Alexandre Belloni; +Cc: a.zummo, linux-rtc, linux-kernel

Hi Alexandre,

Thank you for the review.
See my answers below.


On Wed, May 15, 2019 at 3:32 PM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
>
> Hi,
>
> (You didn't use my correct email address, please update your kernel)

Fixed.

>
> On 15/05/2019 14:14:36+0300, roman.stratiienko@globallogic.com wrote:
> > From: Roman Stratiienko <roman.stratiienko@globallogic.com>
> >
> > Alarmtimer interface uses only the RTC with wekeup flags enabled.
> > Allow to use rtc-test driver with alarmtimer interface.
> >
> > Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
> > ---
> >  drivers/rtc/rtc-test.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c
> > index 6c5f09c815e8..c839ae575c77 100644
> > --- a/drivers/rtc/rtc-test.c
> > +++ b/drivers/rtc/rtc-test.c
> > @@ -123,6 +123,8 @@ static int test_probe(struct platform_device *plat_dev)
> >
> >       platform_set_drvdata(plat_dev, rtd);
> >
> > +     device_init_wakeup(&plat_dev->dev, 1);
> > +
>
> The first created RTC doesn't have any alarm, so this must not be done
> for all the devices.

Thanks. I will fix this in v2.

>
> Also, this driver will never wake up the platform so I'm not sure it is
> relevant to test alarmtimers.

Alarmtimer interface relies only on RTC with alarm support,
but it also checks wake flags for some reason.
As far as rtc-test driver do have alarm support, I expect
that related drivers should use it.

Let me share some information about my use-case:
Alarmtimer support is required for generic AOSP bluedroid library.
To enable Bluetooth in Android on the devices that does not
have hardware RTC, enabling rtc-test driver is a good option.

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

-- 
Best regards,
Roman Stratiienko
Global Logic Inc.

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

end of thread, other threads:[~2019-05-15 13:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-15 11:14 [PATCH] rtc: test: enable wakeup flags roman.stratiienko
2019-05-15 12:32 ` Alexandre Belloni
     [not found]   ` <CAODwZ7vuBndm2i7CFm0RT1wM3phyQkQ+g0Gyjb1GE7k1-bHccQ@mail.gmail.com>
2019-05-15 13:53     ` Roman Stratiienko

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).