xref: /linux/Documentation/devicetree/bindings/sound/fsl,sai.yaml (revision ae22a94997b8a03dcb3c922857c203246711f9d4)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/sound/fsl,sai.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Freescale Synchronous Audio Interface (SAI).
8
9maintainers:
10  - Shengjiu Wang <shengjiu.wang@nxp.com>
11
12description: |
13  The SAI is based on I2S module that used communicating with audio codecs,
14  which provides a synchronous audio interface that supports fullduplex
15  serial interfaces with frame synchronization such as I2S, AC97, TDM, and
16  codec/DSP interfaces.
17
18properties:
19  compatible:
20    oneOf:
21      - items:
22          - enum:
23              - fsl,imx6ul-sai
24              - fsl,imx7d-sai
25          - const: fsl,imx6sx-sai
26
27      - items:
28          - enum:
29              - fsl,imx8mm-sai
30              - fsl,imx8mn-sai
31              - fsl,imx8mp-sai
32          - const: fsl,imx8mq-sai
33
34      - items:
35          - enum:
36              - fsl,imx6sx-sai
37              - fsl,imx7ulp-sai
38              - fsl,imx8mq-sai
39              - fsl,imx8qm-sai
40              - fsl,imx8ulp-sai
41              - fsl,imx93-sai
42              - fsl,imx95-sai
43              - fsl,vf610-sai
44
45  reg:
46    maxItems: 1
47
48  clocks:
49    items:
50      - description: The ipg clock for register access
51      - description: master clock source 0 (obsoleted)
52      - description: master clock source 1
53      - description: master clock source 2
54      - description: master clock source 3
55      - description: PLL clock source for 8kHz series
56      - description: PLL clock source for 11kHz series
57    minItems: 4
58
59  clock-names:
60    oneOf:
61      - items:
62          - const: bus
63          - const: mclk0
64          - const: mclk1
65          - const: mclk2
66          - const: mclk3
67          - const: pll8k
68          - const: pll11k
69        minItems: 5
70      - items:
71          - const: bus
72          - const: mclk1
73          - const: mclk2
74          - const: mclk3
75          - const: pll8k
76          - const: pll11k
77        minItems: 4
78
79  power-domains:
80    maxItems: 1
81
82  dmas:
83    minItems: 1
84    items:
85      - description: DMA controller phandle and request line for RX
86      - description: DMA controller phandle and request line for TX
87
88  dma-names:
89    minItems: 1
90    items:
91      - const: rx
92      - const: tx
93
94  interrupts:
95    items:
96      - description: receive and transmit interrupt
97
98  big-endian:
99    description: |
100      required if all the SAI registers are big-endian rather than little-endian.
101    type: boolean
102
103  fsl,dataline:
104    $ref: /schemas/types.yaml#/definitions/uint32-matrix
105    description: |
106      Configure the dataline. It has 3 value for each configuration
107    maxItems: 16
108    items:
109      items:
110        - description: format Default(0), I2S(1) or PDM(2)
111          enum: [0, 1, 2]
112        - description: dataline mask for 'rx'
113        - description: dataline mask for 'tx'
114
115  fsl,sai-mclk-direction-output:
116    description: SAI will output the SAI MCLK clock.
117    type: boolean
118
119  fsl,sai-synchronous-rx:
120    description: |
121      SAI will work in the synchronous mode (sync Tx with Rx) which means
122      both the transmitter and the receiver will send and receive data by
123      following receiver's bit clocks and frame sync clocks.
124    type: boolean
125
126  fsl,sai-asynchronous:
127    description: |
128      SAI will work in the asynchronous mode, which means both transmitter
129      and receiver will send and receive data by following their own bit clocks
130      and frame sync clocks separately.
131      If both fsl,sai-asynchronous and fsl,sai-synchronous-rx are absent, the
132      default synchronous mode (sync Rx with Tx) will be used, which means both
133      transmitter and receiver will send and receive data by following clocks
134      of transmitter.
135    type: boolean
136
137  fsl,shared-interrupt:
138    description: Interrupt is shared with other modules.
139    type: boolean
140
141  lsb-first:
142    description: |
143      Configures whether the LSB or the MSB is transmitted
144      first for the fifo data. If this property is absent,
145      the MSB is transmitted first as default, or the LSB
146      is transmitted first.
147    type: boolean
148
149  "#sound-dai-cells":
150    const: 0
151    description: optional, some dts node didn't add it.
152
153allOf:
154  - $ref: dai-common.yaml#
155  - if:
156      required:
157        - fsl,sai-asynchronous
158    then:
159      properties:
160        fsl,sai-synchronous-rx: false
161
162required:
163  - compatible
164  - reg
165  - clocks
166  - clock-names
167  - dmas
168  - dma-names
169  - interrupts
170
171unevaluatedProperties: false
172
173examples:
174  - |
175    #include <dt-bindings/interrupt-controller/arm-gic.h>
176    #include <dt-bindings/clock/vf610-clock.h>
177    sai2: sai@40031000 {
178        compatible = "fsl,vf610-sai";
179        reg = <0x40031000 0x1000>;
180        interrupts = <86 IRQ_TYPE_LEVEL_HIGH>;
181        pinctrl-names = "default";
182        pinctrl-0 = <&pinctrl_sai2_1>;
183        clocks = <&clks VF610_CLK_PLATFORM_BUS>,
184                 <&clks VF610_CLK_SAI2>,
185                 <&clks 0>, <&clks 0>;
186        clock-names = "bus", "mclk1", "mclk2", "mclk3";
187        dma-names = "rx", "tx";
188        dmas = <&edma0 0 20>, <&edma0 0 21>;
189        big-endian;
190        lsb-first;
191    };
192
193  - |
194    #include <dt-bindings/interrupt-controller/arm-gic.h>
195    #include <dt-bindings/clock/imx8mm-clock.h>
196    sai1: sai@30010000 {
197        compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai";
198        reg = <0x30010000 0x10000>;
199        interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
200        clocks = <&clk IMX8MM_CLK_SAI1_IPG>,
201                 <&clk IMX8MM_CLK_DUMMY>,
202                 <&clk IMX8MM_CLK_SAI1_ROOT>,
203                 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
204        clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
205        dmas = <&sdma2 0 2 0>, <&sdma2 1 2 0>;
206        dma-names = "rx", "tx";
207        fsl,dataline = <1 0xff 0xff 2 0xff 0x11>;
208        #sound-dai-cells = <0>;
209    };
210