1 STMicroelectronics STM32 DFSDM ADC device driver
4 STM32 DFSDM ADC is a sigma delta analog-to-digital converter dedicated to
5 interface external sigma delta modulators to STM32 micro controllers.
6 It is mainly targeted for:
7 - Sigma delta modulators (motor control, metering...)
8 - PDM microphones (audio digital microphone)
10 It features up to 8 serial digital interfaces (SPI or Manchester) and
11 up to 4 filters on stm32h7.
13 Each child node match with a filter instance.
15 Contents of a STM32 DFSDM root node:
16 ------------------------------------
18 - compatible: Should be "st,stm32h7-dfsdm".
19 - reg: Offset and length of the DFSDM block register set.
20 - clocks: IP and serial interfaces clocking. Should be set according
21 to rcc clock ID and "clock-names".
22 - clock-names: Input clock name "dfsdm" must be defined,
23 "audio" is optional. If defined CLKOUT is based on the audio
24 clock, else "dfsdm" is used.
25 - #interrupt-cells = <1>;
26 - #address-cells = <1>;
30 - spi-max-frequency: Requested only for SPI master mode.
31 SPI clock OUT frequency (Hz). This clock must be set according
32 to "clock" property. Frequency must be a multiple of the rcc
33 clock frequency. If not, SPI CLKOUT frequency will not be
36 Contents of a STM32 DFSDM child nodes:
37 --------------------------------------
40 - compatible: Must be:
41 "st,stm32-dfsdm-adc" for sigma delta ADCs
42 "st,stm32-dfsdm-dmic" for audio digital microphone.
43 - reg: Specifies the DFSDM filter instance used.
44 - interrupts: IRQ lines connected to each DFSDM filter instance.
45 - st,adc-channels: List of single-ended channels muxed for this ADC.
47 "st,stm32h7-dfsdm" compatibility: 0 to 7.
48 - st,adc-channel-names: List of single-ended channel names.
49 - st,filter-order: SinC filter order from 0 to 5.
52 For audio purpose it is recommended to use order 3 to 5.
53 - #io-channel-cells = <1>: See the IIO bindings section "IIO consumers".
55 Required properties for "st,stm32-dfsdm-adc" compatibility:
56 - io-channels: From common IIO binding. Used to pipe external sigma delta
57 modulator or internal ADC output to DFSDM channel.
58 This is not required for "st,stm32-dfsdm-pdm" compatibility as
59 PDM microphone is binded in Audio DT node.
61 Required properties for "st,stm32-dfsdm-pdm" compatibility:
62 - #sound-dai-cells: Must be set to 0.
63 - dma: DMA controller phandle and DMA request line associated to the
64 filter instance (specified by the field "reg")
65 - dma-names: Must be "rx"
68 - st,adc-channel-types: Single-ended channel input type.
69 - "SPI_R": SPI with data on rising edge (default)
70 - "SPI_F": SPI with data on falling edge
71 - "MANCH_R": manchester codec, rising edge = logic 0
72 - "MANCH_F": manchester codec, falling edge = logic 1
73 - st,adc-channel-clk-src: Conversion clock source.
74 - "CLKIN": external SPI clock (CLKIN x)
75 - "CLKOUT": internal SPI clock (CLKOUT) (default)
76 - "CLKOUT_F": internal SPI clock divided by 2 (falling edge).
77 - "CLKOUT_R": internal SPI clock divided by 2 (rising edge).
79 - st,adc-alt-channel: Must be defined if two sigma delta modulator are
80 connected on same SPI input.
81 If not set, channel n is connected to SPI input n.
82 If set, channel n is connected to SPI input n + 1.
84 - st,filter0-sync: Set to 1 to synchronize with DFSDM filter instance 0.
85 Used for multi microphones synchronization.
87 Example of a sigma delta adc connected on DFSDM SPI port 0
88 and a pdm microphone connected on DFSDM SPI port 1:
90 ads1202: simple_sd_adc@0 {
91 compatible = "ads1202";
92 #io-channel-cells = <1>;
95 dfsdm: dfsdm@40017000 {
96 compatible = "st,stm32h7-dfsdm";
97 reg = <0x40017000 0x400>;
98 clocks = <&rcc DFSDM1_CK>;
99 clock-names = "dfsdm";
100 #interrupt-cells = <1>;
101 #address-cells = <1>;
104 dfsdm_adc0: filter@0 {
105 compatible = "st,stm32-dfsdm-adc";
106 #io-channel-cells = <1>;
109 st,adc-channels = <0>;
110 st,adc-channel-names = "sd_adc0";
111 st,adc-channel-types = "SPI_F";
112 st,adc-channel-clk-src = "CLKOUT";
113 io-channels = <&ads1202 0>;
114 st,filter-order = <3>;
116 dfsdm_pdm1: filter@1 {
117 compatible = "st,stm32-dfsdm-dmic";
120 dmas = <&dmamux1 102 0x400 0x00>;
122 st,adc-channels = <1>;
123 st,adc-channel-names = "dmic1";
124 st,adc-channel-types = "SPI_R";
125 st,adc-channel-clk-src = "CLKOUT";
126 st,filter-order = <5>;