Documentation / devicetree / bindings / soundwire / qcom,soundwire.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 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/soundwire/qcom,soundwire.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm SoundWire Controller

maintainers:
  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
  - Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>

description:
  The Qualcomm SoundWire controller along with its board specific bus parameters.

properties:
  compatible:
    enum:
      - qcom,soundwire-v1.3.0
      - qcom,soundwire-v1.5.0
      - qcom,soundwire-v1.5.1
      - qcom,soundwire-v1.6.0
      - qcom,soundwire-v1.7.0
      - qcom,soundwire-v2.0.0

  reg:
    maxItems: 1

  interrupts:
    minItems: 1
    items:
      - description: specify the SoundWire controller core.
      - description: specify the Soundwire controller wake IRQ.

  interrupt-names:
    minItems: 1
    items:
      - const: core
      - const: wakeup

  clocks:
    items:
      - description: iface clock

  clock-names:
    items:
      - const: iface

  resets:
    items:
      - description: SWR_AUDIO_CGCR RESET

  reset-names:
    items:
      - const: swr_audio_cgcr
 
  '#sound-dai-cells':
    const: 1
 
  '#address-cells':
    const: 2
 
  '#size-cells':
    const: 0

  wakeup-source: true

  qcom,din-ports:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: count of data in ports

  qcom,dout-ports:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: count of data out ports

  qcom,ports-word-length:
    $ref: /schemas/types.yaml#/definitions/uint8-array
    description:
      Size of payload channel sample.
      Value of 0xff indicates that this option is not implemented
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 16

  qcom,ports-sinterval-low:
    $ref: /schemas/types.yaml#/definitions/uint8-array
    description:
      Sample interval (only lowest byte) of each data port.
      Out ports followed by In ports. Used for Sample Interval calculation.
      Value of 0xff indicates that this option is not implemented
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 16

  qcom,ports-sinterval:
    $ref: /schemas/types.yaml#/definitions/uint16-array
    description:
      Sample interval of each data port.
      Out ports followed by In ports. Used for Sample Interval calculation.
      Value of 0xffff indicates that this option is not implemented
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 16

  qcom,ports-offset1:
    $ref: /schemas/types.yaml#/definitions/uint8-array
    description:
      Payload transport window offset1 of each data port.
      Out ports followed by In ports.
      Value of 0xff indicates that this option is not implemented
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 16

  qcom,ports-offset2:
    $ref: /schemas/types.yaml#/definitions/uint8-array
    description:
      Payload transport window offset2 of each data port.
      Out ports followed by In ports.
      Value of 0xff indicates that this option is not implemented
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 16

  qcom,ports-lane-control:
    $ref: /schemas/types.yaml#/definitions/uint8-array
    description:
      Identify which data lane the data port uses.
      Out ports followed by In ports.
      Value of 0xff indicates that this option is not implemented
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 16

  qcom,ports-block-pack-mode:
    $ref: /schemas/types.yaml#/definitions/uint8-array
    description:
      Indicate the block packing mode.
      0 to indicate Blocks are per Channel
      1 to indicate Blocks are per Port.
      Out ports followed by In ports.
      Value of 0xff indicates that this option is not implemented
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 16
    items:
      oneOf:
        - minimum: 0
          maximum: 1
        - const: 0xff

  qcom,ports-hstart:
    $ref: /schemas/types.yaml#/definitions/uint8-array
    description:
      Identifying lowerst numbered column in SoundWire Frame,
      i.e. left edge of the Transport sub-frame for each port.
      Out ports followed by In ports.
      Value of 0xff indicates that this option is not implemented
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 16
    items:
      oneOf:
        - minimum: 0
          maximum: 15
        - const: 0xff

  qcom,ports-hstop:
    $ref: /schemas/types.yaml#/definitions/uint8-array
    description:
      Identifying highest numbered column in SoundWire Frame,
      i.e. the right edge of the Transport
      sub-frame for each port. Out ports followed by In ports.
      Value of 0xff indicates that this option is not implemented
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 16
    items:
      oneOf:
        - minimum: 0
          maximum: 15
        - const: 0xff

  qcom,ports-block-group-count:
    $ref: /schemas/types.yaml#/definitions/uint8-array
    description:
      In range 1 to 4 to indicate how many sample intervals are combined
      into a payload. Out ports followed by In ports.
      Value of 0xff indicates that this option is not implemented
      or applicable for the respective data port.
      More info in MIPI Alliance SoundWire 1.0 Specifications.
    minItems: 3
    maxItems: 16
    items:
      oneOf:
        - minimum: 0
          maximum: 4
        - const: 0xff

  label:
    maxItems: 1

required:
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names
  - '#sound-dai-cells'
  - '#address-cells'
  - '#size-cells'
  - qcom,dout-ports
  - qcom,din-ports
  - qcom,ports-offset1
  - qcom,ports-offset2

oneOf:
  - required:
      - qcom,ports-sinterval-low
  - required:
      - qcom,ports-sinterval

allOf:
  - $ref: soundwire-controller.yaml#

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    #include <dt-bindings/clock/qcom,lpassaudiocc-sc7280.h>
 
    soundwire@3210000 {
        compatible = "qcom,soundwire-v1.6.0";
        reg = <0x03210000 0x2000>;
 
        interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>,
                     <&pdc 130 IRQ_TYPE_LEVEL_HIGH>;
 
        interrupt-names = "core", "wakeup";
 
        clocks = <&lpass_rx_macro>;
        clock-names = "iface";
 
        qcom,din-ports = <0>;
        qcom,dout-ports = <5>;
 
        resets = <&lpass_audiocc LPASS_AUDIO_SWR_RX_CGCR>;
        reset-names = "swr_audio_cgcr";
 
        qcom,ports-word-length =        /bits/ 8 <0x01 0x07 0x04 0xff 0xff>;
        qcom,ports-sinterval-low =      /bits/ 8 <0x03 0x3f 0x1f 0x03 0x03>;
        qcom,ports-offset1 =            /bits/ 8 <0x00 0x00 0x0b 0x01 0x01>;
        qcom,ports-offset2 =            /bits/ 8 <0x00 0x00 0x0b 0x00 0x00>;
        qcom,ports-lane-control =       /bits/ 8 <0x01 0x00 0x00 0x00 0x00>;
        qcom,ports-block-pack-mode =    /bits/ 8 <0xff 0x00 0x01 0xff 0xff>;
        qcom,ports-hstart =             /bits/ 8 <0xff 0x03 0xff 0xff 0xff>;
        qcom,ports-hstop =              /bits/ 8 <0xff 0x06 0xff 0xff 0xff>;
        qcom,ports-block-group-count =  /bits/ 8 <0xff 0xff 0xff 0xff 0x00>;
 
        #sound-dai-cells = <1>;
        #address-cells = <2>;
        #size-cells = <0>;
 
        codec@0,4 {
            compatible = "sdw20217010d00";
            reg = <0 4>;
            qcom,rx-port-mapping = <1 2 3 4 5>;
        };
    };