Linux-RTC Archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: hym8563: enable wakeup by default
@ 2020-11-05 22:01 Guillaume Tucker
  2020-11-05 22:09 ` Alexandre Belloni
  0 siblings, 1 reply; 3+ messages in thread
From: Guillaume Tucker @ 2020-11-05 22:01 UTC (permalink / raw
  To: Alessandro Zummo, Alexandre Belloni, Heiko Stuebner
  Cc: Andrew Morton, linux-rtc, linux-kernel, kernel, Guillaume Tucker

Enable wakeup by default in the hym8563 driver to match the behaviour
implemented by the majority of RTC drivers.  As per the description of
device_init_wakeup(), it should be enabled for "devices that everyone
expects to be wakeup sources".  One would expect this to be the case
with a real-time clock.

Fixes: dcaf03849352 ("rtc: add hym8563 rtc-driver")
Reported-by: kernelci.org bot <bot@kernelci.org>
Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
---
 drivers/rtc/rtc-hym8563.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c
index 0fb79c4afb46..6fccfe634d57 100644
--- a/drivers/rtc/rtc-hym8563.c
+++ b/drivers/rtc/rtc-hym8563.c
@@ -527,7 +527,7 @@ static int hym8563_probe(struct i2c_client *client,
 	hym8563->client = client;
 	i2c_set_clientdata(client, hym8563);
 
-	device_set_wakeup_capable(&client->dev, true);
+	device_init_wakeup(&client->dev, true);
 
 	ret = hym8563_init_device(client);
 	if (ret) {
-- 
2.20.1


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

* Re: [PATCH] rtc: hym8563: enable wakeup by default
  2020-11-05 22:01 [PATCH] rtc: hym8563: enable wakeup by default Guillaume Tucker
@ 2020-11-05 22:09 ` Alexandre Belloni
  2020-11-05 22:28   ` Guillaume Tucker
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Belloni @ 2020-11-05 22:09 UTC (permalink / raw
  To: Guillaume Tucker
  Cc: Alessandro Zummo, Heiko Stuebner, Andrew Morton, linux-rtc,
	linux-kernel, kernel

On 05/11/2020 22:01:10+0000, Guillaume Tucker wrote:
> Enable wakeup by default in the hym8563 driver to match the behaviour
> implemented by the majority of RTC drivers.  As per the description of
> device_init_wakeup(), it should be enabled for "devices that everyone
> expects to be wakeup sources".  One would expect this to be the case
> with a real-time clock.
> 

Actually, the proper way of doing it for a discrete RTC is to only
enable wakeup if the irq request is successful or when the wakeup-source
property is present on the node.

> Fixes: dcaf03849352 ("rtc: add hym8563 rtc-driver")
> Reported-by: kernelci.org bot <bot@kernelci.org>
> Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
> ---
>  drivers/rtc/rtc-hym8563.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c
> index 0fb79c4afb46..6fccfe634d57 100644
> --- a/drivers/rtc/rtc-hym8563.c
> +++ b/drivers/rtc/rtc-hym8563.c
> @@ -527,7 +527,7 @@ static int hym8563_probe(struct i2c_client *client,
>  	hym8563->client = client;
>  	i2c_set_clientdata(client, hym8563);
>  
> -	device_set_wakeup_capable(&client->dev, true);
> +	device_init_wakeup(&client->dev, true);
>  
>  	ret = hym8563_init_device(client);
>  	if (ret) {
> -- 
> 2.20.1
> 

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

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

* Re: [PATCH] rtc: hym8563: enable wakeup by default
  2020-11-05 22:09 ` Alexandre Belloni
@ 2020-11-05 22:28   ` Guillaume Tucker
  0 siblings, 0 replies; 3+ messages in thread
From: Guillaume Tucker @ 2020-11-05 22:28 UTC (permalink / raw
  To: Alexandre Belloni
  Cc: Alessandro Zummo, Heiko Stuebner, Andrew Morton, linux-rtc,
	linux-kernel, kernel

On 05/11/2020 22:09, Alexandre Belloni wrote:
> On 05/11/2020 22:01:10+0000, Guillaume Tucker wrote:
>> Enable wakeup by default in the hym8563 driver to match the behaviour
>> implemented by the majority of RTC drivers.  As per the description of
>> device_init_wakeup(), it should be enabled for "devices that everyone
>> expects to be wakeup sources".  One would expect this to be the case
>> with a real-time clock.
>>
> 
> Actually, the proper way of doing it for a discrete RTC is to only
> enable wakeup if the irq request is successful or when the wakeup-source
> property is present on the node.

Thanks for the quick reply.  I see, I'll send a v2 accordingly.

Guillaume

>> Fixes: dcaf03849352 ("rtc: add hym8563 rtc-driver")
>> Reported-by: kernelci.org bot <bot@kernelci.org>
>> Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
>> ---
>>  drivers/rtc/rtc-hym8563.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c
>> index 0fb79c4afb46..6fccfe634d57 100644
>> --- a/drivers/rtc/rtc-hym8563.c
>> +++ b/drivers/rtc/rtc-hym8563.c
>> @@ -527,7 +527,7 @@ static int hym8563_probe(struct i2c_client *client,
>>  	hym8563->client = client;
>>  	i2c_set_clientdata(client, hym8563);
>>  
>> -	device_set_wakeup_capable(&client->dev, true);
>> +	device_init_wakeup(&client->dev, true);
>>  
>>  	ret = hym8563_init_device(client);
>>  	if (ret) {
>> -- 
>> 2.20.1
>>
> 


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

end of thread, other threads:[~2020-11-05 22:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-05 22:01 [PATCH] rtc: hym8563: enable wakeup by default Guillaume Tucker
2020-11-05 22:09 ` Alexandre Belloni
2020-11-05 22:28   ` Guillaume Tucker

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 read-only IMAP folder(s) and NNTP newsgroup(s).