summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/sound/rockchip,rk3576-sai.yaml
blob: 149da9a91451f202aa241f0854d9f54514cae8a3 (plain)
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
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/rockchip,rk3576-sai.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Rockchip Serial Audio Interface Controller

description:
  The Rockchip Serial Audio Interface (SAI) controller is a flexible audio
  controller that implements the I2S, I2S/TDM and the PDM standards.

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

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

properties:
  compatible:
    const: rockchip,rk3576-sai

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  dmas:
    minItems: 1
    maxItems: 2

  dma-names:
    minItems: 1
    items:
      - enum: [tx, rx]
      - const: rx

  clocks:
    items:
      - description: master audio clock
      - description: AHB clock driving the interface

  clock-names:
    items:
      - const: mclk
      - const: hclk

  resets:
    minItems: 1
    items:
      - description: reset for the mclk domain
      - description: reset for the hclk domain

  reset-names:
    minItems: 1
    items:
      - const: m
      - const: h

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

  power-domains:
    maxItems: 1

  "#sound-dai-cells":
    const: 0

  rockchip,sai-rx-route:
    $ref: /schemas/types.yaml#/definitions/uint32-array
    description:
      Defines the mapping of the controller's SDI ports to actual input lanes,
      as well as the number of input lanes.
      rockchip,sai-rx-route = <3> would mean sdi3 is receiving from data0, and
      that there is only one receiving lane.
      This property's absence is to be understood as only one receiving lane
      being used if the controller has capture capabilities.
    maxItems: 4
    items:
      minimum: 0
      maximum: 3

  rockchip,sai-tx-route:
    $ref: /schemas/types.yaml#/definitions/uint32-array
    description:
      Defines the mapping of the controller's SDO ports to actual output lanes,
      as well as the number of output lanes.
      rockchip,sai-tx-route = <3> would mean sdo3 is sending to data0, and
      that there is only one transmitting lane.
      This property's absence is to be understood as only one transmitting lane
      being used if the controller has playback capabilities.
    maxItems: 4
    items:
      minimum: 0
      maximum: 3

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

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/clock/rockchip,rk3576-cru.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    #include <dt-bindings/pinctrl/rockchip.h>
    #include <dt-bindings/power/rockchip,rk3576-power.h>
    #include <dt-bindings/reset/rockchip,rk3576-cru.h>

    bus {
        #address-cells = <2>;
        #size-cells = <2>;
        sai1: sai@2a610000 {
            compatible = "rockchip,rk3576-sai";
            reg = <0x0 0x2a610000 0x0 0x1000>;
            interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>;
            clocks = <&cru MCLK_SAI1_8CH>, <&cru HCLK_SAI1_8CH>;
            clock-names = "mclk", "hclk";
            dmas = <&dmac0 2>, <&dmac0 3>;
            dma-names = "tx", "rx";
            power-domains = <&power RK3576_PD_AUDIO>;
            resets = <&cru SRST_M_SAI1_8CH>, <&cru SRST_H_SAI1_8CH>;
            reset-names = "m", "h";
            pinctrl-names = "default";
            pinctrl-0 = <&sai1m0_lrck
                         &sai1m0_sclk
                         &sai1m0_sdi0
                         &sai1m0_sdo0
                         &sai1m0_sdo1
                         &sai1m0_sdo2
                         &sai1m0_sdo3>;
            rockchip,sai-tx-route = <3 1 2 0>;
            #sound-dai-cells = <0>;
        };
    };