diff mbox series

rtc: test: enable wakeup flags

Message ID 20190515111436.14513-1-roman.stratiienko@globallogic.com
State Superseded
Headers show
Series rtc: test: enable wakeup flags | expand

Commit Message

Roman Stratiienko May 15, 2019, 11:14 a.m. UTC
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(+)

Comments

Alexandre Belloni May 15, 2019, 12:32 p.m. UTC | #1
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.
diff mbox series

Patch

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