xref: /freebsd/sys/contrib/device-tree/Bindings/sound/st,stm32-i2s.yaml (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/sound/st,stm32-i2s.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7c66ec88fSEmmanuel Vadottitle: STMicroelectronics STM32 SPI/I2S Controller
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
108cc087a1SEmmanuel Vadot  - Olivier Moysan <olivier.moysan@foss.st.com>
11c66ec88fSEmmanuel Vadot
12c66ec88fSEmmanuel Vadotdescription:
13c66ec88fSEmmanuel Vadot  The SPI/I2S block supports I2S/PCM protocols when configured on I2S mode.
14c66ec88fSEmmanuel Vadot  Only some SPI instances support I2S.
15c66ec88fSEmmanuel Vadot
168bab661aSEmmanuel VadotallOf:
178bab661aSEmmanuel Vadot  - $ref: dai-common.yaml#
188bab661aSEmmanuel Vadot
19c66ec88fSEmmanuel Vadotproperties:
20c66ec88fSEmmanuel Vadot  compatible:
21c66ec88fSEmmanuel Vadot    enum:
22c66ec88fSEmmanuel Vadot      - st,stm32h7-i2s
23c66ec88fSEmmanuel Vadot
24c66ec88fSEmmanuel Vadot  "#sound-dai-cells":
25c66ec88fSEmmanuel Vadot    const: 0
26c66ec88fSEmmanuel Vadot
27c66ec88fSEmmanuel Vadot  reg:
28c66ec88fSEmmanuel Vadot    maxItems: 1
29c66ec88fSEmmanuel Vadot
30c66ec88fSEmmanuel Vadot  clocks:
31c66ec88fSEmmanuel Vadot    items:
32c66ec88fSEmmanuel Vadot      - description: clock feeding the peripheral bus interface.
33c66ec88fSEmmanuel Vadot      - description: clock feeding the internal clock generator.
34c66ec88fSEmmanuel Vadot      - description: I2S parent clock for sampling rates multiple of 8kHz.
35c66ec88fSEmmanuel Vadot      - description: I2S parent clock for sampling rates multiple of 11.025kHz.
36c66ec88fSEmmanuel Vadot
37c66ec88fSEmmanuel Vadot  clock-names:
38c66ec88fSEmmanuel Vadot    items:
39c66ec88fSEmmanuel Vadot      - const: pclk
40c66ec88fSEmmanuel Vadot      - const: i2sclk
41c66ec88fSEmmanuel Vadot      - const: x8k
42c66ec88fSEmmanuel Vadot      - const: x11k
43c66ec88fSEmmanuel Vadot
44c66ec88fSEmmanuel Vadot  interrupts:
45c66ec88fSEmmanuel Vadot    maxItems: 1
46c66ec88fSEmmanuel Vadot
47c66ec88fSEmmanuel Vadot  dmas:
48c66ec88fSEmmanuel Vadot    items:
49c66ec88fSEmmanuel Vadot      - description: audio capture DMA.
50c66ec88fSEmmanuel Vadot      - description: audio playback DMA.
51c66ec88fSEmmanuel Vadot
52c66ec88fSEmmanuel Vadot  dma-names:
53c66ec88fSEmmanuel Vadot    items:
54c66ec88fSEmmanuel Vadot      - const: rx
55c66ec88fSEmmanuel Vadot      - const: tx
56c66ec88fSEmmanuel Vadot
57c66ec88fSEmmanuel Vadot  resets:
58c66ec88fSEmmanuel Vadot    maxItems: 1
59c66ec88fSEmmanuel Vadot
605def4c47SEmmanuel Vadot  "#clock-cells":
615def4c47SEmmanuel Vadot    description: Configure the I2S device as MCLK clock provider.
625def4c47SEmmanuel Vadot    const: 0
635def4c47SEmmanuel Vadot
64*f126890aSEmmanuel Vadot  port:
65*f126890aSEmmanuel Vadot    $ref: audio-graph-port.yaml#
66*f126890aSEmmanuel Vadot    unevaluatedProperties: false
67*f126890aSEmmanuel Vadot
68c66ec88fSEmmanuel Vadotrequired:
69c66ec88fSEmmanuel Vadot  - compatible
70c66ec88fSEmmanuel Vadot  - "#sound-dai-cells"
71c66ec88fSEmmanuel Vadot  - reg
72c66ec88fSEmmanuel Vadot  - clocks
73c66ec88fSEmmanuel Vadot  - clock-names
74c66ec88fSEmmanuel Vadot  - interrupts
75c66ec88fSEmmanuel Vadot  - dmas
76c66ec88fSEmmanuel Vadot  - dma-names
77c66ec88fSEmmanuel Vadot
788bab661aSEmmanuel VadotunevaluatedProperties: false
79c66ec88fSEmmanuel Vadot
80c66ec88fSEmmanuel Vadotexamples:
81c66ec88fSEmmanuel Vadot  - |
82c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
83c66ec88fSEmmanuel Vadot    #include <dt-bindings/clock/stm32mp1-clks.h>
84c66ec88fSEmmanuel Vadot    i2s2: audio-controller@4000b000 {
85c66ec88fSEmmanuel Vadot        compatible = "st,stm32h7-i2s";
86c66ec88fSEmmanuel Vadot        #sound-dai-cells = <0>;
87c66ec88fSEmmanuel Vadot        reg = <0x4000b000 0x400>;
88c66ec88fSEmmanuel Vadot        clocks = <&rcc SPI2>, <&rcc SPI2_K>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
89c66ec88fSEmmanuel Vadot        clock-names = "pclk", "i2sclk", "x8k", "x11k";
90c66ec88fSEmmanuel Vadot        interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
91c66ec88fSEmmanuel Vadot        dmas = <&dmamux1 39 0x400 0x01>,
92c66ec88fSEmmanuel Vadot               <&dmamux1 40 0x400 0x01>;
93c66ec88fSEmmanuel Vadot        dma-names = "rx", "tx";
94c66ec88fSEmmanuel Vadot        pinctrl-names = "default";
95c66ec88fSEmmanuel Vadot        pinctrl-0 = <&i2s2_pins_a>;
96*f126890aSEmmanuel Vadot
97*f126890aSEmmanuel Vadot        /* assume audio-graph */
98*f126890aSEmmanuel Vadot        port {
99*f126890aSEmmanuel Vadot            codec_endpoint: endpoint {
100*f126890aSEmmanuel Vadot                remote-endpoint = <&codec_endpoint>;
101*f126890aSEmmanuel Vadot            };
102*f126890aSEmmanuel Vadot        };
103c66ec88fSEmmanuel Vadot    };
104c66ec88fSEmmanuel Vadot
105c66ec88fSEmmanuel Vadot...
106