All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Chris Brandt <Chris.Brandt@renesas.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Simon Horman <horms+renesas@verge.net.au>,
	RTCLINUX <rtc-linux@googlegroups.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: [rtc-linux] Re: [PATCH 2/5] rtc: Add rtc-sh
Date: Mon, 20 Mar 2017 23:45:24 +0100	[thread overview]
Message-ID: <20170320224524.cvtxotz7266hrxr2@piout.net> (raw)
In-Reply-To: <SG2PR06MB11650F098CFD2BCCB74C823B8A3A0@SG2PR06MB1165.apcprd06.prod.outlook.com>

On 20/03/2017 at 16:26:46 +0000, Chris Brandt wrote:
> Hi Geert,
> 
> On Monday, March 20, 2017, Geert Uytterhoeven wrote:
> > > +       rtc: rtc@fcff1000 {
> > > +               compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> > > +               reg = <0xfcff1000 0x2e>;
> > > +               interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
> > > +                             GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> > > +                             GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> > > +               interrupt-names = "alarm", "period", "carry";
> > > +               clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> > > +                         <&extal_clk> , <&rtc_x3_clk>;
> > > +               clock-names = "fck", "rtc_x1", "extal", "rtc_x3";
> > > +               power-domains = <&cpg_clocks>;
> > > +               count-source = "rtc_x1";    <<<<<<< this would be in the
> > board dts file
> > 
> > IMHO that's software policy, not hardware description, so it doesn't
> > belong in DT.
> 
> Really? I'm so confused about what is and isn't the responsibility of DT.
> 
> 
> > However, by scanning the list of allowed clock names, and looking at clock
> > rates, the driver can find a suitable clock itself.
> 
> Yes, I could make the selection automatic by looking that the clock names (and
> I will do that for this driver), but what about the case where a user needs
> to select something from a list of possible HW options? In other words, where
> does 'software option' selection stuff go if not in the DT?
> 

If you want you can leave the clock selection logic out of the driver as
long as the DT binding is complete. You dont have to use everything that
is described in the DT.

Regarding the selection, I'd say take the first that is present and not
0 however, if something has already been set, you may not want to
override it. (I know, this is not helping a lot ;) )

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Belloni <alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Chris Brandt <Chris.Brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
Cc: Geert Uytterhoeven
	<geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>,
	Alessandro Zummo
	<a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Simon Horman
	<horms+renesas-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>,
	RTCLINUX <rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux-Renesas
	<linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 2/5] rtc: Add rtc-sh
Date: Mon, 20 Mar 2017 23:45:24 +0100	[thread overview]
Message-ID: <20170320224524.cvtxotz7266hrxr2@piout.net> (raw)
In-Reply-To: <SG2PR06MB11650F098CFD2BCCB74C823B8A3A0-ESzmfEwOt/xoAsOJh7vwSm0DtJ1/0DrXvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>

On 20/03/2017 at 16:26:46 +0000, Chris Brandt wrote:
> Hi Geert,
> 
> On Monday, March 20, 2017, Geert Uytterhoeven wrote:
> > > +       rtc: rtc@fcff1000 {
> > > +               compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> > > +               reg = <0xfcff1000 0x2e>;
> > > +               interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
> > > +                             GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> > > +                             GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> > > +               interrupt-names = "alarm", "period", "carry";
> > > +               clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> > > +                         <&extal_clk> , <&rtc_x3_clk>;
> > > +               clock-names = "fck", "rtc_x1", "extal", "rtc_x3";
> > > +               power-domains = <&cpg_clocks>;
> > > +               count-source = "rtc_x1";    <<<<<<< this would be in the
> > board dts file
> > 
> > IMHO that's software policy, not hardware description, so it doesn't
> > belong in DT.
> 
> Really? I'm so confused about what is and isn't the responsibility of DT.
> 
> 
> > However, by scanning the list of allowed clock names, and looking at clock
> > rates, the driver can find a suitable clock itself.
> 
> Yes, I could make the selection automatic by looking that the clock names (and
> I will do that for this driver), but what about the case where a user needs
> to select something from a list of possible HW options? In other words, where
> does 'software option' selection stuff go if not in the DT?
> 

If you want you can leave the clock selection logic out of the driver as
long as the DT binding is complete. You dont have to use everything that
is described in the DT.

Regarding the selection, I'd say take the first that is present and not
0 however, if something has already been set, you may not want to
override it. (I know, this is not helping a lot ;) )

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Chris Brandt <Chris.Brandt@renesas.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Simon Horman <horms+renesas@verge.net.au>,
	RTCLINUX <rtc-linux@googlegroups.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH 2/5] rtc: Add rtc-sh
Date: Mon, 20 Mar 2017 23:45:24 +0100	[thread overview]
Message-ID: <20170320224524.cvtxotz7266hrxr2@piout.net> (raw)
In-Reply-To: <SG2PR06MB11650F098CFD2BCCB74C823B8A3A0@SG2PR06MB1165.apcprd06.prod.outlook.com>

On 20/03/2017 at 16:26:46 +0000, Chris Brandt wrote:
> Hi Geert,
> 
> On Monday, March 20, 2017, Geert Uytterhoeven wrote:
> > > +       rtc: rtc@fcff1000 {
> > > +               compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> > > +               reg = <0xfcff1000 0x2e>;
> > > +               interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
> > > +                             GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> > > +                             GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> > > +               interrupt-names = "alarm", "period", "carry";
> > > +               clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> > > +                         <&extal_clk> , <&rtc_x3_clk>;
> > > +               clock-names = "fck", "rtc_x1", "extal", "rtc_x3";
> > > +               power-domains = <&cpg_clocks>;
> > > +               count-source = "rtc_x1";    <<<<<<< this would be in the
> > board dts file
> > 
> > IMHO that's software policy, not hardware description, so it doesn't
> > belong in DT.
> 
> Really? I'm so confused about what is and isn't the responsibility of DT.
> 
> 
> > However, by scanning the list of allowed clock names, and looking at clock
> > rates, the driver can find a suitable clock itself.
> 
> Yes, I could make the selection automatic by looking that the clock names (and
> I will do that for this driver), but what about the case where a user needs
> to select something from a list of possible HW options? In other words, where
> does 'software option' selection stuff go if not in the DT?
> 

If you want you can leave the clock selection logic out of the driver as
long as the DT binding is complete. You dont have to use everything that
is described in the DT.

Regarding the selection, I'd say take the first that is present and not
0 however, if something has already been set, you may not want to
override it. (I know, this is not helping a lot ;) )

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2017-03-20 22:45 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 17:51 [rtc-linux] [PATCH 0/5] rtc: Reuse rtc-sh driver to support RZ/A1 Chris Brandt
2017-03-16 17:51 ` Chris Brandt
2017-03-16 17:51 ` Chris Brandt
2017-03-16 17:51 ` [rtc-linux] [PATCH 1/5] rtc: rtc-sh: add support for rza series Chris Brandt
2017-03-16 17:51   ` Chris Brandt
2017-03-16 17:51   ` Chris Brandt
2017-03-17  8:22   ` [rtc-linux] " Geert Uytterhoeven
2017-03-17  8:22     ` Geert Uytterhoeven
2017-03-17  8:22     ` Geert Uytterhoeven
2017-03-17 13:17     ` [rtc-linux] " Chris Brandt
2017-03-17 13:17       ` Chris Brandt
2017-03-17 13:17       ` Chris Brandt
2017-03-17 15:11   ` [rtc-linux] " Alexandre Belloni
2017-03-17 15:11     ` Alexandre Belloni
2017-03-16 17:51 ` [rtc-linux] [PATCH 2/5] rtc: Add rtc-sh Chris Brandt
2017-03-16 17:51   ` Chris Brandt
2017-03-16 17:51   ` Chris Brandt
2017-03-17  8:17   ` [rtc-linux] " Geert Uytterhoeven
2017-03-17  8:17     ` Geert Uytterhoeven
2017-03-17  8:17     ` Geert Uytterhoeven
2017-03-17 13:16     ` [rtc-linux] " Chris Brandt
2017-03-17 13:16       ` Chris Brandt
2017-03-17 13:16       ` Chris Brandt
2017-03-17 13:21       ` [rtc-linux] " Geert Uytterhoeven
2017-03-17 13:21         ` Geert Uytterhoeven
2017-03-17 13:21         ` Geert Uytterhoeven
2017-03-17 13:41         ` [rtc-linux] " Chris Brandt
2017-03-17 13:41           ` Chris Brandt
2017-03-17 13:41           ` Chris Brandt
2017-03-17 13:55           ` [rtc-linux] " Geert Uytterhoeven
2017-03-17 13:55             ` Geert Uytterhoeven
2017-03-17 13:55             ` Geert Uytterhoeven
2017-03-17 15:05             ` [rtc-linux] " Alexandre Belloni
2017-03-17 15:05               ` Alexandre Belloni
2017-03-17 15:05               ` Alexandre Belloni
2017-03-20 15:05               ` [rtc-linux] " Chris Brandt
2017-03-20 15:05                 ` Chris Brandt
2017-03-20 15:05                 ` Chris Brandt
2017-03-20 16:03                 ` [rtc-linux] " Geert Uytterhoeven
2017-03-20 16:03                   ` Geert Uytterhoeven
2017-03-20 16:03                   ` Geert Uytterhoeven
2017-03-20 16:26                   ` [rtc-linux] " Chris Brandt
2017-03-20 16:26                     ` Chris Brandt
2017-03-20 16:26                     ` Chris Brandt
2017-03-20 22:45                     ` Alexandre Belloni [this message]
2017-03-20 22:45                       ` Alexandre Belloni
2017-03-20 22:45                       ` Alexandre Belloni
2017-03-16 17:51 ` [rtc-linux] [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree Chris Brandt
2017-03-16 17:51   ` Chris Brandt
2017-03-16 17:51   ` Chris Brandt
2017-03-17  8:27   ` [rtc-linux] " Geert Uytterhoeven
2017-03-17  8:27     ` Geert Uytterhoeven
2017-03-17  8:27     ` Geert Uytterhoeven
2017-03-17 13:20     ` [rtc-linux] " Chris Brandt
2017-03-17 13:20       ` Chris Brandt
2017-03-17 13:20       ` Chris Brandt
2017-03-17 13:33       ` [rtc-linux] " Geert Uytterhoeven
2017-03-17 13:33         ` Geert Uytterhoeven
2017-03-17 13:33         ` Geert Uytterhoeven
2017-03-17 13:48         ` [rtc-linux] " Chris Brandt
2017-03-17 13:48           ` Chris Brandt
2017-03-17 13:48           ` Chris Brandt
2017-03-17 13:57           ` [rtc-linux] " Geert Uytterhoeven
2017-03-17 13:57             ` Geert Uytterhoeven
2017-03-17 13:57             ` Geert Uytterhoeven
2017-03-17 15:16   ` [rtc-linux] " Alexandre Belloni
2017-03-17 15:16     ` Alexandre Belloni
2017-03-17 15:16     ` Alexandre Belloni
2017-03-16 17:51 ` [rtc-linux] [PATCH 4/5] ARM: dts: r7s72100: add rtc " Chris Brandt
2017-03-16 17:51   ` Chris Brandt
2017-03-16 17:51 ` [rtc-linux] [PATCH 5/5] ARM: dts: rskrza1: add rtc DT support Chris Brandt
2017-03-16 17:51   ` Chris Brandt
2017-03-16 17:51   ` Chris Brandt
     [not found] ` <20170316175112.27913-1-chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2017-03-28 13:38   ` [PATCH 0/5] rtc: Reuse rtc-sh driver to support RZ/A1 bobethtarsi3-Re5JQEeQqe8AvxtiuMwx3w

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=20170320224524.cvtxotz7266hrxr2@piout.net \
    --to=alexandre.belloni@free-electrons.com \
    --cc=Chris.Brandt@renesas.com \
    --cc=a.zummo@towertech.it \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=horms+renesas@verge.net.au \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=rtc-linux@googlegroups.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 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.