devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Magnus Damm <magnus.damm@gmail.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-rtc@vger.kernel.org,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	linux-clk <linux-clk@vger.kernel.org>,
	Gareth Williams <gareth.williams.jx@renesas.com>,
	Milan Stevanovic <milan.stevanovic@se.com>,
	Jimmy Lalande <jimmy.lalande@se.com>,
	Pascal Eberhard <pascal.eberhard@se.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Herve Codina <herve.codina@bootlin.com>,
	Clement Leger <clement.leger@bootlin.com>,
	Michel Pollet <michel.pollet@bp.renesas.com>
Subject: Re: [PATCH v2 3/7] rtc: rzn1: Add new RTC driver
Date: Thu, 28 Apr 2022 11:09:17 +0200	[thread overview]
Message-ID: <20220428110917.6b1a19ce@xps13> (raw)
In-Reply-To: <CAMuHMdVBxeH=G8Dj0d=vS80c356Z+D2fsxRr6n+bzMxXX=D9+Q@mail.gmail.com>

Hi Geert,

geert@linux-m68k.org wrote on Thu, 28 Apr 2022 10:58:03 +0200:

> Hi Miquel,
> 
> On Thu, Apr 21, 2022 at 11:00 AM Miquel Raynal
> <miquel.raynal@bootlin.com> wrote:
> > From: Michel Pollet <michel.pollet@bp.renesas.com>
> >
> > Add a basic RTC driver for the RZ/N1.
> >
> > Signed-off-by: Michel Pollet <michel.pollet@bp.renesas.com>
> > Co-developed-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>  
> 
> Thanks for your patch!
> 
> > --- a/drivers/rtc/Kconfig
> > +++ b/drivers/rtc/Kconfig
> > @@ -1548,6 +1548,13 @@ config RTC_DRV_RS5C313
> >         help
> >           If you say yes here you get support for the Ricoh RS5C313 RTC chips.
> >
> > +config RTC_DRV_RZN1
> > +       tristate "Renesas RZN1 RTC"  
> 
> RZ/N1
> 
> > +       depends on ARCH_RZN1 || COMPILE_TEST
> > +       depends on OF && HAS_IOMEM
> > +       help
> > +         If you say yes here you get support for the Renesas RZ/N1 RTC.
> > +
> >  config RTC_DRV_GENERIC
> >         tristate "Generic RTC support"
> >         # Please consider writing a new RTC driver instead of using the generic  
> 
> > --- /dev/null
> > +++ b/drivers/rtc/rtc-rzn1.c  
> 
> > +static int rzn1_rtc_probe(struct platform_device *pdev)
> > +{
> > +       struct rzn1_rtc *rtc;
> > +       int ret;
> > +
> > +       rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL);
> > +       if (!rtc)
> > +               return -ENOMEM;
> > +
> > +       platform_set_drvdata(pdev, rtc);
> > +
> > +       rtc->clk = devm_clk_get(&pdev->dev, "hclk");
> > +       if (IS_ERR(rtc->clk))
> > +               return dev_err_probe(&pdev->dev, PTR_ERR(rtc->clk), "Missing hclk\n");  
> 
> As you don't care about the clock rate, only about enabling/disabling
> the clock, I recommend using Runtime PM instead of explicit clock
> handling.

That's right.

> That does depend on:
> [PATCH v3 4/8] soc: renesas: rzn1: Select PM and PM_GENERIC_DOMAINS configs[1]
> [PATCH v3 5/8] ARM: dts: r9a06g032: Add missing '#power-domain-cells'[2]

There should not be any dependency with the RTC tree so that should not
be too complex to handle.

> and on documenting the power-domains property to the RTC DT bindings,
> and on adding a proper power-domains property to the RTC node in DTS.

Right.

Do we need to define these properties in the UART, DMA and NAND
controller nodes as well? I seem to remember that you mentioned it but
I don't recall for which one and I was too focused (lazy?) on other
features so I forgot about it.

> [1] https://lore.kernel.org/linux-renesas-soc/20220422120850.769480-5-herve.codina@bootlin.com
> [2] https://lore.kernel.org/linux-renesas-soc/20220422120850.769480-6-herve.codina@bootlin.com

Thanks,
Miquèl

  reply	other threads:[~2022-04-28  9:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21  9:00 [PATCH v2 0/7] RZN1 RTC support Miquel Raynal
2022-04-21  9:00 ` [PATCH v2 1/7] dt-bindings: rtc: rzn1: Describe the RZN1 RTC Miquel Raynal
2022-04-21 11:38   ` Krzysztof Kozlowski
2022-04-28  8:45   ` Geert Uytterhoeven
2022-04-21  9:00 ` [PATCH v2 2/7] soc: renesas: rzn1-sysc: Fix the RTC hclock description Miquel Raynal
2022-04-22 23:16   ` Stephen Boyd
2022-04-27 15:32   ` Geert Uytterhoeven
2022-04-27 15:42     ` Miquel Raynal
2022-04-27 15:43     ` Geert Uytterhoeven
2022-04-21  9:00 ` [PATCH v2 3/7] rtc: rzn1: Add new RTC driver Miquel Raynal
2022-04-28  8:58   ` Geert Uytterhoeven
2022-04-28  9:09     ` Miquel Raynal [this message]
2022-04-28  9:28       ` Geert Uytterhoeven
2022-04-21  9:00 ` [PATCH v2 4/7] rtc: rzn1: Add alarm support Miquel Raynal
2022-04-21  9:00 ` [PATCH v2 5/7] rtc: rzn1: Add oscillator offset support Miquel Raynal
2022-04-21  9:00 ` [PATCH v2 6/7] MAINTAINERS: Add myself as maintainer of the RZN1 RTC driver Miquel Raynal
2022-04-21  9:00 ` [PATCH v2 7/7] ARM: dts: r9a06g032: Describe the RTC Miquel Raynal
2022-04-28  8:48   ` Geert Uytterhoeven

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=20220428110917.6b1a19ce@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=clement.leger@bootlin.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gareth.williams.jx@renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=herve.codina@bootlin.com \
    --cc=jimmy.lalande@se.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=michel.pollet@bp.renesas.com \
    --cc=milan.stevanovic@se.com \
    --cc=mturquette@baylibre.com \
    --cc=pascal.eberhard@se.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    /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).