xref: /freebsd/sys/contrib/device-tree/Bindings/sound/rockchip,i2s-tdm.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
18cc087a1SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
28cc087a1SEmmanuel Vadot%YAML 1.2
38cc087a1SEmmanuel Vadot---
48cc087a1SEmmanuel Vadot$id: http://devicetree.org/schemas/sound/rockchip,i2s-tdm.yaml#
58cc087a1SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
68cc087a1SEmmanuel Vadot
78cc087a1SEmmanuel Vadottitle: Rockchip I2S/TDM Controller
88cc087a1SEmmanuel Vadot
98cc087a1SEmmanuel Vadotdescription:
108cc087a1SEmmanuel Vadot  The Rockchip I2S/TDM Controller is a Time Division Multiplexed
118cc087a1SEmmanuel Vadot  audio interface found in various Rockchip SoCs, allowing up
128cc087a1SEmmanuel Vadot  to 8 channels of audio over a serial interface.
138cc087a1SEmmanuel Vadot
148cc087a1SEmmanuel Vadotmaintainers:
158cc087a1SEmmanuel Vadot  - Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
168cc087a1SEmmanuel Vadot
178bab661aSEmmanuel VadotallOf:
188bab661aSEmmanuel Vadot  - $ref: dai-common.yaml#
198bab661aSEmmanuel Vadot
208cc087a1SEmmanuel Vadotproperties:
218cc087a1SEmmanuel Vadot  compatible:
228cc087a1SEmmanuel Vadot    enum:
238cc087a1SEmmanuel Vadot      - rockchip,px30-i2s-tdm
248cc087a1SEmmanuel Vadot      - rockchip,rk1808-i2s-tdm
258cc087a1SEmmanuel Vadot      - rockchip,rk3308-i2s-tdm
268cc087a1SEmmanuel Vadot      - rockchip,rk3568-i2s-tdm
278bab661aSEmmanuel Vadot      - rockchip,rk3588-i2s-tdm
288cc087a1SEmmanuel Vadot      - rockchip,rv1126-i2s-tdm
298cc087a1SEmmanuel Vadot
308cc087a1SEmmanuel Vadot  reg:
318cc087a1SEmmanuel Vadot    maxItems: 1
328cc087a1SEmmanuel Vadot
338cc087a1SEmmanuel Vadot  interrupts:
348cc087a1SEmmanuel Vadot    maxItems: 1
358cc087a1SEmmanuel Vadot
368cc087a1SEmmanuel Vadot  dmas:
378cc087a1SEmmanuel Vadot    minItems: 1
388cc087a1SEmmanuel Vadot    maxItems: 2
398cc087a1SEmmanuel Vadot
408cc087a1SEmmanuel Vadot  dma-names:
418cc087a1SEmmanuel Vadot    minItems: 1
428cc087a1SEmmanuel Vadot    maxItems: 2
438cc087a1SEmmanuel Vadot    items:
448cc087a1SEmmanuel Vadot      enum:
458cc087a1SEmmanuel Vadot        - rx
468cc087a1SEmmanuel Vadot        - tx
478cc087a1SEmmanuel Vadot
488cc087a1SEmmanuel Vadot  clocks:
498cc087a1SEmmanuel Vadot    minItems: 3
508cc087a1SEmmanuel Vadot    items:
518cc087a1SEmmanuel Vadot      - description: clock for TX
528cc087a1SEmmanuel Vadot      - description: clock for RX
538cc087a1SEmmanuel Vadot      - description: AHB clock driving the interface
548cc087a1SEmmanuel Vadot      - description:
558cc087a1SEmmanuel Vadot          Parent clock for mclk_tx (only required when using mclk-calibrate)
568cc087a1SEmmanuel Vadot      - description:
578cc087a1SEmmanuel Vadot          Parent clock for mclk_rx (only required when using mclk-calibrate)
588cc087a1SEmmanuel Vadot      - description:
598cc087a1SEmmanuel Vadot          Clock for sample rates that are an integer multiple of 8000
608cc087a1SEmmanuel Vadot          (only required when using mclk-calibrate)
618cc087a1SEmmanuel Vadot      - description:
628cc087a1SEmmanuel Vadot          Clock for sample rates that are an integer multiple of 11025
638cc087a1SEmmanuel Vadot          (only required when using mclk-calibrate)
648cc087a1SEmmanuel Vadot
658cc087a1SEmmanuel Vadot  clock-names:
668cc087a1SEmmanuel Vadot    minItems: 3
678cc087a1SEmmanuel Vadot    items:
688cc087a1SEmmanuel Vadot      - const: mclk_tx
698cc087a1SEmmanuel Vadot      - const: mclk_rx
708cc087a1SEmmanuel Vadot      - const: hclk
718cc087a1SEmmanuel Vadot      - const: mclk_tx_src
728cc087a1SEmmanuel Vadot      - const: mclk_rx_src
738cc087a1SEmmanuel Vadot      - const: mclk_root0
748cc087a1SEmmanuel Vadot      - const: mclk_root1
758cc087a1SEmmanuel Vadot
768cc087a1SEmmanuel Vadot  resets:
778cc087a1SEmmanuel Vadot    minItems: 1
788cc087a1SEmmanuel Vadot    maxItems: 2
798cc087a1SEmmanuel Vadot    description: resets for the tx and rx directions
808cc087a1SEmmanuel Vadot
818cc087a1SEmmanuel Vadot  reset-names:
828cc087a1SEmmanuel Vadot    minItems: 1
838cc087a1SEmmanuel Vadot    maxItems: 2
848cc087a1SEmmanuel Vadot    items:
858cc087a1SEmmanuel Vadot      enum:
868cc087a1SEmmanuel Vadot        - tx-m
878cc087a1SEmmanuel Vadot        - rx-m
888cc087a1SEmmanuel Vadot
89*fac71e4eSEmmanuel Vadot  port:
90*fac71e4eSEmmanuel Vadot    $ref: audio-graph-port.yaml#
91*fac71e4eSEmmanuel Vadot    unevaluatedProperties: false
92*fac71e4eSEmmanuel Vadot
93*fac71e4eSEmmanuel Vadot  power-domains:
94*fac71e4eSEmmanuel Vadot    maxItems: 1
95*fac71e4eSEmmanuel Vadot
968cc087a1SEmmanuel Vadot  rockchip,grf:
978cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
988cc087a1SEmmanuel Vadot    description:
998cc087a1SEmmanuel Vadot      The phandle of the syscon node for the GRF register.
1008cc087a1SEmmanuel Vadot
1018cc087a1SEmmanuel Vadot  rockchip,trcm-sync-tx-only:
1028cc087a1SEmmanuel Vadot    type: boolean
1038cc087a1SEmmanuel Vadot    description: Use TX BCLK/LRCK for both TX and RX.
1048cc087a1SEmmanuel Vadot
1058cc087a1SEmmanuel Vadot  rockchip,trcm-sync-rx-only:
1068cc087a1SEmmanuel Vadot    type: boolean
1078cc087a1SEmmanuel Vadot    description: Use RX BCLK/LRCK for both TX and RX.
1088cc087a1SEmmanuel Vadot
1098cc087a1SEmmanuel Vadot  "#sound-dai-cells":
1108cc087a1SEmmanuel Vadot    const: 0
1118cc087a1SEmmanuel Vadot
1128cc087a1SEmmanuel Vadot  rockchip,i2s-rx-route:
1138cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
1148cc087a1SEmmanuel Vadot    description:
1158cc087a1SEmmanuel Vadot      Defines the mapping of I2S RX sdis to I2S data bus lines.
1168cc087a1SEmmanuel Vadot      By default, they are mapped one-to-one.
1178cc087a1SEmmanuel Vadot      rockchip,i2s-rx-route = <3> would mean sdi3 is receiving from data0.
1188cc087a1SEmmanuel Vadot    maxItems: 4
1198cc087a1SEmmanuel Vadot    items:
1208cc087a1SEmmanuel Vadot      enum: [0, 1, 2, 3]
1218cc087a1SEmmanuel Vadot
1228cc087a1SEmmanuel Vadot  rockchip,i2s-tx-route:
1238cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
1248cc087a1SEmmanuel Vadot    description:
1258cc087a1SEmmanuel Vadot      Defines the mapping of I2S TX sdos to I2S data bus lines.
1268cc087a1SEmmanuel Vadot      By default, they are mapped one-to-one.
1278cc087a1SEmmanuel Vadot      rockchip,i2s-tx-route = <3> would mean sdo3 is sending to data0.
1288cc087a1SEmmanuel Vadot    maxItems: 4
1298cc087a1SEmmanuel Vadot    items:
1308cc087a1SEmmanuel Vadot      enum: [0, 1, 2, 3]
1318cc087a1SEmmanuel Vadot
1328cc087a1SEmmanuel Vadot  rockchip,io-multiplex:
1338cc087a1SEmmanuel Vadot    description:
1348cc087a1SEmmanuel Vadot      Specify that the GPIO lines on the I2S bus are multiplexed such that
1358cc087a1SEmmanuel Vadot      the direction (input/output) needs to be dynamically adjusted.
1368cc087a1SEmmanuel Vadot    type: boolean
1378cc087a1SEmmanuel Vadot
1388cc087a1SEmmanuel Vadot
1398cc087a1SEmmanuel Vadotrequired:
1408cc087a1SEmmanuel Vadot  - compatible
1418cc087a1SEmmanuel Vadot  - reg
1428cc087a1SEmmanuel Vadot  - interrupts
1438cc087a1SEmmanuel Vadot  - dmas
1448cc087a1SEmmanuel Vadot  - dma-names
1458cc087a1SEmmanuel Vadot  - clocks
1468cc087a1SEmmanuel Vadot  - clock-names
1478cc087a1SEmmanuel Vadot  - resets
1488cc087a1SEmmanuel Vadot  - reset-names
1498cc087a1SEmmanuel Vadot  - "#sound-dai-cells"
1508cc087a1SEmmanuel Vadot
1518bab661aSEmmanuel VadotunevaluatedProperties: false
1528cc087a1SEmmanuel Vadot
1538cc087a1SEmmanuel Vadotexamples:
1548cc087a1SEmmanuel Vadot  - |
1558cc087a1SEmmanuel Vadot    #include <dt-bindings/clock/rk3568-cru.h>
1568cc087a1SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
1578cc087a1SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
1588cc087a1SEmmanuel Vadot    #include <dt-bindings/pinctrl/rockchip.h>
1598cc087a1SEmmanuel Vadot
1608cc087a1SEmmanuel Vadot    bus {
1618cc087a1SEmmanuel Vadot        #address-cells = <2>;
1628cc087a1SEmmanuel Vadot        #size-cells = <2>;
1638cc087a1SEmmanuel Vadot        i2s@fe410000 {
1648cc087a1SEmmanuel Vadot            compatible = "rockchip,rk3568-i2s-tdm";
1658cc087a1SEmmanuel Vadot            reg = <0x0 0xfe410000 0x0 0x1000>;
1668cc087a1SEmmanuel Vadot            interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
1678cc087a1SEmmanuel Vadot            clocks = <&cru MCLK_I2S1_8CH_TX>, <&cru MCLK_I2S1_8CH_RX>,
1688cc087a1SEmmanuel Vadot                     <&cru HCLK_I2S1_8CH>;
1698cc087a1SEmmanuel Vadot            clock-names = "mclk_tx", "mclk_rx", "hclk";
1708cc087a1SEmmanuel Vadot            dmas = <&dmac1 3>, <&dmac1 2>;
1718cc087a1SEmmanuel Vadot            dma-names = "rx", "tx";
1728cc087a1SEmmanuel Vadot            resets = <&cru SRST_M_I2S1_8CH_TX>, <&cru SRST_M_I2S1_8CH_RX>;
1738cc087a1SEmmanuel Vadot            reset-names = "tx-m", "rx-m";
1748cc087a1SEmmanuel Vadot            rockchip,trcm-sync-tx-only;
1758cc087a1SEmmanuel Vadot            rockchip,grf = <&grf>;
1768cc087a1SEmmanuel Vadot            #sound-dai-cells = <0>;
1778cc087a1SEmmanuel Vadot            pinctrl-names = "default";
1788cc087a1SEmmanuel Vadot            pinctrl-0 =
1798cc087a1SEmmanuel Vadot                <&i2s1m0_sclktx
1808cc087a1SEmmanuel Vadot                &i2s1m0_sclkrx
1818cc087a1SEmmanuel Vadot                &i2s1m0_lrcktx
1828cc087a1SEmmanuel Vadot                &i2s1m0_lrckrx
1838cc087a1SEmmanuel Vadot                &i2s1m0_sdi0
1848cc087a1SEmmanuel Vadot                &i2s1m0_sdi1
1858cc087a1SEmmanuel Vadot                &i2s1m0_sdi2
1868cc087a1SEmmanuel Vadot                &i2s1m0_sdi3
1878cc087a1SEmmanuel Vadot                &i2s1m0_sdo0
1888cc087a1SEmmanuel Vadot                &i2s1m0_sdo1
1898cc087a1SEmmanuel Vadot                &i2s1m0_sdo2
1908cc087a1SEmmanuel Vadot                &i2s1m0_sdo3>;
1918cc087a1SEmmanuel Vadot        };
1928cc087a1SEmmanuel Vadot    };
193