STMicroelectronics STM32 DFSDM ADC device driver
Schema identifier ($id): "http://devicetree.org/schemas/iio/adc/st,stm32-dfsdm-adc.yaml#"
Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"
Maintainers (maintainers): "Fabrice Gasnier <fabrice.gasnier@foss.st.com>", "Olivier Moysan <olivier.moysan@foss.st.com>"
STM32 DFSDM ADC is a sigma delta analog-to-digital converter dedicated to interface external sigma delta modulators to STM32 micro controllers. It is mainly targeted for: - Sigma delta modulators (motor control, metering...) - PDM microphones (audio digital microphone)
It features up to 8 serial digital interfaces (SPI or Manchester) and up to 4 filters on stm32h7 or 6 filters on stm32mp1.
Each child node matches with a filter instance.
Properties and child nodes (properties) #
compatible — required here #
Allowed values (enum): "st,stm32h7-dfsdm", "st,stm32mp1-dfsdm"
reg — required here #
Maximum number of items (maxItems): 1
clocks — required here #
Array item rules (items) #
Item 1
Internal clock used for DFSDM digital processing and control blocks. dfsdm clock can also feed CLKOUT, when CLKOUT is used.
Item 2
audio clock can be used as an alternate to feed CLKOUT.
Minimum number of items (minItems): 1
clock-names — required here #
Array item rules (items) #
Item 1
Exact value (
const):"dfsdm"
Item 2
Exact value (
const):"audio"
Minimum number of items (minItems): 1
#address-cells — required here #
Exact value (const): 1
#size-cells — required here #
Exact value (const): 0
spi-max-frequency — not listed as required here #
SPI clock OUT frequency (Hz). Requested only for SPI master mode. This clock must be set according to the "clock" property. Frequency must be a multiple of the rcc clock frequency. If not, SPI CLKOUT frequency will not be accurate.
Maximum value (maximum): 20000000
access-controllers — not listed as required here #
Minimum number of items (minItems): 1
Maximum number of items (maxItems): 2
Required in this object (required): "compatible", "reg", "clocks", "clock-names", "#address-cells", "#size-cells"
Properties not matched by properties or patternProperties in this schema (additionalProperties) #
false
Not allowed by this rule.
Properties matching a name pattern (patternProperties) #
^filter@[0-9]+$ — name matches this regular expression #
Value type (type): "object"
Properties not evaluated by applicable rules (unevaluatedProperties) #
false
Not allowed by this rule.
child node
Properties and child nodes (properties) #
compatible — required here
Allowed values (enum): "st,stm32-dfsdm-adc", "st,stm32-dfsdm-dmic"
reg — required here
Specifies the DFSDM filter instance used.
Maximum number of items (maxItems): 1
interrupts — required here
Maximum number of items (maxItems): 1
st,adc-channels — not listed as required here
List of single-ended channels muxed for this ADC. On stm32h7 and stm32mp1: - For st,stm32-dfsdm-adc: up to 8 channels numbered from 0 to 7. - For st,stm32-dfsdm-dmic: 1 channel numbered from 0 to 7.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32-array
Array item rules (items)
Minimum value (
minimum):0Maximum value (
maximum):7
Deprecated (deprecated): true
st,adc-channel-names — not listed as required here
List of single-ended channel names.
Deprecated (deprecated): true
st,filter-order — required here
SinC filter order from 0 to 5. - 0: FastSinC - [1-5]: order 1 to 5. For audio purpose it is recommended to use order 3 to 5.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32
Maximum value (maximum): 5
#io-channel-cells — required here
Exact value (const): 1
#address-cells — not listed as required here
Exact value (const): 1
#size-cells — not listed as required here
Exact value (const): 0
st,adc-channel-types — not listed as required here
Single-ended channel input type. - "SPI_R": SPI with data on rising edge (default) - "SPI_F": SPI with data on falling edge - "MANCH_R": manchester codec, rising edge = logic 0, falling edge = logic 1 - "MANCH_F": manchester codec, rising edge = logic 1, falling edge = logic 0
Array item rules (items)
Allowed values (
enum):"SPI_R","SPI_F","MANCH_R","MANCH_F"
Shared schema rule ($ref): /schemas/types.yaml#/definitions/non-unique-string-array
Deprecated (deprecated): true
st,adc-channel-clk-src — not listed as required here
Conversion clock source. - "CLKIN": external SPI clock (CLKIN x) - "CLKOUT": internal SPI clock (CLKOUT) (default) - "CLKOUT_F": internal SPI clock divided by 2 (falling edge). - "CLKOUT_R": internal SPI clock divided by 2 (rising edge).
Array item rules (items)
Allowed values (
enum):"CLKIN","CLKOUT","CLKOUT_F","CLKOUT_R"
Shared schema rule ($ref): /schemas/types.yaml#/definitions/non-unique-string-array
Deprecated (deprecated): true
st,adc-alt-channel — not listed as required here
Must be defined if two sigma delta modulators are connected on same SPI input. If not set, channel n is connected to SPI input n. If set, channel n is connected to SPI input n + 1.
Value type (type): "boolean"
Deprecated (deprecated): true
st,filter0-sync — not listed as required here
Set to 1 to synchronize with DFSDM filter instance 0. Used for multi microphones synchronization.
Value type (type): "boolean"
dmas — not listed as required here
Maximum number of items (maxItems): 1
dma-names — not listed as required here
Array item rules (items)
Item 1
Exact value (
const):"rx"
Required in this object (required): "compatible", "reg", "interrupts", "st,filter-order", "#io-channel-cells"
Properties matching a name pattern (patternProperties) #
^channel@[0-7]$ — name matches this regular expression
Value type (type): "object"
Shared schema rule ($ref): adc.yaml
Properties not evaluated by applicable rules (unevaluatedProperties)
false
Not allowed by this rule.
Represents the external channels which are connected to the DFSDM.
Properties and child nodes (properties)
reg — required here
Maximum value (maximum): 7
label — not listed as required here
Unique name to identify which channel this is.
st,adc-channel-type — not listed as required here
Single-ended channel input type. - "SPI_R": SPI with data on rising edge (default) - "SPI_F": SPI with data on falling edge - "MANCH_R": manchester codec, rising edge = logic 0, falling edge = logic 1 - "MANCH_F": manchester codec, rising edge = logic 1, falling edge = logic 0
Shared schema rule ($ref): /schemas/types.yaml#/definitions/string
Allowed values (enum): "SPI_R", "SPI_F", "MANCH_R", "MANCH_F"
st,adc-channel-clk-src — not listed as required here
Conversion clock source. - "CLKIN": external SPI clock (CLKIN x) - "CLKOUT": internal SPI clock (CLKOUT) (default) - "CLKOUT_F": internal SPI clock divided by 2 (falling edge). - "CLKOUT_R": internal SPI clock divided by 2 (rising edge).
Shared schema rule ($ref): /schemas/types.yaml#/definitions/string
Allowed values (enum): "CLKIN", "CLKOUT", "CLKOUT_F", "CLKOUT_R"
st,adc-alt-channel — not listed as required here
Must be defined if two sigma delta modulators are connected on same SPI input. If not set, channel n is connected to SPI input n. If set, channel n is connected to SPI input n + 1.
Value type (type): "boolean"
io-backends — not listed as required here
Used to pipe external sigma delta modulator or internal ADC backend to DFSDM channel.
Maximum number of items (maxItems): 1
Required in this object (required): "reg"
All of these rules must match (allOf) #
Rule 1
Condition (
if)Properties and child nodes (
properties)
compatible— not listed as required hereRule for matching array elements (
contains)Exact value (
const):"st,stm32-dfsdm-adc"When the condition matches (
then)Properties and child nodes (
properties)
st,adc-channels— not listed as required hereMinimum number of items (
minItems):1Maximum number of items (
maxItems):8
st,adc-channel-names— not listed as required hereMinimum number of items (
minItems):1Maximum number of items (
maxItems):8
st,adc-channel-types— not listed as required hereMinimum number of items (
minItems):1Maximum number of items (
maxItems):8
st,adc-channel-clk-src— not listed as required hereMinimum number of items (
minItems):1Maximum number of items (
maxItems):8
io-channels— not listed as required hereFrom common IIO binding. Used to pipe external sigma delta modulator or internal ADC output to DFSDM channel.
Deprecated (
deprecated):trueCondition (
if)When the condition matches (
then)Properties matching a name pattern (
patternProperties)
^channel@[0-7]$— name matches this regular expression
Rule 2
Condition (
if)Properties and child nodes (
properties)
compatible— not listed as required hereRule for matching array elements (
contains)Exact value (
const):"st,stm32-dfsdm-dmic"When the condition matches (
then)Properties and child nodes (
properties)
st,adc-channels— not listed as required hereMaximum number of items (
maxItems):1
st,adc-channel-names— not listed as required hereMaximum number of items (
maxItems):1
st,adc-channel-types— not listed as required hereMaximum number of items (
maxItems):1
st,adc-channel-clk-src— not listed as required hereMaximum number of items (
maxItems):1Required in this object (
required):"dmas","dma-names"Properties matching a name pattern (
patternProperties)
^dfsdm-dai+$— name matches this regular expressionValue type (
type):"object"Properties not matched by properties or patternProperties in this schema (
additionalProperties)
falseNot allowed by this rule.
child node
Properties and child nodes (
properties)
compatible— required hereAllowed values (
enum):"st,stm32h7-dfsdm-dai"
#sound-dai-cells— required hereExact value (
const):0
io-channels— required hereFrom common IIO binding. Used to pipe external sigma delta modulator or internal ADC output to DFSDM channel.
port— not listed as required hereShared schema rule (
$ref):/schemas/sound/audio-graph-port.yaml#Properties not evaluated by applicable rules (
unevaluatedProperties)
falseNot allowed by this rule.
Required in this object (
required):"compatible","#sound-dai-cells","io-channels"
All of these rules must match (allOf) #
Rule 1 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereRule for matching array elements (
contains)Exact value (
const):"st,stm32h7-dfsdm"When the condition matches (
then) #Properties matching a name pattern (
patternProperties)
^filter@[0-9]+$— name matches this regular expressionProperties and child nodes (
properties)
reg— not listed as required hereArray item rules (
items)Minimum value (
minimum):0Maximum value (
maximum):3
Rule 2 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereRule for matching array elements (
contains)Exact value (
const):"st,stm32mp1-dfsdm"When the condition matches (
then) #Properties matching a name pattern (
patternProperties)
^filter@[0-9]+$— name matches this regular expressionProperties and child nodes (
properties)
reg— not listed as required hereArray item rules (
items)Minimum value (
minimum):0Maximum value (
maximum):5
Examples (examples) #
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
dfsdm: dfsdm@4400d000 {
compatible = "st,stm32mp1-dfsdm";
reg = <0x4400d000 0x800>;
clocks = <&rcc DFSDM_K>, <&rcc ADFSDM_K>;
clock-names = "dfsdm", "audio";
#address-cells = <1>;
#size-cells = <0>;
// Example 1: Audio use case with generic binding
dfsdm0: filter@0 {
compatible = "st,stm32-dfsdm-dmic";
reg = <0>;
interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&dmamux1 101 0x400 0x01>;
dma-names = "rx";
#io-channel-cells = <1>;
#address-cells = <1>;
#size-cells = <0>;
st,filter-order = <5>;
channel@1 {
reg = <1>;
label = "dmic0";
st,adc-channel-type = "SPI_R";
st,adc-channel-clk-src = "CLKOUT";
st,adc-alt-channel;
};
asoc_pdm0: dfsdm-dai {
compatible = "st,stm32h7-dfsdm-dai";
#sound-dai-cells = <0>;
io-channels = <&dfsdm0 0>;
};
};
// Example 2: Analog use case with generic binding
dfsdm1: filter@1 {
compatible = "st,stm32-dfsdm-adc";
reg = <1>;
interrupts = <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&dmamux1 102 0x400 0x01>;
dma-names = "rx";
st,filter-order = <1>;
#io-channel-cells = <1>;
#address-cells = <1>;
#size-cells = <0>;
channel@2 {
reg = <2>;
label = "in2";
st,adc-channel-type = "SPI_F";
st,adc-channel-clk-src = "CLKOUT";
st,adc-alt-channel;
io-backends = <&sd_adc2>;
};
channel@3 {
reg = <3>;
label = "in3";
st,adc-channel-type = "SPI_R";
st,adc-channel-clk-src = "CLKOUT";
io-backends = <&sd_adc3>;
};
};
};
Source notes #
Annotations retained from the schema source
Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)