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
35 - pinctrl-names: Set to "default".
36 - pinctrl-0: List of phandles pointing to pin configuration
37 nodes to set pins in mode of operation for dfsdm
40 Contents of a STM32 DFSDM child nodes:
41 --------------------------------------
44 - compatible: Must be:
45 "st,stm32-dfsdm-adc" for sigma delta ADCs
46 "st,stm32-dfsdm-dmic" for audio digital microphone.
47 - reg: Specifies the DFSDM filter instance used.
48 - interrupts: IRQ lines connected to each DFSDM filter instance.
49 - st,adc-channels: List of single-ended channels muxed for this ADC.
51 "st,stm32h7-dfsdm" compatibility: 0 to 7.
52 - st,adc-channel-names: List of single-ended channel names.
53 - st,filter-order: SinC filter order from 0 to 5.
56 For audio purpose it is recommended to use order 3 to 5.
57 - #io-channel-cells = <1>: See the IIO bindings section "IIO consumers".
59 Required properties for "st,stm32-dfsdm-adc" compatibility:
60 - io-channels: From common IIO binding. Used to pipe external sigma delta
61 modulator or internal ADC output to DFSDM channel.
62 This is not required for "st,stm32-dfsdm-pdm" compatibility as
63 PDM microphone is binded in Audio DT node.
65 Required properties for "st,stm32-dfsdm-pdm" compatibility:
66 - #sound-dai-cells: Must be set to 0.
67 - dma: DMA controller phandle and DMA request line associated to the
68 filter instance (specified by the field "reg")
69 - dma-names: Must be "rx"
72 - st,adc-channel-types: Single-ended channel input type.
73 - "SPI_R": SPI with data on rising edge (default)
74 - "SPI_F": SPI with data on falling edge
75 - "MANCH_R": manchester codec, rising edge = logic 0, falling edge = logic 1
76 - "MANCH_F": manchester codec, rising edge = logic 1, falling edge = logic 0
77 - st,adc-channel-clk-src: Conversion clock source.
78 - "CLKIN": external SPI clock (CLKIN x)
79 - "CLKOUT": internal SPI clock (CLKOUT) (default)
80 - "CLKOUT_F": internal SPI clock divided by 2 (falling edge).
81 - "CLKOUT_R": internal SPI clock divided by 2 (rising edge).
83 - st,adc-alt-channel: Must be defined if two sigma delta modulator are
84 connected on same SPI input.
85 If not set, channel n is connected to SPI input n.
86 If set, channel n is connected to SPI input n + 1.
88 - st,filter0-sync: Set to 1 to synchronize with DFSDM filter instance 0.
89 Used for multi microphones synchronization.
91 Example of a sigma delta adc connected on DFSDM SPI port 0
92 and a pdm microphone connected on DFSDM SPI port 1:
94 ads1202: simple_sd_adc@0 {
95 compatible = "ads1202";
96 #io-channel-cells = <1>;
99 dfsdm: dfsdm@40017000 {
100 compatible = "st,stm32h7-dfsdm";
101 reg = <0x40017000 0x400>;
102 clocks = <&rcc DFSDM1_CK>;
103 clock-names = "dfsdm";
104 #interrupt-cells = <1>;
105 #address-cells = <1>;
108 dfsdm_adc0: filter@0 {
109 compatible = "st,stm32-dfsdm-adc";
110 #io-channel-cells = <1>;
113 st,adc-channels = <0>;
114 st,adc-channel-names = "sd_adc0";
115 st,adc-channel-types = "SPI_F";
116 st,adc-channel-clk-src = "CLKOUT";
117 io-channels = <&ads1202 0>;
118 st,filter-order = <3>;
120 dfsdm_pdm1: filter@1 {
121 compatible = "st,stm32-dfsdm-dmic";
124 dmas = <&dmamux1 102 0x400 0x00>;
126 st,adc-channels = <1>;
127 st,adc-channel-names = "dmic1";
128 st,adc-channel-types = "SPI_R";
129 st,adc-channel-clk-src = "CLKOUT";
130 st,filter-order = <5>;