devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: clock: fixed: Define a preferred node name
@ 2024-04-25 18:38 Rob Herring (Arm)
  2024-04-30  0:11 ` Stephen Boyd
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Herring (Arm) @ 2024-04-25 18:38 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-clk, devicetree, linux-kernel

Define "clock-<freq>" as the preferred node name for fixed-clock and
fixed-factor-clock. There isn't much of an existing pattern for names of
these nodes. The most frequent patterns are a prefix or suffix of "clk",
but there's a bunch that don't follow any sort of pattern. We could use
"clock-controller-.*", but these nodes aren't really a controller in any
way. So let's at least align with part of that and use 'clock-'.

For now this only serves as documentation as the schema still allows
anything to avoid lots of additional warnings for something low priority
to fix. Once a "no deprecated" mode is added to the tools, warnings can
be enabled selectively.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
 Documentation/devicetree/bindings/clock/fixed-clock.yaml  | 7 +++++++
 .../devicetree/bindings/clock/fixed-factor-clock.yaml     | 8 ++++++++
 2 files changed, 15 insertions(+)

diff --git a/Documentation/devicetree/bindings/clock/fixed-clock.yaml b/Documentation/devicetree/bindings/clock/fixed-clock.yaml
index b0a4fb8256e2..d287bd092054 100644
--- a/Documentation/devicetree/bindings/clock/fixed-clock.yaml
+++ b/Documentation/devicetree/bindings/clock/fixed-clock.yaml
@@ -11,6 +11,13 @@ maintainers:
   - Stephen Boyd <sboyd@kernel.org>
 
 properties:
+  $nodename:
+    anyOf:
+      - description: Preferred name is 'clock-<freq>'
+        pattern: "^clock-([0-9]+|[a-z0-9-]+)$"
+      - description: Any name allowed
+        deprecated: true
+
   compatible:
     const: fixed-clock
 
diff --git a/Documentation/devicetree/bindings/clock/fixed-factor-clock.yaml b/Documentation/devicetree/bindings/clock/fixed-factor-clock.yaml
index 8f71ab300470..962a1fe85416 100644
--- a/Documentation/devicetree/bindings/clock/fixed-factor-clock.yaml
+++ b/Documentation/devicetree/bindings/clock/fixed-factor-clock.yaml
@@ -11,6 +11,14 @@ maintainers:
   - Stephen Boyd <sboyd@kernel.org>
 
 properties:
+  $nodename:
+    anyOf:
+      - description:
+          Preferred name is 'clock-<freq>' if the input frequency is fixed
+        pattern: "^clock-([0-9]+|[0-9a-z-]+)$"
+      - description: Any name allowed
+        deprecated: true
+
   compatible:
     enum:
       - fixed-factor-clock
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] dt-bindings: clock: fixed: Define a preferred node name
  2024-04-25 18:38 [PATCH] dt-bindings: clock: fixed: Define a preferred node name Rob Herring (Arm)
@ 2024-04-30  0:11 ` Stephen Boyd
  2024-04-30 12:33   ` Rob Herring
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Boyd @ 2024-04-30  0:11 UTC (permalink / raw)
  To: Conor Dooley, Krzysztof Kozlowski, Michael Turquette, Rob Herring
  Cc: linux-clk, devicetree, linux-kernel

Quoting Rob Herring (Arm) (2024-04-25 11:38:09)
> diff --git a/Documentation/devicetree/bindings/clock/fixed-clock.yaml b/Documentation/devicetree/bindings/clock/fixed-clock.yaml
> index b0a4fb8256e2..d287bd092054 100644
> --- a/Documentation/devicetree/bindings/clock/fixed-clock.yaml
> +++ b/Documentation/devicetree/bindings/clock/fixed-clock.yaml
> @@ -11,6 +11,13 @@ maintainers:
>    - Stephen Boyd <sboyd@kernel.org>
>  
>  properties:
> +  $nodename:
> +    anyOf:
> +      - description: Preferred name is 'clock-<freq>'

Is the preferred value of <freq> the clock-frequency property? Should
say that explicitly somehow so that it's clear.

> +        pattern: "^clock-([0-9]+|[a-z0-9-]+)$"
> +      - description: Any name allowed
> +        deprecated: true
> +
>    compatible:
>      const: fixed-clock
>  
> diff --git a/Documentation/devicetree/bindings/clock/fixed-factor-clock.yaml b/Documentation/devicetree/bindings/clock/fixed-factor-clock.yaml
> index 8f71ab300470..962a1fe85416 100644
> --- a/Documentation/devicetree/bindings/clock/fixed-factor-clock.yaml
> +++ b/Documentation/devicetree/bindings/clock/fixed-factor-clock.yaml
> @@ -11,6 +11,14 @@ maintainers:
>    - Stephen Boyd <sboyd@kernel.org>
>  
>  properties:
> +  $nodename:
> +    anyOf:
> +      - description:
> +          Preferred name is 'clock-<freq>' if the input frequency is fixed

Similar question here. Is <freq> supposed to be the output clock frequency?

> +        pattern: "^clock-([0-9]+|[0-9a-z-]+)$"
> +      - description: Any name allowed
> +        deprecated: true

I hope that deprecating this doesn't cause folks to try to clean things
up and then break code that's depending on the node name to be the name
of the clk. We don't want that string name to be important but it is
sometimes.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dt-bindings: clock: fixed: Define a preferred node name
  2024-04-30  0:11 ` Stephen Boyd
@ 2024-04-30 12:33   ` Rob Herring
  0 siblings, 0 replies; 3+ messages in thread
From: Rob Herring @ 2024-04-30 12:33 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Conor Dooley, Krzysztof Kozlowski, Michael Turquette, linux-clk,
	devicetree, linux-kernel

On Mon, Apr 29, 2024 at 7:11 PM Stephen Boyd <sboyd@kernel.org> wrote:
>
> Quoting Rob Herring (Arm) (2024-04-25 11:38:09)
> > diff --git a/Documentation/devicetree/bindings/clock/fixed-clock.yaml b/Documentation/devicetree/bindings/clock/fixed-clock.yaml
> > index b0a4fb8256e2..d287bd092054 100644
> > --- a/Documentation/devicetree/bindings/clock/fixed-clock.yaml
> > +++ b/Documentation/devicetree/bindings/clock/fixed-clock.yaml
> > @@ -11,6 +11,13 @@ maintainers:
> >    - Stephen Boyd <sboyd@kernel.org>
> >
> >  properties:
> > +  $nodename:
> > +    anyOf:
> > +      - description: Preferred name is 'clock-<freq>'
>
> Is the preferred value of <freq> the clock-frequency property? Should
> say that explicitly somehow so that it's clear.

Yes, will add.

> > +        pattern: "^clock-([0-9]+|[a-z0-9-]+)$"
> > +      - description: Any name allowed
> > +        deprecated: true
> > +
> >    compatible:
> >      const: fixed-clock
> >
> > diff --git a/Documentation/devicetree/bindings/clock/fixed-factor-clock.yaml b/Documentation/devicetree/bindings/clock/fixed-factor-clock.yaml
> > index 8f71ab300470..962a1fe85416 100644
> > --- a/Documentation/devicetree/bindings/clock/fixed-factor-clock.yaml
> > +++ b/Documentation/devicetree/bindings/clock/fixed-factor-clock.yaml
> > @@ -11,6 +11,14 @@ maintainers:
> >    - Stephen Boyd <sboyd@kernel.org>
> >
> >  properties:
> > +  $nodename:
> > +    anyOf:
> > +      - description:
> > +          Preferred name is 'clock-<freq>' if the input frequency is fixed
>
> Similar question here. Is <freq> supposed to be the output clock frequency?

Yes.

>
> > +        pattern: "^clock-([0-9]+|[0-9a-z-]+)$"
> > +      - description: Any name allowed
> > +        deprecated: true
>
> I hope that deprecating this doesn't cause folks to try to clean things
> up and then break code that's depending on the node name to be the name
> of the clk. We don't want that string name to be important but it is
> sometimes.

Right. Leaving things as-is is the intent. We won't be enabling any
"no deprecated" mode by default when it is added.


Rob

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-30 12:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-25 18:38 [PATCH] dt-bindings: clock: fixed: Define a preferred node name Rob Herring (Arm)
2024-04-30  0:11 ` Stephen Boyd
2024-04-30 12:33   ` Rob Herring

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).