Merge branch 'fix/intel' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[sfrench/cifs-2.6.git] / Documentation / devicetree / bindings / sound / st,stm32-sai.txt
1 STMicroelectronics STM32 Serial Audio Interface (SAI).
2
3 The SAI interface (Serial Audio Interface) offers a wide set of audio protocols
4 as I2S standards, LSB or MSB-justified, PCM/DSP, TDM, and AC'97.
5 The SAI contains two independent audio sub-blocks. Each sub-block has
6 its own clock generator and I/O lines controller.
7
8 Required properties:
9   - compatible: Should be "st,stm32f4-sai" or "st,stm32h7-sai"
10   - reg: Base address and size of SAI common register set.
11   - clocks: Must contain phandle and clock specifier pairs for each entry
12         in clock-names.
13   - clock-names: Must contain "pclk" "x8k" and "x11k"
14         "pclk": Clock which feeds the peripheral bus interface.
15                 Mandatory for "st,stm32h7-sai" compatible.
16                 Not used for "st,stm32f4-sai" compatible.
17         "x8k": SAI parent clock for sampling rates multiple of 8kHz.
18         "x11k": SAI parent clock for sampling rates multiple of 11.025kHz.
19   - interrupts: cpu DAI interrupt line shared by SAI sub-blocks
20
21 Optional properties:
22   - resets: Reference to a reset controller asserting the SAI
23   - st,sync: specify synchronization mode.
24         By default SAI sub-block is in asynchronous mode.
25         This property sets SAI sub-block as slave of another SAI sub-block.
26         Must contain the phandle and index of the sai sub-block providing
27         the synchronization.
28
29 SAI subnodes:
30 Two subnodes corresponding to SAI sub-block instances A et B can be defined.
31 Subnode can be omitted for unsused sub-block.
32
33 SAI subnodes required properties:
34   - compatible: Should be "st,stm32-sai-sub-a" or "st,stm32-sai-sub-b"
35         for SAI sub-block A or B respectively.
36   - reg: Base address and size of SAI sub-block register set.
37   - clocks: Must contain one phandle and clock specifier pair
38         for sai_ck which feeds the internal clock generator.
39   - clock-names: Must contain "sai_ck".
40   - dmas: see Documentation/devicetree/bindings/dma/stm32-dma.txt
41   - dma-names: identifier string for each DMA request line
42         "tx": if sai sub-block is configured as playback DAI
43         "rx": if sai sub-block is configured as capture DAI
44   - pinctrl-names: should contain only value "default"
45   - pinctrl-0: see Documentation/devicetree/bindings/pinctrl/pinctrl-stm32.txt
46
47 The device node should contain one 'port' child node with one child 'endpoint'
48 node, according to the bindings defined in Documentation/devicetree/bindings/
49 graph.txt.
50
51 Example:
52 sound_card {
53         compatible = "audio-graph-card";
54         dais = <&sai1b_port>;
55 };
56
57 sai1: sai1@40015800 {
58         compatible = "st,stm32h7-sai";
59         #address-cells = <1>;
60         #size-cells = <1>;
61         ranges = <0 0x40015800 0x400>;
62         reg = <0x40015800 0x4>;
63         clocks = <&rcc SAI1_CK>, <&rcc PLL1_Q>, <&rcc PLL2_P>;
64         clock-names = "pclk", "x8k", "x11k";
65         interrupts = <87>;
66
67         sai1a: audio-controller@40015804 {
68                 compatible = "st,stm32-sai-sub-a";
69                 reg = <0x4 0x1C>;
70                 clocks = <&rcc SAI1_CK>;
71                 clock-names = "sai_ck";
72                 dmas = <&dmamux1 1 87 0x400 0x0>;
73                 dma-names = "tx";
74                 pinctrl-names = "default";
75                 pinctrl-0 = <&pinctrl_sai1a>;
76
77                 sai1b_port: port {
78                         cpu_endpoint: endpoint {
79                                 remote-endpoint = <&codec_endpoint>;
80                                 format = "i2s";
81                         };
82                 };
83         };
84 };
85
86 audio-codec {
87         codec_port: port {
88                 codec_endpoint: endpoint {
89                         remote-endpoint = <&cpu_endpoint>;
90                 };
91         };
92 };