Documentation / devicetree / bindings / clock / idt,versaclock5.yaml


Based on kernel version 6.11. Page generated on 2024-09-24 08:21 EST.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/idt,versaclock5.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: IDT VersaClock 5 and 6 programmable I2C clock generators

description: |
  The IDT VersaClock 5 and VersaClock 6 are programmable I2C
  clock generators providing from 3 to 12 output clocks.
 
  When referencing the provided clock in the DT using phandle and clock
  specifier, the following mapping applies:
 
  - 5P49V5923:
    0 -- OUT0_SEL_I2CB
    1 -- OUT1
    2 -- OUT2
 
  - 5P49V5933:
    0 -- OUT0_SEL_I2CB
    1 -- OUT1
    2 -- OUT4
 
  - other parts:
    0 -- OUT0_SEL_I2CB
    1 -- OUT1
    2 -- OUT2
    3 -- OUT3
    4 -- OUT4
 
  The idt,shutdown and idt,output-enable-active properties control the
  SH (en_global_shutdown) and SP bits of the Primary Source and Shutdown
  Register, respectively. Their behavior is summarized by the following
  table:
 
  SH SP Output when the SD/OE pin is Low/High
  == == =====================================
   0  0 Active/Inactive
   0  1 Inactive/Active
   1  0 Active/Shutdown
   1  1 Inactive/Shutdown
 
  The case where SH and SP are both 1 is likely not very interesting.

maintainers:
  - Luca Ceresoli <luca.ceresoli@bootlin.com>

properties:
  compatible:
    enum:
      - idt,5p49v5923
      - idt,5p49v5925
      - idt,5p49v5933
      - idt,5p49v5935
      - idt,5p49v60
      - idt,5p49v6901
      - idt,5p49v6965
      - idt,5p49v6975

  reg:
    description: I2C device address
    enum: [ 0x68, 0x6a ]
 
  '#clock-cells':
    const: 1

  clock-names:
    minItems: 1
    maxItems: 2
    items:
      enum: [ xin, clkin ]
  clocks:
    minItems: 1
    maxItems: 2

  idt,xtal-load-femtofarads:
    minimum: 9000
    maximum: 22760
    description: Optional load capacitor for XTAL1 and XTAL2

  idt,shutdown:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1]
    description: |
      If 1, this enables the shutdown functionality: the chip will be
      shut down if the SD/OE pin is driven high. If 0, this disables the
      shutdown functionality: the chip will never be shut down based on
      the value of the SD/OE pin. This property corresponds to the SH
      bit of the Primary Source and Shutdown Register.

  idt,output-enable-active:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1]
    description: |
      If 1, this enables output when the SD/OE pin is high, and disables
      output when the SD/OE pin is low. If 0, this disables output when
      the SD/OE pin is high, and enables output when the SD/OE pin is
      low. This corresponds to the SP bit of the Primary Source and
      Shutdown Register.

patternProperties:
  "^OUT[1-4]$":
    type: object
    description:
      Description of one of the outputs (OUT1..OUT4). See "Clock1 Output
      Configuration" in the Versaclock 5/6/6E Family Register Description
      and Programming Guide.
    properties:
      idt,mode:
        description:
          The output drive mode. Values defined in dt-bindings/clock/versaclock.h
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 6
      idt,voltage-microvolt:
        description: The output drive voltage.
        enum: [ 1800000, 2500000, 3300000 ]
      idt,slew-percent:
        description: The Slew rate control for CMOS single-ended.
        enum: [ 80, 85, 90, 100 ]
    additionalProperties: false

required:
  - compatible
  - reg
  - '#clock-cells'
  - idt,shutdown
  - idt,output-enable-active

allOf:
  - if:
      properties:
        compatible:
          enum:
            - idt,5p49v5933
            - idt,5p49v5935
            - idt,5p49v6975
    then:
      # Devices with builtin crystal + optional external input
      properties:
        clock-names:
          const: clkin
        clocks:
          maxItems: 1
    else:
      # Devices without builtin crystal
      required:
        - clock-names
        - clocks

additionalProperties: false

examples:
  - |
    #include <dt-bindings/clock/versaclock.h>
 
    /* 25MHz reference crystal */
    ref25: ref25m {
        compatible = "fixed-clock";
        #clock-cells = <0>;
        clock-frequency = <25000000>;
    };
 
    i2c@0 {
        reg = <0x0 0x100>;
        #address-cells = <1>;
        #size-cells = <0>;
 
        /* IDT 5P49V5923 I2C clock generator */
        vc5: clock-generator@6a {
            compatible = "idt,5p49v5923";
            reg = <0x6a>;
            #clock-cells = <1>;
 
            /* Connect XIN input to 25MHz reference */
            clocks = <&ref25m>;
            clock-names = "xin";
 
            /* Set the SD/OE pin's settings */
            idt,shutdown = <0>;
            idt,output-enable-active = <0>;
 
            OUT1 {
                idt,mode = <VC5_CMOSD>;
                idt,voltage-microvolt = <1800000>;
                idt,slew-percent = <80>;
            };
 
            OUT4 {
                idt,mode = <VC5_LVDS>;
            };
        };
    };

...