STMicroelectronics STM32 Serial Audio Interface (SAI)

Schema identifier ($id): "http://devicetree.org/schemas/sound/st,stm32-sai.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "Olivier Moysan <olivier.moysan@foss.st.com>"

The SAI interface (Serial Audio Interface) offers a wide set of audio protocols as I2S standards, LSB or MSB-justified, PCM/DSP, TDM, and AC'97. The SAI contains two independent audio sub-blocks. Each sub-block has its own clock generator and I/O lines controller.

Properties and child nodes (properties) #

compatible — required here #

Allowed values (enum): "st,stm32f4-sai", "st,stm32h7-sai", "st,stm32mp25-sai"

reg — required here #

Array item rules (items) #

Item 1

Base address and size of SAI common register set.

Item 2

Base address and size of SAI identification register set.

Minimum number of items (minItems): 1

ranges — required here #

Maximum number of items (maxItems): 1

interrupts — not listed as required here #

Maximum number of items (maxItems): 1

resets — not listed as required here #

Maximum number of items (maxItems): 1

#address-cells — required here #

Exact value (const): 1

#size-cells — required here #

Exact value (const): 1

clocks — required here #

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 3

clock-names — required here #

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 3

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", "ranges", "#address-cells", "#size-cells", "clocks", "clock-names"

Properties matching a name pattern (patternProperties) #

^audio-controller@[0-9a-f]+$ — name matches this regular expression #

Value type (type): "object"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

Two subnodes corresponding to SAI sub-block instances A et B can be defined. Subnode can be omitted for unused sub-block.

Properties and child nodes (properties) #

compatible — required here

Compatible for SAI sub-block A or B.

String pattern (pattern): "^st,stm32-sai-sub-[ab]$"

#sound-dai-cells — required here

Exact value (const): 0

reg — required here

Maximum number of items (maxItems): 1

clocks — required here

Array item rules (items)

Item 1

sai_ck clock feeding the internal clock generator.

Item 2

MCLK clock from a SAI set as master clock provider.

Minimum number of items (minItems): 1

clock-names — required here

Array item rules (items)

Item 1

Exact value (const): "sai_ck"

Item 2

Exact value (const): "MCLK"

Minimum number of items (minItems): 1

dmas — required here

Maximum number of items (maxItems): 1

dma-names — required here

rx: SAI sub-block is configured as a capture DAI. tx: SAI sub-block is configured as a playback DAI.

Allowed values (enum): "rx", "tx"

st,sync — not listed as required here

Configure the SAI sub-block as slave of another SAI sub-block. By default SAI sub-block is in asynchronous mode. Must contain the phandle and index of the SAI sub-block providing the synchronization.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle-array

Array item rules (items)

Item 1

Array item rules (items)

Item 1

phandle of the SAI sub-block

Item 2

index of the SAI sub-block

st,iec60958 — not listed as required here

If set, support S/PDIF IEC6958 protocol for playback. IEC60958 protocol is not available for capture. By default, custom protocol is assumed, meaning that protocol is configured according to protocol defined in related DAI link node, such as i2s, left justified, right justified, dsp and pdm protocols.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/flag

#clock-cells — not listed as required here

Configure the SAI device as master clock provider.

Exact value (const): 0

port — not listed as required here

Shared schema rule ($ref): audio-graph-port.yaml#

Properties not evaluated by applicable rules (unevaluatedProperties)

false

Not allowed by this rule.

Required in this object (required): "compatible", "#sound-dai-cells", "reg", "clocks", "clock-names", "dmas", "dma-names"

All of these rules must match (allOf) #

Rule 1 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Exact value (const): "st,stm32f4-sai"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Array item rules (items)

Item 1

x8k, SAI parent clock for sampling rates multiple of 8kHz.

Item 2

x11k, SAI parent clock for sampling rates multiple of 11.025kHz.

clock-names — not listed as required here

Array item rules (items)

Item 1

Exact value (const): "x8k"

Item 2

Exact value (const): "x11k"

Rule 2 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Exact value (const): "st,stm32h7-sai"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Array item rules (items)

Item 1

pclk feeds the peripheral bus interface.

Item 2

x8k, SAI parent clock for sampling rates multiple of 8kHz.

Item 3

x11k, SAI parent clock for sampling rates multiple of 11.025kHz.

clock-names — not listed as required here

Array item rules (items)

Item 1

Exact value (const): "pclk"

Item 2

Exact value (const): "x8k"

Item 3

Exact value (const): "x11k"

Rule 3 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Exact value (const): "st,stm32mp25-sai"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Array item rules (items)

Item 1

pclk feeds the peripheral bus interface.

clock-names — not listed as required here

Array item rules (items)

Item 1

Exact value (const): "pclk"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

Examples (examples) #

#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
#include <dt-bindings/reset/stm32mp1-resets.h>
sai2: sai@4400b000 {
  compatible = "st,stm32h7-sai";
  #address-cells = <1>;
  #size-cells = <1>;
  ranges = <0 0x4400b000 0x400>;
  reg = <0x4400b000 0x4>, <0x4400b3f0 0x10>;
  clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
  clock-names = "pclk", "x8k", "x11k";
  pinctrl-names = "default", "sleep";
  pinctrl-0 = <&sai2a_pins_a>, <&sai2b_pins_b>;
  pinctrl-1 = <&sai2a_sleep_pins_a>, <&sai2b_sleep_pins_b>;

  sai2a: audio-controller@4400b004 {
    #sound-dai-cells = <0>;
    compatible = "st,stm32-sai-sub-a";
    reg = <0x4 0x1c>;
    dmas = <&dmamux1 89 0x400 0x01>;
    dma-names = "tx";
    clocks = <&rcc SAI2_K>;
    clock-names = "sai_ck";
  };
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

Edit this page