* Re: [PATCH v3 3/3] rtc: tegra: Drop deprecated SIMPLE_DEV_PM_OPS
From: Andy Shevchenko @ 2025-10-23 18:04 UTC (permalink / raw)
To: Kartik Rajput
Cc: alexandre.belloni, thierry.reding, jonathanh, linux-rtc,
linux-tegra, linux-kernel
In-Reply-To: <20251023093042.770798-3-kkartik@nvidia.com>
On Thu, Oct 23, 2025 at 03:00:42PM +0530, Kartik Rajput wrote:
> Replace deprecated SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS macro
> and use pm_sleep_ptr() to initialize pm_ops. This also allows us to drop
> the checks for CONFIG_PM_SLEEP.
Probably Subject also should be "Replace deprecated...".
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH v3 2/3] rtc: tegra: Add ACPI support
From: Andy Shevchenko @ 2025-10-23 18:04 UTC (permalink / raw)
To: Kartik Rajput
Cc: alexandre.belloni, thierry.reding, jonathanh, linux-rtc,
linux-tegra, linux-kernel
In-Reply-To: <20251023093042.770798-2-kkartik@nvidia.com>
On Thu, Oct 23, 2025 at 03:00:41PM +0530, Kartik Rajput wrote:
> Add ACPI support for Tegra RTC, which is available on Tegra241 and
> Tegra410. Both Tegra241 and Tegra410 use the same ACPI ID 'NVDA0280'.
> When ACPI boot is used, the RTC clock is configured by UEFI before
> the kernel boots. On device-tree boot, the probe must fail if clocks are
> not provided in the device-tree.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: PROBLEM: hwclock busted w/ M48T59 RTC (regression)
From: Nick Bowler @ 2025-10-23 13:39 UTC (permalink / raw)
To: Esben Haabendal; +Cc: linux-kernel, regressions, linux-rtc, stable, sparclinux
In-Reply-To: <DmLaDrfp-izPBqLjB9SAGPy3WVKOPNgg9FInsykhNO3WPEWgltKF5GoDknld3l5xoJxovduV8xn8ygSupvyIFOCCZl0Q0aTXwKT2XhPM1n8=@geanix.com>
On Thu, Oct 23, 2025 at 07:21:21AM +0000, Esben Haabendal wrote:
> On Thursday, 23 October 2025 at 06:45, Nick Bowler <nbowler@draconx.ca> wrote:
>
> > After a stable kernel update, the hwclock command seems no longer
> > functional on my SPARC system with an ST M48T59Y-70PC1 RTC:
> >
> > # hwclock
> > [...long delay...]
>
> I assume this is 10 seconds long.
Yeah, about that.
> > hwclock: select() to /dev/rtc0 to wait for clock tick timed out
>
> And this is 100% reproducible, or does it sometimes work and sometimes fail?
It fails every time.
> Are you using the util-linux hwclock command? Which version?
hwclock from util-linux 2.40.2
> Do you have CONFIG_RTC_INTF_DEV_UIE_EMUL enabled?
No, this option is not enabled.
> Can you run `hwclock --verbose`, both with and without the reverted commit,
> and send the output from that?
6.18-rc2 (broken):
# hwclock --verbose
hwclock from util-linux 2.40.2
System Time: 1761226454.799573
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Last drift adjustment done at 1657523820 seconds after 1969
Last calibration done at 1657523820 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
hwclock: select() to /dev/rtc0 to wait for clock tick timed out
...synchronization failed
6.18-rc2 w/ revert (working):
# hwclock --verbose
hwclock from util-linux 2.40.2
System Time: 1761226685.238753
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Last drift adjustment done at 1657523820 seconds after 1969
Last calibration done at 1657523820 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
ioctl(3, RTC_UIE_ON, 0): Input/output error
Waiting in loop for time from /dev/rtc0 to change
...got clock tick
Time read from Hardware Clock: 2025/10/23 13:38:06
Hw clock time : 2025/10/23 13:38:06 = 1761226686 seconds since 1969
Time since last adjustment is 103702866 seconds
Calculated Hardware Clock drift is 0.000000 seconds
2025-10-23 09:38:05.239100-04:00
Thanks,
Nick
^ permalink raw reply
* Re: [PATCH v2] rtc: tegra: Add ACPI support
From: Kartik Rajput @ 2025-10-23 9:32 UTC (permalink / raw)
To: Andy Shevchenko
Cc: alexandre.belloni, thierry.reding, jonathanh, linux-rtc,
linux-tegra, linux-kernel
In-Reply-To: <aPna3Q9L4Rc9Ufxt@smile.fi.intel.com>
On 23/10/25 13:05, Andy Shevchenko wrote:
> External email: Use caution opening links or attachments
>
>
> On Thu, Oct 23, 2025 at 12:14:13PM +0530, Kartik Rajput wrote:
>> On 22/10/25 22:38, Andy Shevchenko wrote:
>>> On Wed, Oct 22, 2025 at 12:06:45PM +0530, Kartik Rajput wrote:
>
> ...
>
>>>> - info->clk = devm_clk_get(&pdev->dev, NULL);
>>>> - if (IS_ERR(info->clk))
>>>> - return PTR_ERR(info->clk);
>>>> + if (dev_of_node(&pdev->dev)) {
>>>> + info->clk = devm_clk_get(&pdev->dev, NULL);
>>>> + if (IS_ERR(info->clk))
>>>> + return PTR_ERR(info->clk);
>>>> + }
>>>>
>>>> ret = clk_prepare_enable(info->clk);
>>>
>>> Since we still call CLK APIs unconditionally here, shouldn't be the whole
>>> approach just to move to _optional() CLK API?
>>>
>>> info->clk = devm_clk_get_optional(&pdev->dev, NULL);
>>>
>>> I haven't checked the code below, but maybe even one can incorporate _enabled
>>> to this as well (in a separate change as it's not related to this patch
>>> directly).
>>
>> The reason I did not use the _optional API is because the clocks are required
>> for the device-tree. Therefore, it must fail if clocks are not provided on
>> device-tree boot.
>
> I see, please mention this in the commit message. And perhaps add a patch to
> convert to devm_clk_get_enabled().
>
> On top of that you also can convert driver to use pm_sleep_ptr() and drop ugly
> ifdeffery. But this is really out of scope, and up to you to decide.
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
Thanks for the suggestions, Andy! I have posted v3 with all these changes here:
https://lore.kernel.org/linux-tegra/20251023093042.770798-1-kkartik@nvidia.com/T/#t
Regards,
Kartik
^ permalink raw reply
* [PATCH v3 2/3] rtc: tegra: Add ACPI support
From: Kartik Rajput @ 2025-10-23 9:30 UTC (permalink / raw)
To: alexandre.belloni, thierry.reding, jonathanh, andriy.shevchenko,
linux-rtc, linux-tegra, linux-kernel
Cc: Kartik Rajput
In-Reply-To: <20251023093042.770798-1-kkartik@nvidia.com>
Add ACPI support for Tegra RTC, which is available on Tegra241 and
Tegra410. Both Tegra241 and Tegra410 use the same ACPI ID 'NVDA0280'.
When ACPI boot is used, the RTC clock is configured by UEFI before
the kernel boots. On device-tree boot, the probe must fail if clocks are
not provided in the device-tree.
Signed-off-by: Kartik Rajput <kkartik@nvidia.com>
---
Changes in v3:
* Add patch to use devm_clk_get_enabled().
* Add patch to use pm_sleep_ptr().
* Update commit message to specify clocks are requried for
device-tree boot.
Changes in v2:
* Dropped "linux/acpi.h" from includes.
* Dropped redundant ', 0' part from tegra_rtc_acpi_match.
* Replaced "is_of_node(dev_fwnode(&pdev->dev))" with
"dev_of_node(&pdev->dev)" to check device of node.
* Dropped redundant of_node checks before accessing clock
related APIs.
---
drivers/rtc/rtc-tegra.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c
index 51f5bb55c176..ad0c57ce87df 100644
--- a/drivers/rtc/rtc-tegra.c
+++ b/drivers/rtc/rtc-tegra.c
@@ -274,6 +274,12 @@ static const struct of_device_id tegra_rtc_dt_match[] = {
};
MODULE_DEVICE_TABLE(of, tegra_rtc_dt_match);
+static const struct acpi_device_id tegra_rtc_acpi_match[] = {
+ { "NVDA0280" },
+ { }
+};
+MODULE_DEVICE_TABLE(acpi, tegra_rtc_acpi_match);
+
static int tegra_rtc_probe(struct platform_device *pdev)
{
struct tegra_rtc_info *info;
@@ -300,9 +306,11 @@ static int tegra_rtc_probe(struct platform_device *pdev)
info->rtc->ops = &tegra_rtc_ops;
info->rtc->range_max = U32_MAX;
- info->clk = devm_clk_get_enabled(&pdev->dev, NULL);
- if (IS_ERR(info->clk))
- return PTR_ERR(info->clk);
+ if (dev_of_node(&pdev->dev)) {
+ info->clk = devm_clk_get_enabled(&pdev->dev, NULL);
+ if (IS_ERR(info->clk))
+ return PTR_ERR(info->clk);
+ }
/* set context info */
info->pdev = pdev;
@@ -394,6 +402,7 @@ static struct platform_driver tegra_rtc_driver = {
.driver = {
.name = "tegra_rtc",
.of_match_table = tegra_rtc_dt_match,
+ .acpi_match_table = tegra_rtc_acpi_match,
.pm = &tegra_rtc_pm_ops,
},
};
--
2.43.0
^ permalink raw reply related
* [PATCH v3 3/3] rtc: tegra: Drop deprecated SIMPLE_DEV_PM_OPS
From: Kartik Rajput @ 2025-10-23 9:30 UTC (permalink / raw)
To: alexandre.belloni, thierry.reding, jonathanh, andriy.shevchenko,
linux-rtc, linux-tegra, linux-kernel
Cc: Kartik Rajput
In-Reply-To: <20251023093042.770798-1-kkartik@nvidia.com>
Replace deprecated SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS macro
and use pm_sleep_ptr() to initialize pm_ops. This also allows us to drop
the checks for CONFIG_PM_SLEEP.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Kartik Rajput <kkartik@nvidia.com>
---
drivers/rtc/rtc-tegra.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c
index ad0c57ce87df..3ee8e1c97a5a 100644
--- a/drivers/rtc/rtc-tegra.c
+++ b/drivers/rtc/rtc-tegra.c
@@ -347,7 +347,6 @@ static void tegra_rtc_remove(struct platform_device *pdev)
clk_disable_unprepare(info->clk);
}
-#ifdef CONFIG_PM_SLEEP
static int tegra_rtc_suspend(struct device *dev)
{
struct tegra_rtc_info *info = dev_get_drvdata(dev);
@@ -385,9 +384,8 @@ static int tegra_rtc_resume(struct device *dev)
return 0;
}
-#endif
-static SIMPLE_DEV_PM_OPS(tegra_rtc_pm_ops, tegra_rtc_suspend, tegra_rtc_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(tegra_rtc_pm_ops, tegra_rtc_suspend, tegra_rtc_resume);
static void tegra_rtc_shutdown(struct platform_device *pdev)
{
@@ -403,7 +401,7 @@ static struct platform_driver tegra_rtc_driver = {
.name = "tegra_rtc",
.of_match_table = tegra_rtc_dt_match,
.acpi_match_table = tegra_rtc_acpi_match,
- .pm = &tegra_rtc_pm_ops,
+ .pm = pm_sleep_ptr(&tegra_rtc_pm_ops),
},
};
module_platform_driver(tegra_rtc_driver);
--
2.43.0
^ permalink raw reply related
* [PATCH v3 1/3] rtc: tegra: Use devm_clk_get_enabled() in probe
From: Kartik Rajput @ 2025-10-23 9:30 UTC (permalink / raw)
To: alexandre.belloni, thierry.reding, jonathanh, andriy.shevchenko,
linux-rtc, linux-tegra, linux-kernel
Cc: Kartik Rajput
Simplify clock management by replacing devm_clk_get() and manual clock
enable/disable with devm_clk_get_enabled(). This also simplifies the
error handling logic.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Kartik Rajput <kkartik@nvidia.com>
---
drivers/rtc/rtc-tegra.c | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c
index 46788db89953..51f5bb55c176 100644
--- a/drivers/rtc/rtc-tegra.c
+++ b/drivers/rtc/rtc-tegra.c
@@ -300,14 +300,10 @@ static int tegra_rtc_probe(struct platform_device *pdev)
info->rtc->ops = &tegra_rtc_ops;
info->rtc->range_max = U32_MAX;
- info->clk = devm_clk_get(&pdev->dev, NULL);
+ info->clk = devm_clk_get_enabled(&pdev->dev, NULL);
if (IS_ERR(info->clk))
return PTR_ERR(info->clk);
- ret = clk_prepare_enable(info->clk);
- if (ret < 0)
- return ret;
-
/* set context info */
info->pdev = pdev;
spin_lock_init(&info->lock);
@@ -324,22 +320,16 @@ static int tegra_rtc_probe(struct platform_device *pdev)
ret = devm_request_irq(&pdev->dev, info->irq, tegra_rtc_irq_handler,
IRQF_TRIGGER_HIGH, dev_name(&pdev->dev),
&pdev->dev);
- if (ret) {
- dev_err(&pdev->dev, "failed to request interrupt: %d\n", ret);
- goto disable_clk;
- }
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret, "failed to request interrupt\n");
ret = devm_rtc_register_device(info->rtc);
if (ret)
- goto disable_clk;
+ return ret;
dev_notice(&pdev->dev, "Tegra internal Real Time Clock\n");
return 0;
-
-disable_clk:
- clk_disable_unprepare(info->clk);
- return ret;
}
static void tegra_rtc_remove(struct platform_device *pdev)
--
2.43.0
^ permalink raw reply related
* Re: [PATCH v2] rtc: tegra: Add ACPI support
From: Andy Shevchenko @ 2025-10-23 7:35 UTC (permalink / raw)
To: Kartik Rajput
Cc: alexandre.belloni, thierry.reding, jonathanh, linux-rtc,
linux-tegra, linux-kernel
In-Reply-To: <f4defdc9-2cc0-45a0-a391-cb8678eb1b23@nvidia.com>
On Thu, Oct 23, 2025 at 12:14:13PM +0530, Kartik Rajput wrote:
> On 22/10/25 22:38, Andy Shevchenko wrote:
> > On Wed, Oct 22, 2025 at 12:06:45PM +0530, Kartik Rajput wrote:
...
> > > - info->clk = devm_clk_get(&pdev->dev, NULL);
> > > - if (IS_ERR(info->clk))
> > > - return PTR_ERR(info->clk);
> > > + if (dev_of_node(&pdev->dev)) {
> > > + info->clk = devm_clk_get(&pdev->dev, NULL);
> > > + if (IS_ERR(info->clk))
> > > + return PTR_ERR(info->clk);
> > > + }
> > >
> > > ret = clk_prepare_enable(info->clk);
> >
> > Since we still call CLK APIs unconditionally here, shouldn't be the whole
> > approach just to move to _optional() CLK API?
> >
> > info->clk = devm_clk_get_optional(&pdev->dev, NULL);
> >
> > I haven't checked the code below, but maybe even one can incorporate _enabled
> > to this as well (in a separate change as it's not related to this patch
> > directly).
>
> The reason I did not use the _optional API is because the clocks are required
> for the device-tree. Therefore, it must fail if clocks are not provided on
> device-tree boot.
I see, please mention this in the commit message. And perhaps add a patch to
convert to devm_clk_get_enabled().
On top of that you also can convert driver to use pm_sleep_ptr() and drop ugly
ifdeffery. But this is really out of scope, and up to you to decide.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: PROBLEM: hwclock busted w/ M48T59 RTC (regression)
From: Esben Haabendal @ 2025-10-23 7:21 UTC (permalink / raw)
To: Nick Bowler; +Cc: linux-kernel, regressions, linux-rtc, stable, sparclinux
In-Reply-To: <krmiwpwogrvpehlqdrugb5glcmsu54qpw3mteonqeqymrvzz37@dzt7mes7qgxt>
On Thursday, 23 October 2025 at 06:45, Nick Bowler <nbowler@draconx.ca> wrote:
> After a stable kernel update, the hwclock command seems no longer
> functional on my SPARC system with an ST M48T59Y-70PC1 RTC:
>
> # hwclock
> [...long delay...]
I assume this is 10 seconds long.
> hwclock: select() to /dev/rtc0 to wait for clock tick timed out
And this is 100% reproducible, or does it sometimes work and sometimes fail?
> On prior kernels, there is no problem:
>
> # hwclock
> 2025-10-22 22:21:04.806992-04:00
>
> I reproduced the same failure on 6.18-rc2 and bisected to this commit:
>
> commit 795cda8338eab036013314dbc0b04aae728880ab
> Author: Esben Haabendal esben@geanix.com
>
> Date: Fri May 16 09:23:35 2025 +0200
>
> rtc: interface: Fix long-standing race when setting alarm
>
> This commit was backported to all current 6.x stable branches,
> as well as 5.15.x, so they all have the same regression.
>
> Reverting this commit on top of 6.18-rc2 corrects the problem.
>
> Let me know if you need any more info!
Are you using the util-linux hwclock command? Which version?
Do you have CONFIG_RTC_INTF_DEV_UIE_EMUL enabled?
Can you run `hwclock --verbose`, both with and without the reverted commit,
and send the output from that?
/Esben
^ permalink raw reply
* Re: [PATCH v2] rtc: tegra: Add ACPI support
From: Kartik Rajput @ 2025-10-23 6:44 UTC (permalink / raw)
To: Andy Shevchenko
Cc: alexandre.belloni, thierry.reding, jonathanh, linux-rtc,
linux-tegra, linux-kernel
In-Reply-To: <aPkPkHr0Hp_MabPx@smile.fi.intel.com>
On 22/10/25 22:38, Andy Shevchenko wrote:
> External email: Use caution opening links or attachments
>
>
> On Wed, Oct 22, 2025 at 12:06:45PM +0530, Kartik Rajput wrote:
>> Add ACPI support for Tegra RTC, which is available on Tegra241 and
>> Tegra410. Both Tegra241 and Tegra410 use the same ACPI ID 'NVDA0280'.
>> The RTC clock is configured by UEFI before the kernel boots.
>
> Thanks for an update, looks much better now!
> A comment below, though.
>
> ...
>
>> - info->clk = devm_clk_get(&pdev->dev, NULL);
>> - if (IS_ERR(info->clk))
>> - return PTR_ERR(info->clk);
>> + if (dev_of_node(&pdev->dev)) {
>> + info->clk = devm_clk_get(&pdev->dev, NULL);
>> + if (IS_ERR(info->clk))
>> + return PTR_ERR(info->clk);
>> + }
>>
>> ret = clk_prepare_enable(info->clk);
>
> Since we still call CLK APIs unconditionally here, shouldn't be the whole
> approach just to move to _optional() CLK API?
>
> info->clk = devm_clk_get_optional(&pdev->dev, NULL);
>
> I haven't checked the code below, but maybe even one can incorporate _enabled
> to this as well (in a separate change as it's not related to this patch
> directly).
>
Hi Andy,
The reason I did not use the _optional API is because the clocks are required
for the device-tree. Therefore, it must fail if clocks are not provided on
device-tree boot.
Thanks,
Kartik
> --
> With Best Regards,
> Andy Shevchenko
>
>
^ permalink raw reply
* PROBLEM: hwclock busted w/ M48T59 RTC (regression)
From: Nick Bowler @ 2025-10-23 4:45 UTC (permalink / raw)
To: linux-kernel, regressions, linux-rtc; +Cc: Esben Haabendal, stable, sparclinux
Hi,
After a stable kernel update, the hwclock command seems no longer
functional on my SPARC system with an ST M48T59Y-70PC1 RTC:
# hwclock
[...long delay...]
hwclock: select() to /dev/rtc0 to wait for clock tick timed out
On prior kernels, there is no problem:
# hwclock
2025-10-22 22:21:04.806992-04:00
I reproduced the same failure on 6.18-rc2 and bisected to this commit:
commit 795cda8338eab036013314dbc0b04aae728880ab
Author: Esben Haabendal <esben@geanix.com>
Date: Fri May 16 09:23:35 2025 +0200
rtc: interface: Fix long-standing race when setting alarm
This commit was backported to all current 6.x stable branches,
as well as 5.15.x, so they all have the same regression.
Reverting this commit on top of 6.18-rc2 corrects the problem.
Let me know if you need any more info!
Thanks,
Nick
^ permalink raw reply
* Re: [PATCH v2 2/6] dt-bindings: rtc: renesas,rz-rtca3: Add RZ/V2H support
From: Conor Dooley @ 2025-10-22 17:42 UTC (permalink / raw)
To: Ovidiu Panait
Cc: claudiu.beznea.uj, alexandre.belloni, robh, krzk+dt, conor+dt,
geert+renesas, magnus.damm, mturquette, sboyd, p.zabel, linux-rtc,
linux-renesas-soc, devicetree, linux-kernel, linux-clk
In-Reply-To: <20251021080705.18116-3-ovidiu.panait.rb@renesas.com>
[-- Attachment #1: Type: text/plain, Size: 759 bytes --]
On Tue, Oct 21, 2025 at 08:07:01AM +0000, Ovidiu Panait wrote:
> The Renesas RZ/V2H RTC IP is based on the same RTCA3 IP as RZ/G3S
> (r9a08g045), with the following differences:
> - It lacks the time capture functionality
> - The maximum supported periodic interrupt frequency is 128Hz instead
> of 256Hz
> - It requires two reset lines instead of one
>
> Add new compatible string "renesas,r9a09g057-rtca3" for RZ/V2H and update
> the binding accordingly:
> - Allow "resets" to contain one or two entries depending on the SoC.
> - Add "reset-names" property, but make it required only for RZ/V2H.
>
> Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply
* Re: [PATCH v2] rtc: tegra: Add ACPI support
From: Andy Shevchenko @ 2025-10-22 17:08 UTC (permalink / raw)
To: Kartik Rajput
Cc: alexandre.belloni, thierry.reding, jonathanh, linux-rtc,
linux-tegra, linux-kernel
In-Reply-To: <20251022063645.765599-1-kkartik@nvidia.com>
On Wed, Oct 22, 2025 at 12:06:45PM +0530, Kartik Rajput wrote:
> Add ACPI support for Tegra RTC, which is available on Tegra241 and
> Tegra410. Both Tegra241 and Tegra410 use the same ACPI ID 'NVDA0280'.
> The RTC clock is configured by UEFI before the kernel boots.
Thanks for an update, looks much better now!
A comment below, though.
...
> - info->clk = devm_clk_get(&pdev->dev, NULL);
> - if (IS_ERR(info->clk))
> - return PTR_ERR(info->clk);
> + if (dev_of_node(&pdev->dev)) {
> + info->clk = devm_clk_get(&pdev->dev, NULL);
> + if (IS_ERR(info->clk))
> + return PTR_ERR(info->clk);
> + }
>
> ret = clk_prepare_enable(info->clk);
Since we still call CLK APIs unconditionally here, shouldn't be the whole
approach just to move to _optional() CLK API?
info->clk = devm_clk_get_optional(&pdev->dev, NULL);
I haven't checked the code below, but maybe even one can incorporate _enabled
to this as well (in a separate change as it's not related to this patch
directly).
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* [PATCH v2] rtc: tegra: Add ACPI support
From: Kartik Rajput @ 2025-10-22 6:36 UTC (permalink / raw)
To: alexandre.belloni, thierry.reding, jonathanh, andriy.shevchenko,
linux-rtc, linux-tegra, linux-kernel
Cc: Kartik Rajput
Add ACPI support for Tegra RTC, which is available on Tegra241 and
Tegra410. Both Tegra241 and Tegra410 use the same ACPI ID 'NVDA0280'.
The RTC clock is configured by UEFI before the kernel boots.
Signed-off-by: Kartik Rajput <kkartik@nvidia.com>
---
v1 -> v2:
* Dropped "linux/acpi.h" from includes.
* Dropped redundant ', 0' part from tegra_rtc_acpi_match.
* Replaced "is_of_node(dev_fwnode(&pdev->dev))" with
"dev_of_node(&pdev->dev)" to check device of node.
* Dropped redundant of_node checks before accessing clock
related APIs.
---
drivers/rtc/rtc-tegra.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c
index 46788db89953..a34f0c80fc37 100644
--- a/drivers/rtc/rtc-tegra.c
+++ b/drivers/rtc/rtc-tegra.c
@@ -274,6 +274,12 @@ static const struct of_device_id tegra_rtc_dt_match[] = {
};
MODULE_DEVICE_TABLE(of, tegra_rtc_dt_match);
+static const struct acpi_device_id tegra_rtc_acpi_match[] = {
+ { "NVDA0280" },
+ { }
+};
+MODULE_DEVICE_TABLE(acpi, tegra_rtc_acpi_match);
+
static int tegra_rtc_probe(struct platform_device *pdev)
{
struct tegra_rtc_info *info;
@@ -300,9 +306,11 @@ static int tegra_rtc_probe(struct platform_device *pdev)
info->rtc->ops = &tegra_rtc_ops;
info->rtc->range_max = U32_MAX;
- info->clk = devm_clk_get(&pdev->dev, NULL);
- if (IS_ERR(info->clk))
- return PTR_ERR(info->clk);
+ if (dev_of_node(&pdev->dev)) {
+ info->clk = devm_clk_get(&pdev->dev, NULL);
+ if (IS_ERR(info->clk))
+ return PTR_ERR(info->clk);
+ }
ret = clk_prepare_enable(info->clk);
if (ret < 0)
@@ -404,6 +412,7 @@ static struct platform_driver tegra_rtc_driver = {
.driver = {
.name = "tegra_rtc",
.of_match_table = tegra_rtc_dt_match,
+ .acpi_match_table = tegra_rtc_acpi_match,
.pm = &tegra_rtc_pm_ops,
},
};
--
2.43.0
^ permalink raw reply related
* Re: [PATCH v2] rtc: amlogic-a4: fix double free caused by devm
From: Xianwei Zhao @ 2025-10-22 5:48 UTC (permalink / raw)
To: Haotian Zhang, alexandre.belloni, yiting.deng
Cc: linux-amlogic, linux-rtc, linux-kernel
In-Reply-To: <20251021103559.1903-1-vulab@iscas.ac.cn>
Reviewed-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
On 2025/10/21 18:35, Haotian Zhang wrote:
> [Some people who received this message don't often get email from vulab@iscas.ac.cn. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> [ EXTERNAL EMAIL ]
>
> The clock obtained via devm_clk_get_enabled() is automatically managed
> by devres and will be disabled and freed on driver detach. Manually
> calling clk_disable_unprepare() in error path and remove function
> causes double free.
>
> Remove the redundant clk_disable_unprepare() calls from the probe
> error path and aml_rtc_remove(), allowing the devm framework to
> automatically manage the clock lifecycle.
>
> Fixes: c89ac9182ee2 ("rtc: support for the Amlogic on-chip RTC")
> Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
> ---
> v2: Also remove the now-unused local variable 'rtc' in aml_rtc_remove()
> ---
> drivers/rtc/rtc-amlogic-a4.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/rtc/rtc-amlogic-a4.c b/drivers/rtc/rtc-amlogic-a4.c
> index 1928b29c1045..a993d35e1d6b 100644
> --- a/drivers/rtc/rtc-amlogic-a4.c
> +++ b/drivers/rtc/rtc-amlogic-a4.c
> @@ -390,7 +390,6 @@ static int aml_rtc_probe(struct platform_device *pdev)
>
> return 0;
> err_clk:
> - clk_disable_unprepare(rtc->sys_clk);
> device_init_wakeup(dev, false);
>
> return ret;
> @@ -423,9 +422,6 @@ static SIMPLE_DEV_PM_OPS(aml_rtc_pm_ops,
>
> static void aml_rtc_remove(struct platform_device *pdev)
> {
> - struct aml_rtc_data *rtc = dev_get_drvdata(&pdev->dev);
> -
> - clk_disable_unprepare(rtc->sys_clk);
> device_init_wakeup(&pdev->dev, false);
> }
>
> --
> 2.25.1
>
^ permalink raw reply
* Re: [PATCH v2 07/11] input: macsmc-hid: New driver to handle the Apple Mac SMC buttons/lid
From: Janne Grunau @ 2025-10-21 21:35 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: James Calligeros, Sven Peter, Alyssa Rosenzweig, Neal Gompa,
Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alexandre Belloni, Jean Delvare, Guenter Roeck, asahi,
linux-arm-kernel, devicetree, linux-kernel, linux-rtc,
linux-hwmon, linux-input, Hector Martin
In-Reply-To: <qffp7kadq3xojla5k6f5pr37irgytqfsqvabr6ydvulxnkcgnn@bv5mrraxrhhe>
On Fri, Aug 29, 2025 at 11:11:22AM +0000, Dmitry Torokhov wrote:
> Hi James,
>
> On Wed, Aug 27, 2025 at 09:22:41PM +1000, James Calligeros wrote:
> > +static void macsmc_hid_event_button(struct macsmc_hid *smchid, unsigned long event)
> > +{
> > + u8 button = (event >> 8) & 0xff;
> > + u8 state = !!(event & 0xff);
> > +
> > + switch (button) {
> > + case BTN_POWER:
> > + case BTN_TOUCHID:
> > + if (smchid->wakeup_mode) {
> > + if (state)
> > + pm_wakeup_hard_event(smchid->dev);
> > + } else {
> > + input_report_key(smchid->input, KEY_POWER, state);
> > + input_sync(smchid->input);
> > + }
>
> I believe you should be using pm_wakeup_event() in all cases so that
> pressing power would interrupt suspend even if resume() handler has not
> been run yet.
pm_wakeup_event() does not wake from s2idle. pm_wakeup_dev_event()'s
`hard` parameter is explicitily documented to wake from s2idle. So using
pm_wakeup_dev_event and use `smchid->wakeup_mode && state` as hard
parameter seems the correct thing to do.
> Also I do not think suppressing KEY_POWER is needed.
> Userspace should be smart and decide whether to shutdown the system or
> not when receiving KEY_POWER depending on the overall system state.
Not all user space. Using the power button to wake from s2idle while
showing agetty's login prompt on a tty results in an immediate shutdown.
Janne
^ permalink raw reply
* Re: [PATCH v2 1/6] clk: renesas: r9a09g057: Add clock and reset entries for RTC
From: Geert Uytterhoeven @ 2025-10-21 13:35 UTC (permalink / raw)
To: Ovidiu Panait
Cc: claudiu.beznea.uj, alexandre.belloni, robh, krzk+dt, conor+dt,
magnus.damm, mturquette, sboyd, p.zabel, linux-rtc,
linux-renesas-soc, devicetree, linux-kernel, linux-clk
In-Reply-To: <20251021080705.18116-2-ovidiu.panait.rb@renesas.com>
On Tue, 21 Oct 2025 at 10:07, Ovidiu Panait
<ovidiu.panait.rb@renesas.com> wrote:
> Add module clock and reset entries for the RTC module on the Renesas RZ/V2H
> (R9A09G057) SoC.
>
> Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-clk for v6.19.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* [PATCH v2] rtc: amlogic-a4: fix double free caused by devm
From: Haotian Zhang @ 2025-10-21 10:35 UTC (permalink / raw)
To: alexandre.belloni, yiting.deng, xianwei.zhao
Cc: linux-amlogic, linux-rtc, linux-kernel, Haotian Zhang
In-Reply-To: <20251020150956.491-1-vulab@iscas.ac.cn>
The clock obtained via devm_clk_get_enabled() is automatically managed
by devres and will be disabled and freed on driver detach. Manually
calling clk_disable_unprepare() in error path and remove function
causes double free.
Remove the redundant clk_disable_unprepare() calls from the probe
error path and aml_rtc_remove(), allowing the devm framework to
automatically manage the clock lifecycle.
Fixes: c89ac9182ee2 ("rtc: support for the Amlogic on-chip RTC")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
---
v2: Also remove the now-unused local variable 'rtc' in aml_rtc_remove()
---
drivers/rtc/rtc-amlogic-a4.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/rtc/rtc-amlogic-a4.c b/drivers/rtc/rtc-amlogic-a4.c
index 1928b29c1045..a993d35e1d6b 100644
--- a/drivers/rtc/rtc-amlogic-a4.c
+++ b/drivers/rtc/rtc-amlogic-a4.c
@@ -390,7 +390,6 @@ static int aml_rtc_probe(struct platform_device *pdev)
return 0;
err_clk:
- clk_disable_unprepare(rtc->sys_clk);
device_init_wakeup(dev, false);
return ret;
@@ -423,9 +422,6 @@ static SIMPLE_DEV_PM_OPS(aml_rtc_pm_ops,
static void aml_rtc_remove(struct platform_device *pdev)
{
- struct aml_rtc_data *rtc = dev_get_drvdata(&pdev->dev);
-
- clk_disable_unprepare(rtc->sys_clk);
device_init_wakeup(&pdev->dev, false);
}
--
2.25.1
^ permalink raw reply related
* Re: [PATCH] rtc: amlogic-a4: fix double free caused by devm
From: kernel test robot @ 2025-10-21 9:29 UTC (permalink / raw)
To: Haotian Zhang, Yiting Deng, Xianwei Zhao, Alexandre Belloni
Cc: llvm, oe-kbuild-all, linux-amlogic, linux-rtc, linux-kernel,
stable, Haotian Zhang
In-Reply-To: <20251020150956.491-1-vulab@iscas.ac.cn>
Hi Haotian,
kernel test robot noticed the following build warnings:
[auto build test WARNING on abelloni/rtc-next]
[also build test WARNING on linus/master v6.18-rc2 next-20251021]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Haotian-Zhang/rtc-amlogic-a4-fix-double-free-caused-by-devm/20251020-231345
base: https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git rtc-next
patch link: https://lore.kernel.org/r/20251020150956.491-1-vulab%40iscas.ac.cn
patch subject: [PATCH] rtc: amlogic-a4: fix double free caused by devm
config: i386-buildonly-randconfig-002-20251021 (https://download.01.org/0day-ci/archive/20251021/202510211756.vnQ8ZIWo-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251021/202510211756.vnQ8ZIWo-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510211756.vnQ8ZIWo-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/rtc/rtc-amlogic-a4.c:425:23: warning: unused variable 'rtc' [-Wunused-variable]
425 | struct aml_rtc_data *rtc = dev_get_drvdata(&pdev->dev);
| ^~~
1 warning generated.
vim +/rtc +425 drivers/rtc/rtc-amlogic-a4.c
c89ac9182ee297 Yiting Deng 2024-11-12 419
c89ac9182ee297 Yiting Deng 2024-11-12 420 static SIMPLE_DEV_PM_OPS(aml_rtc_pm_ops,
c89ac9182ee297 Yiting Deng 2024-11-12 421 aml_rtc_suspend, aml_rtc_resume);
c89ac9182ee297 Yiting Deng 2024-11-12 422
c89ac9182ee297 Yiting Deng 2024-11-12 423 static void aml_rtc_remove(struct platform_device *pdev)
c89ac9182ee297 Yiting Deng 2024-11-12 424 {
c89ac9182ee297 Yiting Deng 2024-11-12 @425 struct aml_rtc_data *rtc = dev_get_drvdata(&pdev->dev);
c89ac9182ee297 Yiting Deng 2024-11-12 426
8c28c4993f117e Wolfram Sang 2024-12-17 427 device_init_wakeup(&pdev->dev, false);
c89ac9182ee297 Yiting Deng 2024-11-12 428 }
c89ac9182ee297 Yiting Deng 2024-11-12 429
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply
* [PATCH v2 6/6] arm64: dts: renesas: r9a09g057h44-rzv2h-evk: Enable RTC
From: Ovidiu Panait @ 2025-10-21 8:07 UTC (permalink / raw)
To: claudiu.beznea.uj, alexandre.belloni, robh, krzk+dt, conor+dt,
geert+renesas, magnus.damm, mturquette, sboyd, p.zabel
Cc: linux-rtc, linux-renesas-soc, devicetree, linux-kernel, linux-clk
In-Reply-To: <20251021080705.18116-1-ovidiu.panait.rb@renesas.com>
Enable RTC.
Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
---
v2 changes: none
arch/arm64/boot/dts/renesas/r9a09g057h44-rzv2h-evk.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/r9a09g057h44-rzv2h-evk.dts b/arch/arm64/boot/dts/renesas/r9a09g057h44-rzv2h-evk.dts
index 3215ce53fe33..f20b63acca00 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g057h44-rzv2h-evk.dts
+++ b/arch/arm64/boot/dts/renesas/r9a09g057h44-rzv2h-evk.dts
@@ -408,6 +408,10 @@ &qextal_clk {
clock-frequency = <24000000>;
};
+&rtc {
+ status = "okay";
+};
+
&rtxin_clk {
clock-frequency = <32768>;
};
--
2.51.0
^ permalink raw reply related
* [PATCH v2 5/6] arm64: dts: renesas: r9a09g057: Add RTC node
From: Ovidiu Panait @ 2025-10-21 8:07 UTC (permalink / raw)
To: claudiu.beznea.uj, alexandre.belloni, robh, krzk+dt, conor+dt,
geert+renesas, magnus.damm, mturquette, sboyd, p.zabel
Cc: linux-rtc, linux-renesas-soc, devicetree, linux-kernel, linux-clk
In-Reply-To: <20251021080705.18116-1-ovidiu.panait.rb@renesas.com>
Add RTC node to Renesas RZ/V2H ("R9A09G057") SoC DTSI.
Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
---
v2 changes:
- Added "reset-names" to RTC dts node.
arch/arm64/boot/dts/renesas/r9a09g057.dtsi | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/r9a09g057.dtsi b/arch/arm64/boot/dts/renesas/r9a09g057.dtsi
index 40b15f1db930..724c4ce95c95 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g057.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a09g057.dtsi
@@ -591,6 +591,21 @@ wdt3: watchdog@13000400 {
status = "disabled";
};
+ rtc: rtc@11c00800 {
+ compatible = "renesas,r9a09g057-rtca3", "renesas,rz-rtca3";
+ reg = <0 0x11c00800 0 0x400>;
+ interrupts = <GIC_SPI 524 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 525 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 526 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "alarm", "period", "carry";
+ clocks = <&cpg CPG_MOD 0x53>, <&rtxin_clk>;
+ clock-names = "bus", "counter";
+ power-domains = <&cpg>;
+ resets = <&cpg 0x79>, <&cpg 0x7a>;
+ reset-names = "rtc", "rtc_rtest";
+ status = "disabled";
+ };
+
scif: serial@11c01400 {
compatible = "renesas,scif-r9a09g057";
reg = <0 0x11c01400 0 0x400>;
--
2.51.0
^ permalink raw reply related
* [PATCH v2 4/6] rtc: renesas-rtca3: Add support for RZ/V2H SoC
From: Ovidiu Panait @ 2025-10-21 8:07 UTC (permalink / raw)
To: claudiu.beznea.uj, alexandre.belloni, robh, krzk+dt, conor+dt,
geert+renesas, magnus.damm, mturquette, sboyd, p.zabel
Cc: linux-rtc, linux-renesas-soc, devicetree, linux-kernel, linux-clk
In-Reply-To: <20251021080705.18116-1-ovidiu.panait.rb@renesas.com>
Add a new compatible string for the Renesas RZ/V2H RTC along with the SoC
specific OF data, to account for the different maximum periodic interrupt
frequency (128Hz).
Also, switch from devm_reset_control_get_shared() to
devm_reset_control_array_get_shared() when retrieving resets.
The RZ/V2H SoC requires two resets for the RTC block instead of one,
so this will allow to handle multiple resets without additional changes.
Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
---
v2 changes: none
drivers/rtc/rtc-renesas-rtca3.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-renesas-rtca3.c b/drivers/rtc/rtc-renesas-rtca3.c
index 90dda04fad33..96f5d3734d93 100644
--- a/drivers/rtc/rtc-renesas-rtca3.c
+++ b/drivers/rtc/rtc-renesas-rtca3.c
@@ -738,7 +738,7 @@ static int rtca3_probe(struct platform_device *pdev)
if (ret)
return ret;
- priv->rstc = devm_reset_control_get_shared(dev, NULL);
+ priv->rstc = devm_reset_control_array_get_shared(dev);
if (IS_ERR(priv->rstc))
return PTR_ERR(priv->rstc);
@@ -887,11 +887,16 @@ static int rtca3_resume(struct device *dev)
static DEFINE_SIMPLE_DEV_PM_OPS(rtca3_pm_ops, rtca3_suspend, rtca3_resume);
+static const struct rtca3_of_data rtca3_rzv2h_of_data = {
+ .max_periodic_irq_freq = 128,
+};
+
static const struct rtca3_of_data rtca3_of_data = {
.max_periodic_irq_freq = 256,
};
static const struct of_device_id rtca3_of_match[] = {
+ { .compatible = "renesas,r9a09g057-rtca3", .data = &rtca3_rzv2h_of_data },
{ .compatible = "renesas,rz-rtca3", .data = &rtca3_of_data },
{ /* sentinel */ }
};
--
2.51.0
^ permalink raw reply related
* [PATCH v2 3/6] rtc: renesas-rtca3: Use OF data for configuration
From: Ovidiu Panait @ 2025-10-21 8:07 UTC (permalink / raw)
To: claudiu.beznea.uj, alexandre.belloni, robh, krzk+dt, conor+dt,
geert+renesas, magnus.damm, mturquette, sboyd, p.zabel
Cc: linux-rtc, linux-renesas-soc, devicetree, linux-kernel, linux-clk
In-Reply-To: <20251021080705.18116-1-ovidiu.panait.rb@renesas.com>
Prepare for adding support for the Renesas RZ/V2H SoC RTC IP by making the
driver configuration selectable via OF match data.
For RZ/V2H RTC, the maximum periodic interrupt frequency is 128Hz instead
of 256Hz, so add this info to a SoC-specific struct and retrieve it
during probe.
Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
---
v2 changes: none
drivers/rtc/rtc-renesas-rtca3.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-renesas-rtca3.c b/drivers/rtc/rtc-renesas-rtca3.c
index ab816bdf0d77..90dda04fad33 100644
--- a/drivers/rtc/rtc-renesas-rtca3.c
+++ b/drivers/rtc/rtc-renesas-rtca3.c
@@ -101,6 +101,15 @@ enum rtca3_alrm_set_step {
RTCA3_ALRM_SSTEP_INIT = 3,
};
+/**
+ * struct rtca3_of_data - OF data for RTCA3
+ *
+ * @max_periodic_irq_freq: maximum periodic interrupt frequency
+ */
+struct rtca3_of_data {
+ int max_periodic_irq_freq;
+};
+
/**
* struct rtca3_ppb_per_cycle - PPB per cycle
* @ten_sec: PPB per cycle in 10 seconds adjutment mode
@@ -709,6 +718,7 @@ static void rtca3_action(void *data)
static int rtca3_probe(struct platform_device *pdev)
{
+ const struct rtca3_of_data *of_data;
struct device *dev = &pdev->dev;
struct rtca3_priv *priv;
struct clk *clk;
@@ -718,6 +728,8 @@ static int rtca3_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
+ of_data = of_device_get_match_data(dev);
+
priv->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(priv->base))
return PTR_ERR(priv->base);
@@ -772,7 +784,7 @@ static int rtca3_probe(struct platform_device *pdev)
return PTR_ERR(priv->rtc_dev);
priv->rtc_dev->ops = &rtca3_ops;
- priv->rtc_dev->max_user_freq = 256;
+ priv->rtc_dev->max_user_freq = of_data->max_periodic_irq_freq;
priv->rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_2000;
priv->rtc_dev->range_max = RTC_TIMESTAMP_END_2099;
@@ -875,8 +887,12 @@ static int rtca3_resume(struct device *dev)
static DEFINE_SIMPLE_DEV_PM_OPS(rtca3_pm_ops, rtca3_suspend, rtca3_resume);
+static const struct rtca3_of_data rtca3_of_data = {
+ .max_periodic_irq_freq = 256,
+};
+
static const struct of_device_id rtca3_of_match[] = {
- { .compatible = "renesas,rz-rtca3", },
+ { .compatible = "renesas,rz-rtca3", .data = &rtca3_of_data },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, rtca3_of_match);
--
2.51.0
^ permalink raw reply related
* [PATCH v2 2/6] dt-bindings: rtc: renesas,rz-rtca3: Add RZ/V2H support
From: Ovidiu Panait @ 2025-10-21 8:07 UTC (permalink / raw)
To: claudiu.beznea.uj, alexandre.belloni, robh, krzk+dt, conor+dt,
geert+renesas, magnus.damm, mturquette, sboyd, p.zabel
Cc: linux-rtc, linux-renesas-soc, devicetree, linux-kernel, linux-clk
In-Reply-To: <20251021080705.18116-1-ovidiu.panait.rb@renesas.com>
The Renesas RZ/V2H RTC IP is based on the same RTCA3 IP as RZ/G3S
(r9a08g045), with the following differences:
- It lacks the time capture functionality
- The maximum supported periodic interrupt frequency is 128Hz instead
of 256Hz
- It requires two reset lines instead of one
Add new compatible string "renesas,r9a09g057-rtca3" for RZ/V2H and update
the binding accordingly:
- Allow "resets" to contain one or two entries depending on the SoC.
- Add "reset-names" property, but make it required only for RZ/V2H.
Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
---
v2 changes:
- Added "reset-names" property and made it required for RZ/V2H.
.../bindings/rtc/renesas,rz-rtca3.yaml | 45 ++++++++++++++++---
1 file changed, 40 insertions(+), 5 deletions(-)
diff --git a/Documentation/devicetree/bindings/rtc/renesas,rz-rtca3.yaml b/Documentation/devicetree/bindings/rtc/renesas,rz-rtca3.yaml
index e70eeb66aa64..2569cb494481 100644
--- a/Documentation/devicetree/bindings/rtc/renesas,rz-rtca3.yaml
+++ b/Documentation/devicetree/bindings/rtc/renesas,rz-rtca3.yaml
@@ -9,14 +9,12 @@ title: Renesas RTCA-3 Real Time Clock
maintainers:
- Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
-allOf:
- - $ref: rtc.yaml#
-
properties:
compatible:
items:
- enum:
- renesas,r9a08g045-rtca3 # RZ/G3S
+ - renesas,r9a09g057-rtca3 # RZ/V2H
- const: renesas,rz-rtca3
reg:
@@ -48,8 +46,12 @@ properties:
maxItems: 1
resets:
- items:
- - description: VBATTB module reset
+ minItems: 1
+ maxItems: 2
+
+ reset-names:
+ minItems: 1
+ maxItems: 2
required:
- compatible
@@ -61,6 +63,39 @@ required:
- power-domains
- resets
+allOf:
+ - $ref: rtc.yaml#
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: renesas,r9a08g045-rtca3
+ then:
+ properties:
+ resets:
+ items:
+ - description: VBATTB module reset
+ reset-names:
+ const: vbattb
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: renesas,r9a09g057-rtca3
+ then:
+ properties:
+ resets:
+ items:
+ - description: RTC reset
+ - description: Reset for the RTEST registers
+ reset-names:
+ items:
+ - const: rtc
+ - const: rtc_rtest
+ required:
+ - reset-names
+
additionalProperties: false
examples:
--
2.51.0
^ permalink raw reply related
* [PATCH v2 1/6] clk: renesas: r9a09g057: Add clock and reset entries for RTC
From: Ovidiu Panait @ 2025-10-21 8:07 UTC (permalink / raw)
To: claudiu.beznea.uj, alexandre.belloni, robh, krzk+dt, conor+dt,
geert+renesas, magnus.damm, mturquette, sboyd, p.zabel
Cc: linux-rtc, linux-renesas-soc, devicetree, linux-kernel, linux-clk
In-Reply-To: <20251021080705.18116-1-ovidiu.panait.rb@renesas.com>
Add module clock and reset entries for the RTC module on the Renesas RZ/V2H
(R9A09G057) SoC.
Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
---
v2 changes: none
drivers/clk/renesas/r9a09g057-cpg.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/clk/renesas/r9a09g057-cpg.c b/drivers/clk/renesas/r9a09g057-cpg.c
index c9c117c6782c..100cd56c323e 100644
--- a/drivers/clk/renesas/r9a09g057-cpg.c
+++ b/drivers/clk/renesas/r9a09g057-cpg.c
@@ -241,6 +241,8 @@ static const struct rzv2h_mod_clk r9a09g057_mod_clks[] __initconst = {
BUS_MSTOP(5, BIT(13))),
DEF_MOD("wdt_3_clk_loco", CLK_QEXTAL, 5, 2, 2, 18,
BUS_MSTOP(5, BIT(13))),
+ DEF_MOD("rtc_0_clk_rtc", CLK_PLLCM33_DIV16, 5, 3, 2, 19,
+ BUS_MSTOP(3, BIT(11) | BIT(12))),
DEF_MOD("rspi_0_pclk", CLK_PLLCLN_DIV8, 5, 4, 2, 20,
BUS_MSTOP(11, BIT(0))),
DEF_MOD("rspi_0_pclk_sfr", CLK_PLLCLN_DIV8, 5, 5, 2, 21,
@@ -411,6 +413,8 @@ static const struct rzv2h_reset r9a09g057_resets[] __initconst = {
DEF_RST(7, 6, 3, 7), /* WDT_1_RESET */
DEF_RST(7, 7, 3, 8), /* WDT_2_RESET */
DEF_RST(7, 8, 3, 9), /* WDT_3_RESET */
+ DEF_RST(7, 9, 3, 10), /* RTC_0_RST_RTC */
+ DEF_RST(7, 10, 3, 11), /* RTC_0_RST_RTC_V */
DEF_RST(7, 11, 3, 12), /* RSPI_0_PRESETN */
DEF_RST(7, 12, 3, 13), /* RSPI_0_TRESETN */
DEF_RST(7, 13, 3, 14), /* RSPI_1_PRESETN */
--
2.51.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox