Skip to contentSkip to conversation

dt-bindings: clock: ti: Convert mux.txt to json-schema

PATCH Superseded Andreas Kemnade 2 participants 2 messages Nov 8, 2024 – Nov 11, 2024

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dt-bindings: clock: ti: Convert mux.txt to json-schema

Convert the OMAP mux clock device tree binding to json-schema. Specify the creator of the original binding as a maintainer. Choose GPL-only license because original binding was also GPL.

---
Changes in V2:
- some orthography fixes
- fix addresses in example
- no prose for defaults
- constraints for latch-bit

 .../bindings/clock/ti/composite.txt           |   2 +-
 .../devicetree/bindings/clock/ti/mux.txt      |  78 -----------
 .../bindings/clock/ti/ti,mux-clock.yaml       | 125 ++++++++++++++++++
 3 files changed, 126 insertions(+), 79 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/clock/ti/mux.txt
 create mode 100644 Documentation/devicetree/bindings/clock/ti/ti,mux-clock.yaml
Documentation/devicetree/bindings/clock/ti/composite.txt +1 -1
index b02f22490dcb..238e6f7d74f8 100644
@@ -16,7 +16,7 @@ merged to this clock. The component clocks shall be of one of the
 "ti,*composite*-clock" types.
 
 [1] Documentation/devicetree/bindings/clock/clock-bindings.txt
-[2] Documentation/devicetree/bindings/clock/ti/mux.txt
+[2] Documentation/devicetree/bindings/clock/ti/ti,mux-clock.yaml
 [3] Documentation/devicetree/bindings/clock/ti/ti,divider-clock.yaml
 [4] Documentation/devicetree/bindings/clock/ti/gate.txt
 
Documentation/devicetree/bindings/clock/ti/mux.txt deleted +0 -78

78 lines not on this page · raw message

Documentation/devicetree/bindings/clock/ti/ti,mux-clock.yaml new file +125 -0

125 lines not on this page · raw message

Signature · 1 line
2.39.5
Reviewed-by on v2 1/1
#1 lore raw
Quoted 27 lines · Andreas Kemnade
Documentation/devicetree/bindings/clock/ti/ti,mux-clock.yaml new file +21 -0
new file mode 100644
index 000000000000..4a6f349ba2b0
@@ -0,0 +1,125 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/ti/ti,mux-clock.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments mux clock
+
+maintainers:
+  - Tero Kristo <[email protected]>
+
+description: |
+  This clock assumes a register-mapped multiplexer with multiple inpt clock
+  signals or parents, one of which can be selected as output. This clock does
+  not gate or adjust the parent rate via a divider or multiplier.
+
+  By default the "clocks" property lists the parents in the same order
+  as they are programmed into the register.  E.g:
+
+    clocks = <&foo_clock>, <&bar_clock>, <&baz_clock>;
+

Documentation/devicetree/bindings/clock/ti/ti,mux-clock.yaml line 31

Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/ti,mux-clock.yaml new file +10 -0
+  Results in programming the register as follows:
+
+  register value   selected parent clock
+  0                foo_clock
+  1                bar_clock
+  2                baz_clock
+
+  Some clock controller IPs do not allow a value of zero to be programmed
+  into the register, instead indexing begins at 1.  The optional property
+  "index-starts-at-one" modified the scheme as follows:

Not your doing, but this is a crock. How is someone meant to know when to use the property or not? Par for the course for ancient bindings I guess..

Quoted 20 lines
Documentation/devicetree/bindings/clock/ti/ti,mux-clock.yaml new file +20 -0
+
+  register value   selected clock parent
+  1                foo_clock
+  2                bar_clock
+  3                baz_clock
+
+  The binding must provide the register to control the mux. Optionally
+  the number of bits to shift the control field in the register can be
+  supplied. If the shift value is missing it is the same as supplying
+  a zero shift.
+  - |
+    bus {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      clock-controller@110 {
+        #clock-cells = <0>;
+        compatible = "ti,mux-clock";
+        clocks = <&virt_12000000_ck>, <&virt_13000000_ck>, <&virt_16800000_ck>;
+        reg = <0x0110>;

Documentation/devicetree/bindings/clock/ti/ti,mux-clock.yaml line 123

Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/ti,mux-clock.yaml new file +10 -0
+        ti,index-starts-at-one;
+        ti,set-rate-parent;
+      };
+
+      clock-controller@120 {
+        #clock-cells = <0>;
+        compatible = "ti,composite-mux-clock";
+        clocks = <&core_96m_fck>, <&mcbsp_clks>;
+        ti,bit-shift = <4>;
+        reg = <0x0120>;

Ordering here should be compatible, reg, clock properties, vendor properties.

With that,

Cheers,
Conor.

Quoted 5 lines
Documentation/devicetree/bindings/clock/ti/ti,mux-clock.yaml new file +2 -0
+      };
+    };
Signature · 1 line
2.39.5