From: Markus Probst <markus.probst@posteo.de>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: "Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Uwe Kleine-König" <uwe@kleine-koenig.org>,
"Andrew Lunn" <andrew@lunn.ch>,
"Gregory Clement" <gregory.clement@bootlin.com>,
"Sebastian Hesselbarth" <sebastian.hesselbarth@gmail.com>,
"Michael Langer" <michael.brainbug.langer@googlemail.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Linus Walleij" <linusw@kernel.org>,
linux-arm-kernel@lists.infradead.org, linux-rtc@vger.kernel.org,
devicetree@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 3/6] rtc: s35390a: Fix alarm not disabling
Date: Wed, 19 Aug 2026 22:29:15 +0000 [thread overview]
Message-ID: <63144348d306ae5c5723df553477f90f6f1030b7.camel@posteo.de> (raw)
In-Reply-To: <2026081922254172956b52@mail.local>
[-- Attachment #1: Type: text/plain, Size: 2720 bytes --]
On Thu, 2026-08-20 at 00:25 +0200, Alexandre Belloni wrote:
> On 19/08/2026 22:05:55+0000, Markus Probst wrote:
> > Implement alarm_irq_enable callback.
> >
> > Fixes: 542dd33a4925 ("drivers/rtc/rtc-s35390a.c: add wakealarm support for rtc-s35390A rtc chip")
> > Signed-off-by: Markus Probst <markus.probst@posteo.de>
> > ---
> > drivers/rtc/rtc-s35390a.c | 29 ++++++++++++++++++++++++-----
> > 1 file changed, 24 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/rtc/rtc-s35390a.c b/drivers/rtc/rtc-s35390a.c
> > index 4cfe7034c516..575bb256eb25 100644
> > --- a/drivers/rtc/rtc-s35390a.c
> > +++ b/drivers/rtc/rtc-s35390a.c
> > @@ -270,6 +270,24 @@ static int s35390a_rtc_read_time(struct device *dev, struct rtc_time *tm)
> > return 0;
> > }
> >
> > +static int s35390a_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
> > +{
> > + struct s35390a *s35390a = dev_get_drvdata(dev);
> > + u8 sts;
> > + int err;
> > +
> > + if (enabled)
> > + sts = S35390A_INT2_MODE_ALARM;
> > + else
> > + sts = S35390A_INT2_MODE_NOINTR;
> > +
> > + err = s35390a_set_reg(s35390a, S35390A_CMD_STATUS2, &sts, sizeof(sts));
> > + if (err < 0)
> > + return err;
> > +
> > + return 0;
> > +}
>
>
> You can definitively call this from s35390a_rtc_set_alarm instead of
> duplicating code.
At this stage yes.
With the pinctrl patch, it needs to be considered that the other pin
might be used as well, so the state needs to be preserved.
This will be done by reading the S35390A_CMD_STATUS2 register first.
This function will not be called in set_alarm, because this would
introduce additional read operations, as the current
S35390A_CMD_STATUS2 reg is already read inside set_alarm.
Thanks
- Markus Probst
>
> > +
> > static int s35390a_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
> > {
> > struct i2c_client *client = to_i2c_client(dev);
> > @@ -410,11 +428,12 @@ static int s35390a_rtc_ioctl(struct device *dev, unsigned int cmd,
> > }
> >
> > static const struct rtc_class_ops s35390a_rtc_ops = {
> > - .read_time = s35390a_rtc_read_time,
> > - .set_time = s35390a_rtc_set_time,
> > - .set_alarm = s35390a_rtc_set_alarm,
> > - .read_alarm = s35390a_rtc_read_alarm,
> > - .ioctl = s35390a_rtc_ioctl,
> > + .read_time = s35390a_rtc_read_time,
> > + .set_time = s35390a_rtc_set_time,
> > + .set_alarm = s35390a_rtc_set_alarm,
> > + .read_alarm = s35390a_rtc_read_alarm,
> > + .alarm_irq_enable = s35390a_rtc_alarm_irq_enable,
> > + .ioctl = s35390a_rtc_ioctl,
> > };
> >
> > static int s35390a_nvmem_read(void *priv, unsigned int offset, void *val,
> >
> > --
> > 2.54.0
> >
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 870 bytes --]
next prev parent reply other threads:[~2026-08-19 22:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 22:05 [PATCH v5 0/6] rtc: s35390a: Allow use of output pin for interrupt signal 1 for wakealarm Markus Probst
2026-08-19 22:05 ` [PATCH v5 1/6] dt-bindings: rtc: Add pinctrl for S35390A Markus Probst
2026-08-19 22:05 ` [PATCH v5 2/6] rtc: s35390a: Add missing newline to dev_err Markus Probst
2026-08-19 22:05 ` [PATCH v5 3/6] rtc: s35390a: Fix alarm not disabling Markus Probst
2026-08-19 22:25 ` Alexandre Belloni
2026-08-19 22:29 ` Markus Probst [this message]
2026-08-19 22:05 ` [PATCH v5 4/6] rtc: s35390a: force 24-hour mode Markus Probst
2026-08-19 22:20 ` Alexandre Belloni
2026-08-19 22:57 ` Markus Probst
2026-08-19 23:26 ` Alexandre Belloni
2026-08-20 15:25 ` Alexandre Belloni
2026-08-19 22:05 ` [PATCH v5 5/6] rtc: s35390a: Add pinctrl Markus Probst
2026-08-19 22:05 ` [PATCH v5 6/6] rtc: s35390a: Add synology quirk Markus Probst
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=63144348d306ae5c5723df553477f90f6f1030b7.camel@posteo.de \
--to=markus.probst@posteo.de \
--cc=akpm@linux-foundation.org \
--cc=alexandre.belloni@bootlin.com \
--cc=andrew@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregory.clement@bootlin.com \
--cc=krzk+dt@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=michael.brainbug.langer@googlemail.com \
--cc=robh@kernel.org \
--cc=sebastian.hesselbarth@gmail.com \
--cc=uwe@kleine-koenig.org \
/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