1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
4 $id: http://devicetree.org/schemas/iio/adc/st,stm32-dfsdm-adc.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
7 title: STMicroelectronics STM32 DFSDM ADC device driver
10 - Fabrice Gasnier <fabrice.gasnier@foss.st.com>
11 - Olivier Moysan <olivier.moysan@foss.st.com>
14 STM32 DFSDM ADC is a sigma delta analog-to-digital converter dedicated to
15 interface external sigma delta modulators to STM32 micro controllers.
16 It is mainly targeted for:
17 - Sigma delta modulators (motor control, metering...)
18 - PDM microphones (audio digital microphone)
20 It features up to 8 serial digital interfaces (SPI or Manchester) and
21 up to 4 filters on stm32h7 or 6 filters on stm32mp1.
23 Each child node matches with a filter instance.
37 Internal clock used for DFSDM digital processing and control blocks.
38 dfsdm clock can also feed CLKOUT, when CLKOUT is used.
39 - description: audio clock can be used as an alternate to feed CLKOUT.
56 SPI clock OUT frequency (Hz). Requested only for SPI master mode.
57 This clock must be set according to the "clock" property.
58 Frequency must be a multiple of the rcc clock frequency.
59 If not, SPI CLKOUT frequency will not be accurate.
70 additionalProperties: false
75 unevaluatedProperties: false
76 description: child node
85 description: Specifies the DFSDM filter instance used.
93 List of single-ended channels muxed for this ADC.
94 On stm32h7 and stm32mp1:
95 - For st,stm32-dfsdm-adc: up to 8 channels numbered from 0 to 7.
96 - For st,stm32-dfsdm-dmic: 1 channel numbered from 0 to 7.
97 $ref: /schemas/types.yaml#/definitions/uint32-array
102 st,adc-channel-names:
103 description: List of single-ended channel names.
107 SinC filter order from 0 to 5.
109 - [1-5]: order 1 to 5.
110 For audio purpose it is recommended to use order 3 to 5.
111 $ref: /schemas/types.yaml#/definitions/uint32
117 st,adc-channel-types:
119 Single-ended channel input type.
120 - "SPI_R": SPI with data on rising edge (default)
121 - "SPI_F": SPI with data on falling edge
122 - "MANCH_R": manchester codec, rising edge = logic 0, falling edge = logic 1
123 - "MANCH_F": manchester codec, rising edge = logic 1, falling edge = logic 0
125 enum: [ SPI_R, SPI_F, MANCH_R, MANCH_F ]
126 $ref: /schemas/types.yaml#/definitions/non-unique-string-array
128 st,adc-channel-clk-src:
130 Conversion clock source.
131 - "CLKIN": external SPI clock (CLKIN x)
132 - "CLKOUT": internal SPI clock (CLKOUT) (default)
133 - "CLKOUT_F": internal SPI clock divided by 2 (falling edge).
134 - "CLKOUT_R": internal SPI clock divided by 2 (rising edge).
136 enum: [ CLKIN, CLKOUT, CLKOUT_F, CLKOUT_R ]
137 $ref: /schemas/types.yaml#/definitions/non-unique-string-array
141 Must be defined if two sigma delta modulators are
142 connected on same SPI input.
143 If not set, channel n is connected to SPI input n.
144 If set, channel n is connected to SPI input n + 1.
149 Set to 1 to synchronize with DFSDM filter instance 0.
150 Used for multi microphones synchronization.
165 - st,adc-channel-names
167 - "#io-channel-cells"
174 const: st,stm32-dfsdm-adc
182 st,adc-channel-names:
186 st,adc-channel-types:
190 st,adc-channel-clk-src:
196 From common IIO binding. Used to pipe external sigma delta
197 modulator or internal ADC output to DFSDM channel.
206 const: st,stm32-dfsdm-dmic
213 st,adc-channel-names:
216 st,adc-channel-types:
219 st,adc-channel-clk-src:
229 additionalProperties: false
230 description: child node
235 - st,stm32h7-dfsdm-dai
242 From common IIO binding. Used to pipe external sigma delta
243 modulator or internal ADC output to DFSDM channel.
255 const: st,stm32h7-dfsdm
270 const: st,stm32mp1-dfsdm
283 #include <dt-bindings/interrupt-controller/arm-gic.h>
284 #include <dt-bindings/clock/stm32mp1-clks.h>
285 dfsdm: dfsdm@4400d000 {
286 compatible = "st,stm32mp1-dfsdm";
287 reg = <0x4400d000 0x800>;
288 clocks = <&rcc DFSDM_K>, <&rcc ADFSDM_K>;
289 clock-names = "dfsdm", "audio";
290 #address-cells = <1>;
294 compatible = "st,stm32-dfsdm-dmic";
296 interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
297 dmas = <&dmamux1 101 0x400 0x01>;
299 #io-channel-cells = <1>;
300 st,adc-channels = <1>;
301 st,adc-channel-names = "dmic0";
302 st,adc-channel-types = "SPI_R";
303 st,adc-channel-clk-src = "CLKOUT";
304 st,filter-order = <5>;
306 asoc_pdm0: dfsdm-dai {
307 compatible = "st,stm32h7-dfsdm-dai";
308 #sound-dai-cells = <0>;
309 io-channels = <&dfsdm0 0>;
313 dfsdm_pdm1: filter@1 {
314 compatible = "st,stm32-dfsdm-adc";
316 interrupts = <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>;
317 dmas = <&dmamux1 102 0x400 0x01>;
319 #io-channel-cells = <1>;
320 st,adc-channels = <2 3>;
321 st,adc-channel-names = "in2", "in3";
322 st,adc-channel-types = "SPI_R", "SPI_R";
323 st,adc-channel-clk-src = "CLKOUT_F", "CLKOUT_F";
324 io-channels = <&sd_adc2 &sd_adc3>;
325 st,filter-order = <1>;