Documentation / devicetree / bindings / sound / rockchip,i2s-tdm.yaml


Based on kernel version 6.8. Page generated on 2024-03-11 21:26 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
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/rockchip,i2s-tdm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Rockchip I2S/TDM Controller

description:
  The Rockchip I2S/TDM Controller is a Time Division Multiplexed
  audio interface found in various Rockchip SoCs, allowing up
  to 8 channels of audio over a serial interface.

maintainers:
  - Nicolas Frattaroli <frattaroli.nicolas@gmail.com>

allOf:
  - $ref: dai-common.yaml#

properties:
  compatible:
    enum:
      - rockchip,px30-i2s-tdm
      - rockchip,rk1808-i2s-tdm
      - rockchip,rk3308-i2s-tdm
      - rockchip,rk3568-i2s-tdm
      - rockchip,rk3588-i2s-tdm
      - rockchip,rv1126-i2s-tdm

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  dmas:
    minItems: 1
    maxItems: 2

  dma-names:
    minItems: 1
    maxItems: 2
    items:
      enum:
        - rx
        - tx

  clocks:
    minItems: 3
    items:
      - description: clock for TX
      - description: clock for RX
      - description: AHB clock driving the interface
      - description:
          Parent clock for mclk_tx (only required when using mclk-calibrate)
      - description:
          Parent clock for mclk_rx (only required when using mclk-calibrate)
      - description:
          Clock for sample rates that are an integer multiple of 8000
          (only required when using mclk-calibrate)
      - description:
          Clock for sample rates that are an integer multiple of 11025
          (only required when using mclk-calibrate)

  clock-names:
    minItems: 3
    items:
      - const: mclk_tx
      - const: mclk_rx
      - const: hclk
      - const: mclk_tx_src
      - const: mclk_rx_src
      - const: mclk_root0
      - const: mclk_root1

  resets:
    minItems: 1
    maxItems: 2
    description: resets for the tx and rx directions

  reset-names:
    minItems: 1
    maxItems: 2
    items:
      enum:
        - tx-m
        - rx-m

  port:
    $ref: audio-graph-port.yaml#
    unevaluatedProperties: false

  power-domains:
    maxItems: 1

  rockchip,grf:
    $ref: /schemas/types.yaml#/definitions/phandle
    description:
      The phandle of the syscon node for the GRF register.

  rockchip,trcm-sync-tx-only:
    type: boolean
    description: Use TX BCLK/LRCK for both TX and RX.

  rockchip,trcm-sync-rx-only:
    type: boolean
    description: Use RX BCLK/LRCK for both TX and RX.
 
  "#sound-dai-cells":
    const: 0

  rockchip,i2s-rx-route:
    $ref: /schemas/types.yaml#/definitions/uint32-array
    description:
      Defines the mapping of I2S RX sdis to I2S data bus lines.
      By default, they are mapped one-to-one.
      rockchip,i2s-rx-route = <3> would mean sdi3 is receiving from data0.
    maxItems: 4
    items:
      enum: [0, 1, 2, 3]

  rockchip,i2s-tx-route:
    $ref: /schemas/types.yaml#/definitions/uint32-array
    description:
      Defines the mapping of I2S TX sdos to I2S data bus lines.
      By default, they are mapped one-to-one.
      rockchip,i2s-tx-route = <3> would mean sdo3 is sending to data0.
    maxItems: 4
    items:
      enum: [0, 1, 2, 3]

  rockchip,io-multiplex:
    description:
      Specify that the GPIO lines on the I2S bus are multiplexed such that
      the direction (input/output) needs to be dynamically adjusted.
    type: boolean
 

required:
  - compatible
  - reg
  - interrupts
  - dmas
  - dma-names
  - clocks
  - clock-names
  - resets
  - reset-names
  - "#sound-dai-cells"

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/clock/rk3568-cru.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    #include <dt-bindings/pinctrl/rockchip.h>
 
    bus {
        #address-cells = <2>;
        #size-cells = <2>;
        i2s@fe410000 {
            compatible = "rockchip,rk3568-i2s-tdm";
            reg = <0x0 0xfe410000 0x0 0x1000>;
            interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
            clocks = <&cru MCLK_I2S1_8CH_TX>, <&cru MCLK_I2S1_8CH_RX>,
                     <&cru HCLK_I2S1_8CH>;
            clock-names = "mclk_tx", "mclk_rx", "hclk";
            dmas = <&dmac1 3>, <&dmac1 2>;
            dma-names = "rx", "tx";
            resets = <&cru SRST_M_I2S1_8CH_TX>, <&cru SRST_M_I2S1_8CH_RX>;
            reset-names = "tx-m", "rx-m";
            rockchip,trcm-sync-tx-only;
            rockchip,grf = <&grf>;
            #sound-dai-cells = <0>;
            pinctrl-names = "default";
            pinctrl-0 =
                <&i2s1m0_sclktx
                &i2s1m0_sclkrx
                &i2s1m0_lrcktx
                &i2s1m0_lrckrx
                &i2s1m0_sdi0
                &i2s1m0_sdi1
                &i2s1m0_sdi2
                &i2s1m0_sdi3
                &i2s1m0_sdo0
                &i2s1m0_sdo1
                &i2s1m0_sdo2
                &i2s1m0_sdo3>;
        };
    };