Re: [PATCH 3/3] dt-bindings: clock: add TI CDCE6214 binding

From: Sascha Hauer
Date: Mon Apr 14 2025 - 11:26:47 EST


On Fri, Apr 11, 2025 at 10:15:52AM -0500, Rob Herring wrote:
> On Tue, Apr 08, 2025 at 05:02:21PM +0200, Sascha Hauer wrote:
> > 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?
>
> If I understand correctly that only 'secref' is possible then you want:
>
> items:
> - enum: [ priref, secref ]
> - const: secref
>
> (By default, entries have to be unique, so that eliminates 'secref' in
> both)

Valid combinations shall be:

- only secref
- only priref
- priref and secref.

Background is: The CDCE6214 has a mux on these inputs, so you can select
one of both in software. In our case only one input is actually used,
but which one it is depends on the board designer. There are likely
usecases in which both inputs are connected to different clocks so you
want to decide during runtime depending on usecase.

> > > 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?
>
> Assuming they are connected to something in DT (if not, why care), you
> could add a flags cell so the consumer side can define what they need.

Let's see if I got that right. Do you mean something like:

cdce6214: clock-generator@67 {
compatible = "ti,cdce6214";
#clock-cells = <2>;
...
};

some-consumer {
clocks = <&cdce6214 4 CDCE6214_SLEW_RATE_MAX | CDCE6214_BIAS(14)>;
};

That would work for the outputs. What about the inputs?

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 |