From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Mike Looijmans <mike.looijmans@topic.nl>
Cc: linux-rtc@vger.kernel.org,
Alessandro Zummo <a.zummo@towertech.it>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc: pcf85363: Allow to wake up system without IRQ
Date: Thu, 17 Aug 2023 10:17:59 +0200 [thread overview]
Message-ID: <202308170817599c17a369@mail.local> (raw)
In-Reply-To: <ec2d7ef3-3dcc-aebb-1a4f-c2e01a09f750@topic.nl>
On 17/08/2023 07:42:25+0200, Mike Looijmans wrote:
> On 16-08-2023 23:40, Alexandre Belloni wrote:
> > Hello Mike,
> >
> > Sorry for the very late review, there is a small change that is needed:
>
> Better late than never
>
> >
> > On 02/05/2023 07:54:58+0200, Mike Looijmans wrote:
> > > When wakeup-source is set in the devicetree, set up the device for
> > > using the output as interrupt instead of clock. This is similar to
> > > how other RTC devices handle this.
> > >
> > > This allows the clock chip to turn on the board when wired to do
> > > so in hardware.
> > >
> > > Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
> > >
> > > ---
> > >
> > > drivers/rtc/rtc-pcf85363.c | 17 ++++++++++-------
> > > 1 file changed, 10 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/drivers/rtc/rtc-pcf85363.c b/drivers/rtc/rtc-pcf85363.c
> > > index 8958eadf1c3e..b1543bcdc530 100644
> > > --- a/drivers/rtc/rtc-pcf85363.c
> > > +++ b/drivers/rtc/rtc-pcf85363.c
> > > @@ -434,23 +434,26 @@ static int pcf85363_probe(struct i2c_client *client)
> > > pcf85363->rtc->range_max = RTC_TIMESTAMP_END_2099;
> > > clear_bit(RTC_FEATURE_ALARM, pcf85363->rtc->features);
> > > + if (client->irq > 0 || device_property_read_bool(&client->dev,
> > > + "wakeup-source")) {
> > > + regmap_write(pcf85363->regmap, CTRL_FLAGS, 0);
> > > + regmap_update_bits(pcf85363->regmap, CTRL_PIN_IO,
> > > + PIN_IO_INTA_OUT, PIN_IO_INTAPM);
> > > + device_init_wakeup(&client->dev, true);
> > > + set_bit(RTC_FEATURE_ALARM, pcf85363->rtc->features);
> >
> > This should not be done when devm_request_threaded_irq fails.
>
> Yeah, easiest would be to just clear the feature flag when that happens.
My comment was also for device_init_wakeup(&client->dev, true);. I think
the easiest would be to move this block later on and set client->irq to
0 when devm_request_threaded_irq fails.
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2023-08-17 8:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.eeedf5db-4013-4c3b-be1c-1121df58f897@emailsignatures365.codetwo.com>
2023-05-02 5:54 ` [PATCH] rtc: pcf85363: Allow to wake up system without IRQ Mike Looijmans
2023-08-16 21:40 ` Alexandre Belloni
2023-08-17 5:42 ` Mike Looijmans
2023-08-17 8:17 ` Alexandre Belloni [this message]
2023-08-17 9:02 ` Mike Looijmans
2023-08-17 22:25 ` Alexandre Belloni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202308170817599c17a369@mail.local \
--to=alexandre.belloni@bootlin.com \
--cc=a.zummo@towertech.it \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=mike.looijmans@topic.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).