From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
Alessandro Zummo <a.zummo@towertech.it>,
Benson Leung <bleung@chromium.org>,
Thomas Gleixner <tglx@linutronix.de>,
John Stultz <jstultz@google.com>, Stephen Boyd <sboyd@kernel.org>,
linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
Brian Norris <briannorris@chromium.org>
Subject: Re: [PATCH 7/7] rtc: rzn1: Report maximum alarm limit to rtc core
Date: Thu, 17 Aug 2023 10:03:41 +0200 [thread overview]
Message-ID: <20230817100341.15867e4d@xps-13> (raw)
In-Reply-To: <20230816133936.2150294-8-linux@roeck-us.net>
Hi Guenter,
linux@roeck-us.net wrote on Wed, 16 Aug 2023 06:39:36 -0700:
> RZN1 only supports alarms up to one week in the future.
> Report the limit to the RTC core.
>
> Cc: Brian Norris <briannorris@chromium.org>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/rtc/rtc-rzn1.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/rtc/rtc-rzn1.c b/drivers/rtc/rtc-rzn1.c
> index dca736caba85..c2cc3774ebb8 100644
> --- a/drivers/rtc/rtc-rzn1.c
> +++ b/drivers/rtc/rtc-rzn1.c
> @@ -351,6 +351,7 @@ static int rzn1_rtc_probe(struct platform_device *pdev)
>
> rtc->rtcdev->range_min = RTC_TIMESTAMP_BEGIN_2000;
> rtc->rtcdev->range_max = RTC_TIMESTAMP_END_2099;
> + rtc->rtcdev->range_max_offset = 7 * 86400;
When we set the alarm, we use:
farest = rtc_tm_to_time64(&tm_now) + (7 * 86400);
What about using range_max_offset (whatever its final name) in this
calculation as it will be now set in probe? It would further clarify
its purpose.
> rtc->rtcdev->ops = &rzn1_rtc_ops;
> set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->rtcdev->features);
> clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->rtcdev->features);
With the above change,
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Thanks,
Miquèl
next prev parent reply other threads:[~2023-08-17 8:04 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-16 13:39 [PATCH 0/7] rtc: Add support for limited alarm timer offsets Guenter Roeck
2023-08-16 13:39 ` [PATCH 1/7] " Guenter Roeck
2023-08-16 14:57 ` Alexandre Belloni
2023-08-16 15:24 ` Guenter Roeck
2023-08-16 16:19 ` Alexandre Belloni
2023-08-16 19:12 ` Guenter Roeck
2023-08-16 13:39 ` [PATCH 2/7] rtc: alarmtimer: Use maximum alarm time offset Guenter Roeck
2023-08-16 13:39 ` [PATCH 3/7] rtc: cros-ec: Detect and report supported alarm window size Guenter Roeck
2023-08-16 13:39 ` [PATCH 4/7] rtc: cmos: Report supported alarm limit to rtc infrastructure Guenter Roeck
2023-08-16 13:39 ` [PATCH 5/7] rtc: tps6586x: Report maximum alarm limit to rtc core Guenter Roeck
2023-08-16 13:39 ` [PATCH 6/7] rtc: ds1305: " Guenter Roeck
2023-08-16 13:39 ` [PATCH 7/7] rtc: rzn1: " Guenter Roeck
2023-08-17 8:03 ` Miquel Raynal [this message]
2023-08-17 13:43 ` Guenter Roeck
2023-08-16 15:03 ` [PATCH 0/7] rtc: Add support for limited alarm timer offsets Alexandre Belloni
2023-08-16 15:50 ` Guenter Roeck
2023-08-16 16:14 ` Alexandre Belloni
2023-08-16 19:12 ` Guenter Roeck
2023-08-17 19:51 ` Alexandre Belloni
2023-08-17 22:36 ` Guenter Roeck
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=20230817100341.15867e4d@xps-13 \
--to=miquel.raynal@bootlin.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=bleung@chromium.org \
--cc=briannorris@chromium.org \
--cc=jstultz@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=sboyd@kernel.org \
--cc=tglx@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.