xref: /freebsd/sys/contrib/device-tree/Bindings/soundwire/qcom,soundwire.yaml (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
18bab661aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
28bab661aSEmmanuel Vadot%YAML 1.2
38bab661aSEmmanuel Vadot---
48bab661aSEmmanuel Vadot$id: http://devicetree.org/schemas/soundwire/qcom,soundwire.yaml#
58bab661aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
68bab661aSEmmanuel Vadot
78bab661aSEmmanuel Vadottitle: Qualcomm SoundWire Controller
88bab661aSEmmanuel Vadot
98bab661aSEmmanuel Vadotmaintainers:
108bab661aSEmmanuel Vadot  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
118bab661aSEmmanuel Vadot  - Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
128bab661aSEmmanuel Vadot
138bab661aSEmmanuel Vadotdescription:
148bab661aSEmmanuel Vadot  The Qualcomm SoundWire controller along with its board specific bus parameters.
158bab661aSEmmanuel Vadot
168bab661aSEmmanuel Vadotproperties:
178bab661aSEmmanuel Vadot  compatible:
188bab661aSEmmanuel Vadot    enum:
198bab661aSEmmanuel Vadot      - qcom,soundwire-v1.3.0
208bab661aSEmmanuel Vadot      - qcom,soundwire-v1.5.0
218bab661aSEmmanuel Vadot      - qcom,soundwire-v1.5.1
228bab661aSEmmanuel Vadot      - qcom,soundwire-v1.6.0
238bab661aSEmmanuel Vadot      - qcom,soundwire-v1.7.0
24*f126890aSEmmanuel Vadot      - qcom,soundwire-v2.0.0
258bab661aSEmmanuel Vadot
268bab661aSEmmanuel Vadot  reg:
278bab661aSEmmanuel Vadot    maxItems: 1
288bab661aSEmmanuel Vadot
298bab661aSEmmanuel Vadot  interrupts:
308bab661aSEmmanuel Vadot    minItems: 1
318bab661aSEmmanuel Vadot    items:
328bab661aSEmmanuel Vadot      - description: specify the SoundWire controller core.
338bab661aSEmmanuel Vadot      - description: specify the Soundwire controller wake IRQ.
348bab661aSEmmanuel Vadot
358bab661aSEmmanuel Vadot  interrupt-names:
368bab661aSEmmanuel Vadot    minItems: 1
378bab661aSEmmanuel Vadot    items:
388bab661aSEmmanuel Vadot      - const: core
398bab661aSEmmanuel Vadot      - const: wakeup
408bab661aSEmmanuel Vadot
418bab661aSEmmanuel Vadot  clocks:
428bab661aSEmmanuel Vadot    items:
438bab661aSEmmanuel Vadot      - description: iface clock
448bab661aSEmmanuel Vadot
458bab661aSEmmanuel Vadot  clock-names:
468bab661aSEmmanuel Vadot    items:
478bab661aSEmmanuel Vadot      - const: iface
488bab661aSEmmanuel Vadot
498bab661aSEmmanuel Vadot  resets:
508bab661aSEmmanuel Vadot    items:
518bab661aSEmmanuel Vadot      - description: SWR_AUDIO_CGCR RESET
528bab661aSEmmanuel Vadot
538bab661aSEmmanuel Vadot  reset-names:
548bab661aSEmmanuel Vadot    items:
558bab661aSEmmanuel Vadot      - const: swr_audio_cgcr
568bab661aSEmmanuel Vadot
578bab661aSEmmanuel Vadot  '#sound-dai-cells':
588bab661aSEmmanuel Vadot    const: 1
598bab661aSEmmanuel Vadot
608bab661aSEmmanuel Vadot  '#address-cells':
618bab661aSEmmanuel Vadot    const: 2
628bab661aSEmmanuel Vadot
638bab661aSEmmanuel Vadot  '#size-cells':
648bab661aSEmmanuel Vadot    const: 0
658bab661aSEmmanuel Vadot
668bab661aSEmmanuel Vadot  wakeup-source: true
678bab661aSEmmanuel Vadot
688bab661aSEmmanuel Vadot  qcom,din-ports:
698bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
708bab661aSEmmanuel Vadot    description: count of data in ports
718bab661aSEmmanuel Vadot
728bab661aSEmmanuel Vadot  qcom,dout-ports:
738bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
748bab661aSEmmanuel Vadot    description: count of data out ports
758bab661aSEmmanuel Vadot
768bab661aSEmmanuel Vadot  qcom,ports-word-length:
778bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
788bab661aSEmmanuel Vadot    description:
798bab661aSEmmanuel Vadot      Size of payload channel sample.
808bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
818bab661aSEmmanuel Vadot      or applicable for the respective data port.
828bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
838bab661aSEmmanuel Vadot    minItems: 3
84*f126890aSEmmanuel Vadot    maxItems: 16
858bab661aSEmmanuel Vadot
868bab661aSEmmanuel Vadot  qcom,ports-sinterval-low:
878bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
888bab661aSEmmanuel Vadot    description:
89*f126890aSEmmanuel Vadot      Sample interval (only lowest byte) of each data port.
908bab661aSEmmanuel Vadot      Out ports followed by In ports. Used for Sample Interval calculation.
918bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
928bab661aSEmmanuel Vadot      or applicable for the respective data port.
938bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
948bab661aSEmmanuel Vadot    minItems: 3
95*f126890aSEmmanuel Vadot    maxItems: 16
96*f126890aSEmmanuel Vadot
97*f126890aSEmmanuel Vadot  qcom,ports-sinterval:
98*f126890aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint16-array
99*f126890aSEmmanuel Vadot    description:
100*f126890aSEmmanuel Vadot      Sample interval of each data port.
101*f126890aSEmmanuel Vadot      Out ports followed by In ports. Used for Sample Interval calculation.
102*f126890aSEmmanuel Vadot      Value of 0xffff indicates that this option is not implemented
103*f126890aSEmmanuel Vadot      or applicable for the respective data port.
104*f126890aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
105*f126890aSEmmanuel Vadot    minItems: 3
106*f126890aSEmmanuel Vadot    maxItems: 16
1078bab661aSEmmanuel Vadot
1088bab661aSEmmanuel Vadot  qcom,ports-offset1:
1098bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
1108bab661aSEmmanuel Vadot    description:
1118bab661aSEmmanuel Vadot      Payload transport window offset1 of each data port.
1128bab661aSEmmanuel Vadot      Out ports followed by In ports.
1138bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
1148bab661aSEmmanuel Vadot      or applicable for the respective data port.
1158bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
1168bab661aSEmmanuel Vadot    minItems: 3
117*f126890aSEmmanuel Vadot    maxItems: 16
1188bab661aSEmmanuel Vadot
1198bab661aSEmmanuel Vadot  qcom,ports-offset2:
1208bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
1218bab661aSEmmanuel Vadot    description:
1228bab661aSEmmanuel Vadot      Payload transport window offset2 of each data port.
1238bab661aSEmmanuel Vadot      Out ports followed by In ports.
1248bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
1258bab661aSEmmanuel Vadot      or applicable for the respective data port.
1268bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
1278bab661aSEmmanuel Vadot    minItems: 3
128*f126890aSEmmanuel Vadot    maxItems: 16
1298bab661aSEmmanuel Vadot
1308bab661aSEmmanuel Vadot  qcom,ports-lane-control:
1318bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
1328bab661aSEmmanuel Vadot    description:
1338bab661aSEmmanuel Vadot      Identify which data lane the data port uses.
1348bab661aSEmmanuel Vadot      Out ports followed by In ports.
1358bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
1368bab661aSEmmanuel Vadot      or applicable for the respective data port.
1378bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
1388bab661aSEmmanuel Vadot    minItems: 3
139*f126890aSEmmanuel Vadot    maxItems: 16
1408bab661aSEmmanuel Vadot
1418bab661aSEmmanuel Vadot  qcom,ports-block-pack-mode:
1428bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
1438bab661aSEmmanuel Vadot    description:
1448bab661aSEmmanuel Vadot      Indicate the block packing mode.
1458bab661aSEmmanuel Vadot      0 to indicate Blocks are per Channel
1468bab661aSEmmanuel Vadot      1 to indicate Blocks are per Port.
1478bab661aSEmmanuel Vadot      Out ports followed by In ports.
1488bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
1498bab661aSEmmanuel Vadot      or applicable for the respective data port.
1508bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
1518bab661aSEmmanuel Vadot    minItems: 3
152*f126890aSEmmanuel Vadot    maxItems: 16
1538bab661aSEmmanuel Vadot    items:
1548bab661aSEmmanuel Vadot      oneOf:
1558bab661aSEmmanuel Vadot        - minimum: 0
1568bab661aSEmmanuel Vadot          maximum: 1
1578bab661aSEmmanuel Vadot        - const: 0xff
1588bab661aSEmmanuel Vadot
1598bab661aSEmmanuel Vadot  qcom,ports-hstart:
1608bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
1618bab661aSEmmanuel Vadot    description:
1628bab661aSEmmanuel Vadot      Identifying lowerst numbered coloum in SoundWire Frame,
1638bab661aSEmmanuel Vadot      i.e. left edge of the Transport sub-frame for each port.
1648bab661aSEmmanuel Vadot      Out ports followed by In ports.
1658bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
1668bab661aSEmmanuel Vadot      or applicable for the respective data port.
1678bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
1688bab661aSEmmanuel Vadot    minItems: 3
169*f126890aSEmmanuel Vadot    maxItems: 16
1708bab661aSEmmanuel Vadot    items:
1718bab661aSEmmanuel Vadot      oneOf:
1728bab661aSEmmanuel Vadot        - minimum: 0
1738bab661aSEmmanuel Vadot          maximum: 15
1748bab661aSEmmanuel Vadot        - const: 0xff
1758bab661aSEmmanuel Vadot
1768bab661aSEmmanuel Vadot  qcom,ports-hstop:
1778bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
1788bab661aSEmmanuel Vadot    description:
1798bab661aSEmmanuel Vadot      Identifying highest numbered coloum in SoundWire Frame,
1808bab661aSEmmanuel Vadot      i.e. the right edge of the Transport
1818bab661aSEmmanuel Vadot      sub-frame for each port. Out ports followed by In ports.
1828bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
1838bab661aSEmmanuel Vadot      or applicable for the respective data port.
1848bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
1858bab661aSEmmanuel Vadot    minItems: 3
186*f126890aSEmmanuel Vadot    maxItems: 16
1878bab661aSEmmanuel Vadot    items:
1888bab661aSEmmanuel Vadot      oneOf:
1898bab661aSEmmanuel Vadot        - minimum: 0
1908bab661aSEmmanuel Vadot          maximum: 15
1918bab661aSEmmanuel Vadot        - const: 0xff
1928bab661aSEmmanuel Vadot
1938bab661aSEmmanuel Vadot  qcom,ports-block-group-count:
1948bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
1958bab661aSEmmanuel Vadot    description:
1968bab661aSEmmanuel Vadot      In range 1 to 4 to indicate how many sample intervals are combined
1978bab661aSEmmanuel Vadot      into a payload. Out ports followed by In ports.
1988bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
1998bab661aSEmmanuel Vadot      or applicable for the respective data port.
2008bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
2018bab661aSEmmanuel Vadot    minItems: 3
202*f126890aSEmmanuel Vadot    maxItems: 16
2038bab661aSEmmanuel Vadot    items:
2048bab661aSEmmanuel Vadot      oneOf:
2058bab661aSEmmanuel Vadot        - minimum: 0
2068bab661aSEmmanuel Vadot          maximum: 4
2078bab661aSEmmanuel Vadot        - const: 0xff
2088bab661aSEmmanuel Vadot
2098bab661aSEmmanuel Vadot  label:
2108bab661aSEmmanuel Vadot    maxItems: 1
2118bab661aSEmmanuel Vadot
2128bab661aSEmmanuel VadotpatternProperties:
2138bab661aSEmmanuel Vadot  "^.*@[0-9a-f],[0-9a-f]$":
2148bab661aSEmmanuel Vadot    type: object
215fac71e4eSEmmanuel Vadot    additionalProperties: true
2168bab661aSEmmanuel Vadot    description:
2178bab661aSEmmanuel Vadot      Child nodes for a standalone audio codec or speaker amplifier IC.
2188bab661aSEmmanuel Vadot      It has RX and TX Soundwire secondary devices.
2198bab661aSEmmanuel Vadot    properties:
2208bab661aSEmmanuel Vadot      compatible:
2218bab661aSEmmanuel Vadot        pattern: "^sdw[0-9a-f]{1}[0-9a-f]{4}[0-9a-f]{4}[0-9a-f]{2}$"
2228bab661aSEmmanuel Vadot
2238bab661aSEmmanuel Vadotrequired:
2248bab661aSEmmanuel Vadot  - compatible
2258bab661aSEmmanuel Vadot  - reg
2268bab661aSEmmanuel Vadot  - interrupts
2278bab661aSEmmanuel Vadot  - clocks
2288bab661aSEmmanuel Vadot  - clock-names
2298bab661aSEmmanuel Vadot  - '#sound-dai-cells'
2308bab661aSEmmanuel Vadot  - '#address-cells'
2318bab661aSEmmanuel Vadot  - '#size-cells'
2328bab661aSEmmanuel Vadot  - qcom,dout-ports
2338bab661aSEmmanuel Vadot  - qcom,din-ports
2348bab661aSEmmanuel Vadot  - qcom,ports-offset1
2358bab661aSEmmanuel Vadot  - qcom,ports-offset2
2368bab661aSEmmanuel Vadot
237*f126890aSEmmanuel VadotoneOf:
238*f126890aSEmmanuel Vadot  - required:
239*f126890aSEmmanuel Vadot      - qcom,ports-sinterval-low
240*f126890aSEmmanuel Vadot  - required:
241*f126890aSEmmanuel Vadot      - qcom,ports-sinterval
242*f126890aSEmmanuel Vadot
2438bab661aSEmmanuel VadotadditionalProperties: false
2448bab661aSEmmanuel Vadot
2458bab661aSEmmanuel Vadotexamples:
2468bab661aSEmmanuel Vadot  - |
2478bab661aSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
2488bab661aSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
2498bab661aSEmmanuel Vadot    #include <dt-bindings/clock/qcom,lpassaudiocc-sc7280.h>
2508bab661aSEmmanuel Vadot
2518bab661aSEmmanuel Vadot    soundwire@3210000 {
2528bab661aSEmmanuel Vadot        compatible = "qcom,soundwire-v1.6.0";
2538bab661aSEmmanuel Vadot        reg = <0x03210000 0x2000>;
2548bab661aSEmmanuel Vadot
2558bab661aSEmmanuel Vadot        interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>,
2568bab661aSEmmanuel Vadot                     <&pdc 130 IRQ_TYPE_LEVEL_HIGH>;
2578bab661aSEmmanuel Vadot
2588bab661aSEmmanuel Vadot        interrupt-names = "core", "wakeup";
2598bab661aSEmmanuel Vadot
2608bab661aSEmmanuel Vadot        clocks = <&lpass_rx_macro>;
2618bab661aSEmmanuel Vadot        clock-names = "iface";
2628bab661aSEmmanuel Vadot
2638bab661aSEmmanuel Vadot        qcom,din-ports = <0>;
2648bab661aSEmmanuel Vadot        qcom,dout-ports = <5>;
2658bab661aSEmmanuel Vadot
2668bab661aSEmmanuel Vadot        resets = <&lpass_audiocc LPASS_AUDIO_SWR_RX_CGCR>;
2678bab661aSEmmanuel Vadot        reset-names = "swr_audio_cgcr";
2688bab661aSEmmanuel Vadot
2698bab661aSEmmanuel Vadot        qcom,ports-word-length =        /bits/ 8 <0x01 0x07 0x04 0xff 0xff>;
2708bab661aSEmmanuel Vadot        qcom,ports-sinterval-low =      /bits/ 8 <0x03 0x3f 0x1f 0x03 0x03>;
2718bab661aSEmmanuel Vadot        qcom,ports-offset1 =            /bits/ 8 <0x00 0x00 0x0b 0x01 0x01>;
2728bab661aSEmmanuel Vadot        qcom,ports-offset2 =            /bits/ 8 <0x00 0x00 0x0b 0x00 0x00>;
2738bab661aSEmmanuel Vadot        qcom,ports-lane-control =       /bits/ 8 <0x01 0x00 0x00 0x00 0x00>;
2748bab661aSEmmanuel Vadot        qcom,ports-block-pack-mode =    /bits/ 8 <0xff 0x00 0x01 0xff 0xff>;
2758bab661aSEmmanuel Vadot        qcom,ports-hstart =             /bits/ 8 <0xff 0x03 0xff 0xff 0xff>;
2768bab661aSEmmanuel Vadot        qcom,ports-hstop =              /bits/ 8 <0xff 0x06 0xff 0xff 0xff>;
2778bab661aSEmmanuel Vadot        qcom,ports-block-group-count =  /bits/ 8 <0xff 0xff 0xff 0xff 0x00>;
2788bab661aSEmmanuel Vadot
2798bab661aSEmmanuel Vadot        #sound-dai-cells = <1>;
2808bab661aSEmmanuel Vadot        #address-cells = <2>;
2818bab661aSEmmanuel Vadot        #size-cells = <0>;
2828bab661aSEmmanuel Vadot
2838bab661aSEmmanuel Vadot        codec@0,4 {
2848bab661aSEmmanuel Vadot            compatible = "sdw20217010d00";
2858bab661aSEmmanuel Vadot            reg = <0 4>;
2868bab661aSEmmanuel Vadot            qcom,rx-port-mapping = <1 2 3 4 5>;
2878bab661aSEmmanuel Vadot        };
2888bab661aSEmmanuel Vadot    };
289