All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Cc: claudiu.beznea.uj@bp.renesas.com, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be,
	magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org,
	p.zabel@pengutronix.de, linux-rtc@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Subject: Re: [PATCH v2 3/6] rtc: renesas-rtca3: Use OF data for configuration
Date: Fri, 31 Oct 2025 15:08:18 +0100	[thread overview]
Message-ID: <20251031140818ebce1763@mail.local> (raw)
In-Reply-To: <20251021080705.18116-4-ovidiu.panait.rb@renesas.com>

Hello,

Since the RTC will never be used for PIE (we are using hrtimer), I guess
this patch is not necessary, instead, you could simply stop setting
max_user_freq.

On 21/10/2025 08:07:02+0000, Ovidiu Panait wrote:
> 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
> 

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

  reply	other threads:[~2025-10-31 14:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-21  8:06 [PATCH v2 0/6] Add RTC support for the Renesas RZ/V2H SoC Ovidiu Panait
2025-10-21  8:07 ` [PATCH v2 1/6] clk: renesas: r9a09g057: Add clock and reset entries for RTC Ovidiu Panait
2025-10-21 13:35   ` Geert Uytterhoeven
2025-10-21  8:07 ` [PATCH v2 2/6] dt-bindings: rtc: renesas,rz-rtca3: Add RZ/V2H support Ovidiu Panait
2025-10-22 17:42   ` Conor Dooley
2025-11-06  8:47   ` Geert Uytterhoeven
2025-11-06  9:13     ` Ovidiu Panait
2025-11-06 10:41       ` Alexandre Belloni
2025-10-21  8:07 ` [PATCH v2 3/6] rtc: renesas-rtca3: Use OF data for configuration Ovidiu Panait
2025-10-31 14:08   ` Alexandre Belloni [this message]
2025-10-21  8:07 ` [PATCH v2 4/6] rtc: renesas-rtca3: Add support for RZ/V2H SoC Ovidiu Panait
2025-10-21  8:07 ` [PATCH v2 5/6] arm64: dts: renesas: r9a09g057: Add RTC node Ovidiu Panait
2025-10-21  8:07 ` [PATCH v2 6/6] arm64: dts: renesas: r9a09g057h44-rzv2h-evk: Enable RTC Ovidiu Panait

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=20251031140818ebce1763@mail.local \
    --to=alexandre.belloni@bootlin.com \
    --cc=claudiu.beznea.uj@bp.renesas.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=krzk+dt@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=ovidiu.panait.rb@renesas.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.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 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.