Merge branch 'etnaviv/fixes' of git://git.pengutronix.de/git/lst/linux
[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"
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 "x8k" and "x11k"
14         "x8k": SAI parent clock for sampling rates multiple of 8kHz.
15         "x11k": SAI parent clock for sampling rates multiple of 11.025kHz.
16   - interrupts: cpu DAI interrupt line shared by SAI sub-blocks
17
18 Optional properties:
19   - resets: Reference to a reset controller asserting the SAI
20
21 SAI subnodes:
22 Two subnodes corresponding to SAI sub-block instances A et B can be defined.
23 Subnode can be omitted for unsused sub-block.
24
25 SAI subnodes required properties:
26   - compatible: Should be "st,stm32-sai-sub-a" or "st,stm32-sai-sub-b"
27         for SAI sub-block A or B respectively.
28   - reg: Base address and size of SAI sub-block register set.
29   - clocks: Must contain one phandle and clock specifier pair
30         for sai_ck which feeds the internal clock generator.
31   - clock-names: Must contain "sai_ck".
32   - dmas: see Documentation/devicetree/bindings/dma/stm32-dma.txt
33   - dma-names: identifier string for each DMA request line
34         "tx": if sai sub-block is configured as playback DAI
35         "rx": if sai sub-block is configured as capture DAI
36   - pinctrl-names: should contain only value "default"
37   - pinctrl-0: see Documentation/devicetree/bindings/pinctrl/pinctrl-stm32.txt
38
39 Example:
40 sound_card {
41         compatible = "audio-graph-card";
42         dais = <&sai1b_port>;
43 };
44
45 sai1: sai1@40015800 {
46         compatible = "st,stm32f4-sai";
47         #address-cells = <1>;
48         #size-cells = <1>;
49         ranges;
50         reg = <0x40015800 0x4>;
51         clocks = <&rcc 1 CLK_SAIQ_PDIV>, <&rcc 1 CLK_I2SQ_PDIV>;
52         clock-names = "x8k", "x11k";
53         interrupts = <87>;
54
55         sai1b: audio-controller@40015824 {
56                 #sound-dai-cells = <0>;
57                 compatible = "st,stm32-sai-sub-b";
58                 reg = <0x40015824 0x1C>;
59                 clocks = <&rcc 1 CLK_SAI2>;
60                 clock-names = "sai_ck";
61                 dmas = <&dma2 5 0 0x400 0x0>;
62                 dma-names = "tx";
63                 pinctrl-names = "default";
64                 pinctrl-0 = <&pinctrl_sai1b>;
65
66                 ports {
67                         #address-cells = <1>;
68                         #size-cells = <0>;
69
70                         sai1b_port: port@0 {
71                                 reg = <0>;
72                                 cpu_endpoint: endpoint {
73                                         remote-endpoint = <&codec_endpoint>;
74                                         audio-graph-card,format = "i2s";
75                                         audio-graph-card,bitclock-master = <&codec_endpoint>;
76                                         audio-graph-card,frame-master = <&codec_endpoint>;
77                                 };
78                         };
79                 };
80         };
81 };
82
83 audio-codec {
84         codec_port: port {
85                 codec_endpoint: endpoint {
86                         remote-endpoint = <&cpu_endpoint>;
87                 };
88         };
89 };