diff mbox series

[2/3] dt-bindings: clk: cs2000-cp: Document aux-output-source

Message ID 20210517122926.3263455-2-daniel@zonque.org
State Changes Requested, archived
Headers show
Series [1/3] dt-bindings: clock: convert cs2000-cp bindings to yaml | expand

Checks

Context Check Description
robh/checkpatch success
robh/dt-meta-schema success
robh/dtbs-check success

Commit Message

Daniel Mack May 17, 2021, 12:29 p.m. UTC
This new optional property can be used to control the function of the
auxiliary output pin. Introduce a new dt-bindings include file that
contains the numerical values.

Signed-off-by: Daniel Mack <daniel@zonque.org>
---
 .../bindings/clock/cirrus,cs2000-cp.yaml          | 15 ++++++++++++++-
 include/dt-bindings/clock/cirrus,cs2000-cp.h      | 14 ++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 include/dt-bindings/clock/cirrus,cs2000-cp.h

Comments

Rob Herring (Arm) May 19, 2021, 7:03 p.m. UTC | #1
On Mon, May 17, 2021 at 02:29:25PM +0200, Daniel Mack wrote:
> This new optional property can be used to control the function of the
> auxiliary output pin. Introduce a new dt-bindings include file that
> contains the numerical values.
> 
> Signed-off-by: Daniel Mack <daniel@zonque.org>
> ---
>  .../bindings/clock/cirrus,cs2000-cp.yaml          | 15 ++++++++++++++-
>  include/dt-bindings/clock/cirrus,cs2000-cp.h      | 14 ++++++++++++++
>  2 files changed, 28 insertions(+), 1 deletion(-)
>  create mode 100644 include/dt-bindings/clock/cirrus,cs2000-cp.h
> 
> diff --git a/Documentation/devicetree/bindings/clock/cirrus,cs2000-cp.yaml b/Documentation/devicetree/bindings/clock/cirrus,cs2000-cp.yaml
> index 3af81087e5f9..d20ed0aabcb0 100644
> --- a/Documentation/devicetree/bindings/clock/cirrus,cs2000-cp.yaml
> +++ b/Documentation/devicetree/bindings/clock/cirrus,cs2000-cp.yaml
> @@ -38,6 +38,16 @@ properties:
>        The chip select number on the I2C bus
>      maxItems: 1
>  
> +  cirrus,aux-output-source:
> +    description:
> +      Specfies the function of the auxililary clock output pin
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    enum:
> +      - 0 # CS2000CP_AUX_OUTPUT_REF_CLK:  ref_clk input
> +      - 1 # CS2000CP_AUX_OUTPUT_CLK_IN:   clk_in input
> +      - 2 # CS2000CP_AUX_OUTPUT_CLK_OUT:  clk_out output
> +      - 3 # CS2000CP_AUX_OUTPUT_PLL_LOCK: pll lock status
> +
>  required:
>    - compatible
>    - reg
> @@ -45,10 +55,12 @@ required:
>    - clock-names
>    - '#clock-cells'
>  
> -additionalProperties: false
> +additionalProperties: true

No, that's only correct for collections of common properties.

>  
>  examples:
>    - |
> +    #include <dt-bindings/clock/cirrus,cs2000-cp.h>
> +
>      i2c@0 {
>        reg = <0x0 0x100>;
>        #address-cells = <1>;
> @@ -60,5 +72,6 @@ examples:
>          reg = <0x4f>;
>          clocks = <&rcar_sound 0>, <&x12_clk>;
>          clock-names = "clk_in", "ref_clk";
> +        cirrus,aux-output-source = <CS2000CP_AUX_OUTPUT_CLK_OUT>;
>        };
>      };
> diff --git a/include/dt-bindings/clock/cirrus,cs2000-cp.h b/include/dt-bindings/clock/cirrus,cs2000-cp.h
> new file mode 100644
> index 000000000000..b9b13cfc8fbd
> --- /dev/null
> +++ b/include/dt-bindings/clock/cirrus,cs2000-cp.h
> @@ -0,0 +1,14 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */

What about non-GPL users?

> +/*
> + * Copyright (C) 2021 Daniel Mack
> + */
> +
> +#ifndef __DT_BINDINGS_CS2000CP_CLK_H
> +#define __DT_BINDINGS_CS2000CP_CLK_H
> +
> +#define CS2000CP_AUX_OUTPUT_REF_CLK	0
> +#define CS2000CP_AUX_OUTPUT_CLK_IN	1
> +#define CS2000CP_AUX_OUTPUT_CLK_OUT	2
> +#define CS2000CP_AUX_OUTPUT_PLL_LOCK	3
> +
> +#endif /* __DT_BINDINGS_CS2000CP_CLK_H */
> -- 
> 2.31.1
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/clock/cirrus,cs2000-cp.yaml b/Documentation/devicetree/bindings/clock/cirrus,cs2000-cp.yaml
index 3af81087e5f9..d20ed0aabcb0 100644
--- a/Documentation/devicetree/bindings/clock/cirrus,cs2000-cp.yaml
+++ b/Documentation/devicetree/bindings/clock/cirrus,cs2000-cp.yaml
@@ -38,6 +38,16 @@  properties:
       The chip select number on the I2C bus
     maxItems: 1
 
+  cirrus,aux-output-source:
+    description:
+      Specfies the function of the auxililary clock output pin
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum:
+      - 0 # CS2000CP_AUX_OUTPUT_REF_CLK:  ref_clk input
+      - 1 # CS2000CP_AUX_OUTPUT_CLK_IN:   clk_in input
+      - 2 # CS2000CP_AUX_OUTPUT_CLK_OUT:  clk_out output
+      - 3 # CS2000CP_AUX_OUTPUT_PLL_LOCK: pll lock status
+
 required:
   - compatible
   - reg
@@ -45,10 +55,12 @@  required:
   - clock-names
   - '#clock-cells'
 
-additionalProperties: false
+additionalProperties: true
 
 examples:
   - |
+    #include <dt-bindings/clock/cirrus,cs2000-cp.h>
+
     i2c@0 {
       reg = <0x0 0x100>;
       #address-cells = <1>;
@@ -60,5 +72,6 @@  examples:
         reg = <0x4f>;
         clocks = <&rcar_sound 0>, <&x12_clk>;
         clock-names = "clk_in", "ref_clk";
+        cirrus,aux-output-source = <CS2000CP_AUX_OUTPUT_CLK_OUT>;
       };
     };
diff --git a/include/dt-bindings/clock/cirrus,cs2000-cp.h b/include/dt-bindings/clock/cirrus,cs2000-cp.h
new file mode 100644
index 000000000000..b9b13cfc8fbd
--- /dev/null
+++ b/include/dt-bindings/clock/cirrus,cs2000-cp.h
@@ -0,0 +1,14 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (C) 2021 Daniel Mack
+ */
+
+#ifndef __DT_BINDINGS_CS2000CP_CLK_H
+#define __DT_BINDINGS_CS2000CP_CLK_H
+
+#define CS2000CP_AUX_OUTPUT_REF_CLK	0
+#define CS2000CP_AUX_OUTPUT_CLK_IN	1
+#define CS2000CP_AUX_OUTPUT_CLK_OUT	2
+#define CS2000CP_AUX_OUTPUT_PLL_LOCK	3
+
+#endif /* __DT_BINDINGS_CS2000CP_CLK_H */