xref: /freebsd/sys/contrib/device-tree/Bindings/soundwire/qcom,soundwire.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
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
248bab661aSEmmanuel Vadot
258bab661aSEmmanuel Vadot  reg:
268bab661aSEmmanuel Vadot    maxItems: 1
278bab661aSEmmanuel Vadot
288bab661aSEmmanuel Vadot  interrupts:
298bab661aSEmmanuel Vadot    minItems: 1
308bab661aSEmmanuel Vadot    items:
318bab661aSEmmanuel Vadot      - description: specify the SoundWire controller core.
328bab661aSEmmanuel Vadot      - description: specify the Soundwire controller wake IRQ.
338bab661aSEmmanuel Vadot
348bab661aSEmmanuel Vadot  interrupt-names:
358bab661aSEmmanuel Vadot    minItems: 1
368bab661aSEmmanuel Vadot    items:
378bab661aSEmmanuel Vadot      - const: core
388bab661aSEmmanuel Vadot      - const: wakeup
398bab661aSEmmanuel Vadot
408bab661aSEmmanuel Vadot  clocks:
418bab661aSEmmanuel Vadot    items:
428bab661aSEmmanuel Vadot      - description: iface clock
438bab661aSEmmanuel Vadot
448bab661aSEmmanuel Vadot  clock-names:
458bab661aSEmmanuel Vadot    items:
468bab661aSEmmanuel Vadot      - const: iface
478bab661aSEmmanuel Vadot
488bab661aSEmmanuel Vadot  resets:
498bab661aSEmmanuel Vadot    items:
508bab661aSEmmanuel Vadot      - description: SWR_AUDIO_CGCR RESET
518bab661aSEmmanuel Vadot
528bab661aSEmmanuel Vadot  reset-names:
538bab661aSEmmanuel Vadot    items:
548bab661aSEmmanuel Vadot      - const: swr_audio_cgcr
558bab661aSEmmanuel Vadot
568bab661aSEmmanuel Vadot  '#sound-dai-cells':
578bab661aSEmmanuel Vadot    const: 1
588bab661aSEmmanuel Vadot
598bab661aSEmmanuel Vadot  '#address-cells':
608bab661aSEmmanuel Vadot    const: 2
618bab661aSEmmanuel Vadot
628bab661aSEmmanuel Vadot  '#size-cells':
638bab661aSEmmanuel Vadot    const: 0
648bab661aSEmmanuel Vadot
658bab661aSEmmanuel Vadot  wakeup-source: true
668bab661aSEmmanuel Vadot
678bab661aSEmmanuel Vadot  qcom,din-ports:
688bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
698bab661aSEmmanuel Vadot    description: count of data in ports
708bab661aSEmmanuel Vadot
718bab661aSEmmanuel Vadot  qcom,dout-ports:
728bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
738bab661aSEmmanuel Vadot    description: count of data out ports
748bab661aSEmmanuel Vadot
758bab661aSEmmanuel Vadot  qcom,ports-word-length:
768bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
778bab661aSEmmanuel Vadot    description:
788bab661aSEmmanuel Vadot      Size of payload channel sample.
798bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
808bab661aSEmmanuel Vadot      or applicable for the respective data port.
818bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
828bab661aSEmmanuel Vadot    minItems: 3
838bab661aSEmmanuel Vadot    maxItems: 8
848bab661aSEmmanuel Vadot
858bab661aSEmmanuel Vadot  qcom,ports-sinterval-low:
868bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
878bab661aSEmmanuel Vadot    description:
888bab661aSEmmanuel Vadot      Sample interval low of each data port.
898bab661aSEmmanuel Vadot      Out ports followed by In ports. Used for Sample Interval calculation.
908bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
918bab661aSEmmanuel Vadot      or applicable for the respective data port.
928bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
938bab661aSEmmanuel Vadot    minItems: 3
948bab661aSEmmanuel Vadot    maxItems: 8
958bab661aSEmmanuel Vadot
968bab661aSEmmanuel Vadot  qcom,ports-offset1:
978bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
988bab661aSEmmanuel Vadot    description:
998bab661aSEmmanuel Vadot      Payload transport window offset1 of each data port.
1008bab661aSEmmanuel Vadot      Out ports followed by In ports.
1018bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
1028bab661aSEmmanuel Vadot      or applicable for the respective data port.
1038bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
1048bab661aSEmmanuel Vadot    minItems: 3
1058bab661aSEmmanuel Vadot    maxItems: 8
1068bab661aSEmmanuel Vadot
1078bab661aSEmmanuel Vadot  qcom,ports-offset2:
1088bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
1098bab661aSEmmanuel Vadot    description:
1108bab661aSEmmanuel Vadot      Payload transport window offset2 of each data port.
1118bab661aSEmmanuel Vadot      Out ports followed by In ports.
1128bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
1138bab661aSEmmanuel Vadot      or applicable for the respective data port.
1148bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
1158bab661aSEmmanuel Vadot    minItems: 3
1168bab661aSEmmanuel Vadot    maxItems: 8
1178bab661aSEmmanuel Vadot
1188bab661aSEmmanuel Vadot  qcom,ports-lane-control:
1198bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
1208bab661aSEmmanuel Vadot    description:
1218bab661aSEmmanuel Vadot      Identify which data lane the data port uses.
1228bab661aSEmmanuel Vadot      Out ports followed by In ports.
1238bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
1248bab661aSEmmanuel Vadot      or applicable for the respective data port.
1258bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
1268bab661aSEmmanuel Vadot    minItems: 3
1278bab661aSEmmanuel Vadot    maxItems: 8
1288bab661aSEmmanuel Vadot
1298bab661aSEmmanuel Vadot  qcom,ports-block-pack-mode:
1308bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
1318bab661aSEmmanuel Vadot    description:
1328bab661aSEmmanuel Vadot      Indicate the block packing mode.
1338bab661aSEmmanuel Vadot      0 to indicate Blocks are per Channel
1348bab661aSEmmanuel Vadot      1 to indicate Blocks are per Port.
1358bab661aSEmmanuel Vadot      Out ports followed by In ports.
1368bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
1378bab661aSEmmanuel Vadot      or applicable for the respective data port.
1388bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
1398bab661aSEmmanuel Vadot    minItems: 3
1408bab661aSEmmanuel Vadot    maxItems: 8
1418bab661aSEmmanuel Vadot    items:
1428bab661aSEmmanuel Vadot      oneOf:
1438bab661aSEmmanuel Vadot        - minimum: 0
1448bab661aSEmmanuel Vadot          maximum: 1
1458bab661aSEmmanuel Vadot        - const: 0xff
1468bab661aSEmmanuel Vadot
1478bab661aSEmmanuel Vadot  qcom,ports-hstart:
1488bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
1498bab661aSEmmanuel Vadot    description:
1508bab661aSEmmanuel Vadot      Identifying lowerst numbered coloum in SoundWire Frame,
1518bab661aSEmmanuel Vadot      i.e. left edge of the Transport sub-frame for each port.
1528bab661aSEmmanuel Vadot      Out ports followed by In ports.
1538bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
1548bab661aSEmmanuel Vadot      or applicable for the respective data port.
1558bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
1568bab661aSEmmanuel Vadot    minItems: 3
1578bab661aSEmmanuel Vadot    maxItems: 8
1588bab661aSEmmanuel Vadot    items:
1598bab661aSEmmanuel Vadot      oneOf:
1608bab661aSEmmanuel Vadot        - minimum: 0
1618bab661aSEmmanuel Vadot          maximum: 15
1628bab661aSEmmanuel Vadot        - const: 0xff
1638bab661aSEmmanuel Vadot
1648bab661aSEmmanuel Vadot  qcom,ports-hstop:
1658bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
1668bab661aSEmmanuel Vadot    description:
1678bab661aSEmmanuel Vadot      Identifying highest numbered coloum in SoundWire Frame,
1688bab661aSEmmanuel Vadot      i.e. the right edge of the Transport
1698bab661aSEmmanuel Vadot      sub-frame for each port. Out ports followed by In ports.
1708bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
1718bab661aSEmmanuel Vadot      or applicable for the respective data port.
1728bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
1738bab661aSEmmanuel Vadot    minItems: 3
1748bab661aSEmmanuel Vadot    maxItems: 8
1758bab661aSEmmanuel Vadot    items:
1768bab661aSEmmanuel Vadot      oneOf:
1778bab661aSEmmanuel Vadot        - minimum: 0
1788bab661aSEmmanuel Vadot          maximum: 15
1798bab661aSEmmanuel Vadot        - const: 0xff
1808bab661aSEmmanuel Vadot
1818bab661aSEmmanuel Vadot  qcom,ports-block-group-count:
1828bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8-array
1838bab661aSEmmanuel Vadot    description:
1848bab661aSEmmanuel Vadot      In range 1 to 4 to indicate how many sample intervals are combined
1858bab661aSEmmanuel Vadot      into a payload. Out ports followed by In ports.
1868bab661aSEmmanuel Vadot      Value of 0xff indicates that this option is not implemented
1878bab661aSEmmanuel Vadot      or applicable for the respective data port.
1888bab661aSEmmanuel Vadot      More info in MIPI Alliance SoundWire 1.0 Specifications.
1898bab661aSEmmanuel Vadot    minItems: 3
1908bab661aSEmmanuel Vadot    maxItems: 8
1918bab661aSEmmanuel Vadot    items:
1928bab661aSEmmanuel Vadot      oneOf:
1938bab661aSEmmanuel Vadot        - minimum: 0
1948bab661aSEmmanuel Vadot          maximum: 4
1958bab661aSEmmanuel Vadot        - const: 0xff
1968bab661aSEmmanuel Vadot
1978bab661aSEmmanuel Vadot  label:
1988bab661aSEmmanuel Vadot    maxItems: 1
1998bab661aSEmmanuel Vadot
2008bab661aSEmmanuel VadotpatternProperties:
2018bab661aSEmmanuel Vadot  "^.*@[0-9a-f],[0-9a-f]$":
2028bab661aSEmmanuel Vadot    type: object
203*fac71e4eSEmmanuel Vadot    additionalProperties: true
2048bab661aSEmmanuel Vadot    description:
2058bab661aSEmmanuel Vadot      Child nodes for a standalone audio codec or speaker amplifier IC.
2068bab661aSEmmanuel Vadot      It has RX and TX Soundwire secondary devices.
2078bab661aSEmmanuel Vadot    properties:
2088bab661aSEmmanuel Vadot      compatible:
2098bab661aSEmmanuel Vadot        pattern: "^sdw[0-9a-f]{1}[0-9a-f]{4}[0-9a-f]{4}[0-9a-f]{2}$"
2108bab661aSEmmanuel Vadot
2118bab661aSEmmanuel Vadotrequired:
2128bab661aSEmmanuel Vadot  - compatible
2138bab661aSEmmanuel Vadot  - reg
2148bab661aSEmmanuel Vadot  - interrupts
2158bab661aSEmmanuel Vadot  - clocks
2168bab661aSEmmanuel Vadot  - clock-names
2178bab661aSEmmanuel Vadot  - '#sound-dai-cells'
2188bab661aSEmmanuel Vadot  - '#address-cells'
2198bab661aSEmmanuel Vadot  - '#size-cells'
2208bab661aSEmmanuel Vadot  - qcom,dout-ports
2218bab661aSEmmanuel Vadot  - qcom,din-ports
2228bab661aSEmmanuel Vadot  - qcom,ports-sinterval-low
2238bab661aSEmmanuel Vadot  - qcom,ports-offset1
2248bab661aSEmmanuel Vadot  - qcom,ports-offset2
2258bab661aSEmmanuel Vadot
2268bab661aSEmmanuel VadotadditionalProperties: false
2278bab661aSEmmanuel Vadot
2288bab661aSEmmanuel Vadotexamples:
2298bab661aSEmmanuel Vadot  - |
2308bab661aSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
2318bab661aSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
2328bab661aSEmmanuel Vadot    #include <dt-bindings/clock/qcom,lpassaudiocc-sc7280.h>
2338bab661aSEmmanuel Vadot
2348bab661aSEmmanuel Vadot    soundwire@3210000 {
2358bab661aSEmmanuel Vadot        compatible = "qcom,soundwire-v1.6.0";
2368bab661aSEmmanuel Vadot        reg = <0x03210000 0x2000>;
2378bab661aSEmmanuel Vadot
2388bab661aSEmmanuel Vadot        interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>,
2398bab661aSEmmanuel Vadot                     <&pdc 130 IRQ_TYPE_LEVEL_HIGH>;
2408bab661aSEmmanuel Vadot
2418bab661aSEmmanuel Vadot        interrupt-names = "core", "wakeup";
2428bab661aSEmmanuel Vadot
2438bab661aSEmmanuel Vadot        clocks = <&lpass_rx_macro>;
2448bab661aSEmmanuel Vadot        clock-names = "iface";
2458bab661aSEmmanuel Vadot
2468bab661aSEmmanuel Vadot        qcom,din-ports = <0>;
2478bab661aSEmmanuel Vadot        qcom,dout-ports = <5>;
2488bab661aSEmmanuel Vadot
2498bab661aSEmmanuel Vadot        resets = <&lpass_audiocc LPASS_AUDIO_SWR_RX_CGCR>;
2508bab661aSEmmanuel Vadot        reset-names = "swr_audio_cgcr";
2518bab661aSEmmanuel Vadot
2528bab661aSEmmanuel Vadot        qcom,ports-word-length =        /bits/ 8 <0x01 0x07 0x04 0xff 0xff>;
2538bab661aSEmmanuel Vadot        qcom,ports-sinterval-low =      /bits/ 8 <0x03 0x3f 0x1f 0x03 0x03>;
2548bab661aSEmmanuel Vadot        qcom,ports-offset1 =            /bits/ 8 <0x00 0x00 0x0b 0x01 0x01>;
2558bab661aSEmmanuel Vadot        qcom,ports-offset2 =            /bits/ 8 <0x00 0x00 0x0b 0x00 0x00>;
2568bab661aSEmmanuel Vadot        qcom,ports-lane-control =       /bits/ 8 <0x01 0x00 0x00 0x00 0x00>;
2578bab661aSEmmanuel Vadot        qcom,ports-block-pack-mode =    /bits/ 8 <0xff 0x00 0x01 0xff 0xff>;
2588bab661aSEmmanuel Vadot        qcom,ports-hstart =             /bits/ 8 <0xff 0x03 0xff 0xff 0xff>;
2598bab661aSEmmanuel Vadot        qcom,ports-hstop =              /bits/ 8 <0xff 0x06 0xff 0xff 0xff>;
2608bab661aSEmmanuel Vadot        qcom,ports-block-group-count =  /bits/ 8 <0xff 0xff 0xff 0xff 0x00>;
2618bab661aSEmmanuel Vadot
2628bab661aSEmmanuel Vadot        #sound-dai-cells = <1>;
2638bab661aSEmmanuel Vadot        #address-cells = <2>;
2648bab661aSEmmanuel Vadot        #size-cells = <0>;
2658bab661aSEmmanuel Vadot
2668bab661aSEmmanuel Vadot        codec@0,4 {
2678bab661aSEmmanuel Vadot            compatible = "sdw20217010d00";
2688bab661aSEmmanuel Vadot            reg = <0 4>;
2698bab661aSEmmanuel Vadot            qcom,rx-port-mapping = <1 2 3 4 5>;
2708bab661aSEmmanuel Vadot        };
2718bab661aSEmmanuel Vadot    };
272