All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: "Michael Turquette" <mturquette@baylibre.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, kernel@pengutronix.de,
	"Alvin Šipraga" <alsi@bang-olufsen.dk>
Subject: Re: [PATCH 3/3] dt-bindings: clock: add TI CDCE6214 binding
Date: Tue, 8 Apr 2025 17:02:21 +0200	[thread overview]
Message-ID: <Z_U6fUGbOV2SdO_C@pengutronix.de> (raw)
In-Reply-To: <5766d152-51e7-42f5-864f-5cb1798606a3@kernel.org>

On Tue, Apr 08, 2025 at 04:27:23PM +0200, Krzysztof Kozlowski wrote:
> On 08/04/2025 14:00, Sascha Hauer wrote:
> > +
> 
> A nit, subject: drop second/last, redundant "binding". The "dt-bindings"
> prefix is already stating that these are bindings.
> See also:
> https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
> 
> 
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - ti,cdce6214
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  clocks:
> > +    minItems: 1
> > +    maxItems: 2
> > +
> > +  clock-names:
> > +    minItems: 1
> > +    items:
> > +      - const: priref
> > +      - const: secref
> 
> So one input is optional?

The chip has two clock inputs and to be operational it needs at least
one clock, could be priref or secref or both.

Is there a proper way to express this situation?


> > +  "^clk@[2-9]$":
> > +    type: object
> > +    description: |
> > +      optional child node that can be used to specify output pin parameters.  The reg
> > +      properties match the CDCE6214_CLK_* defines.
> > +
> > +    additionalProperties: false
> > +
> > +    properties:
> > +      reg:
> > +        description:
> > +          clock output identifier.
> > +        minimum: 2
> > +        maximum: 9
> > +
> > +      ti,lphcsl:
> > +        type: boolean
> > +        description: |
> > +          If true enable LP-HCSL output mode for this clock
> > +
> > +      ti,lvds:
> > +        type: boolean
> > +        description: |
> > +          If true enable LVDS output mode for this clock
> > +
> > +      ti,cmosp:
> > +        type: boolean
> > +        description: |
> > +          If true enable CMOSP output for this clock
> > +
> > +      ti,cmosn:
> > +        type: boolean
> > +        description: |
> > +          If true enable CMOSN output for this clock
> 
> Looks the same here. Anyway having these as subnodes is too much. You
> have fixed number of clocks, so you need one or two array properties in
> top-level.

There are several properties I haven't yet modeled, like

- 1.8V / 2.5V output
- sync_delay
- LVDS common-mode trim increment/decrement
- differential buffer BIAS trim
- slew rate
- BIAS current setting for XTAL mode
- load capacity for XTAL mode

I don't know which of them will ever be supported, but I thought having a
node per pin would add a natural place to add these properties. Do you
still think arrays would be more appropriate?

> 
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - clocks
> > +  - "#clock-cells"
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/clock/ti,cdce6214.h>
> 
> This file does not exist. Something is odd in this example.

It is added in the driver patch. Should it come with the binding patch
instead?

> 
> > +    i2c {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        clock-generator@67 {
> > +            compatible = "ti,cdce6214";
> > +            reg = <0x67>;
> > +            #address-cells = <1>;
> > +            #size-cells = <0>;
> > +            #clock-cells = <1>;
> > +            clocks = <&clock_ref25m>;
> > +            clock-names = "priref";
> > +
> > +            clk@CDCE6214_CLK_SECREF {
> 
> That's not a valid unit address. Use simple numbers, see DT spec and DTS
> coding style.

CDCE6214_CLK_SECREF is a macro added in dt-bindings/clock/ti,cdce6214.h
and it expands to a simple number (1 in this case). While I haven't
found any examples of someone using macros for the unit address / reg
property I thought I'd give it a try as it nicely shows how it is used.

I can switch to plain numbers if you prefer that though.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2025-04-08 15:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08 12:00 [PATCH 0/3] clk: add support for TI CDCE6214 Sascha Hauer
2025-04-08 12:00 ` [PATCH 1/3] clk: make determine_rate optional for non reparenting clocks Sascha Hauer
2025-04-08 12:00 ` [PATCH 2/3] clk: add TI CDCE6214 clock driver Sascha Hauer
2025-04-08 13:43   ` Sascha Hauer
2025-04-08 12:00 ` [PATCH 3/3] dt-bindings: clock: add TI CDCE6214 binding Sascha Hauer
2025-04-08 14:27   ` Krzysztof Kozlowski
2025-04-08 15:02     ` Sascha Hauer [this message]
2025-04-08 15:11       ` Krzysztof Kozlowski
2025-04-11 15:15       ` Rob Herring
2025-04-14 15:07         ` Sascha Hauer

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=Z_U6fUGbOV2SdO_C@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=alsi@bang-olufsen.dk \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --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.