Freescale Synchronous Audio Interface (SAI).

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

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

Maintainers (maintainers): "Shengjiu Wang <shengjiu.wang@nxp.com>"

The SAI is based on I2S module that used communicating with audio codecs, which provides a synchronous audio interface that supports fullduplex serial interfaces with frame synchronization such as I2S, AC97, TDM, and codec/DSP interfaces.

Properties and child nodes (properties) #

compatible — required here #

Exactly one of these rules must match (oneOf) #

Rule 1

Array item rules (items)

Item 1

Allowed values (enum): "fsl,imx6ul-sai", "fsl,imx7d-sai"

Item 2

Exact value (const): "fsl,imx6sx-sai"

Rule 2

Array item rules (items)

Item 1

Allowed values (enum): "fsl,imx8mm-sai", "fsl,imx8mn-sai", "fsl,imx8mp-sai"

Item 2

Exact value (const): "fsl,imx8mq-sai"

Rule 3

Array item rules (items)

Item 1

Allowed values (enum): "fsl,imx6sx-sai", "fsl,imx7ulp-sai", "fsl,imx8mq-sai", "fsl,imx8qm-sai", "fsl,imx8ulp-sai", "fsl,imx93-sai", "fsl,imx95-sai", "fsl,vf610-sai"

Rule 4

Array item rules (items)

Item 1

Allowed values (enum): "fsl,imx94-sai", "fsl,imx952-sai"

Item 2

Exact value (const): "fsl,imx95-sai"

reg — required here #

Maximum number of items (maxItems): 1

clocks — required here #

Array item rules (items) #

Item 1

The ipg clock for register access

Item 2

master clock source 0 (obsoleted)

Item 3

master clock source 1

Item 4

master clock source 2

Item 5

master clock source 3

Item 6

PLL clock source for 8kHz series

Item 7

PLL clock source for 11kHz series

Minimum number of items (minItems): 4

clock-names — required here #

Exactly one of these rules must match (oneOf) #

Rule 1

Array item rules (items)

Item 1

Exact value (const): "bus"

Item 2

Exact value (const): "mclk0"

Item 3

Exact value (const): "mclk1"

Item 4

Exact value (const): "mclk2"

Item 5

Exact value (const): "mclk3"

Item 6

Exact value (const): "pll8k"

Item 7

Exact value (const): "pll11k"

Minimum number of items (minItems): 5

Rule 2

Array item rules (items)

Item 1

Exact value (const): "bus"

Item 2

Exact value (const): "mclk1"

Item 3

Exact value (const): "mclk2"

Item 4

Exact value (const): "mclk3"

Item 5

Exact value (const): "pll8k"

Item 6

Exact value (const): "pll11k"

Minimum number of items (minItems): 4

power-domains — not listed as required here #

Maximum number of items (maxItems): 1

dmas — required here #

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 2

dma-names — required here #

Minimum number of items (minItems): 1

Array item rules (items) #

Item 1

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

Item 2

Exact value (const): "tx"

interrupts — required here #

Array item rules (items) #

Item 1

receive and transmit interrupt

ports — not listed as required here #

Shared schema rule ($ref): /schemas/graph.yaml#/properties/ports

Properties and child nodes (properties) #

port@0 — 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.

port for TX and RX

port@1 — 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.

port for TX only

port@2 — 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.

port for RX only

big-endian — not listed as required here #

required if all the SAI registers are big-endian rather than little-endian.

Value type (type): "boolean"

fsl,dataline — not listed as required here #

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

Configure the dataline. It has 3 value for each configuration

Maximum number of items (maxItems): 16

Array item rules (items) #

Array item rules (items)

Item 1

format Default(0), I2S(1) or PDM(2)

Allowed values (enum): 0, 1, 2

Item 2

dataline mask for 'rx'

Item 3

dataline mask for 'tx'

fsl,sai-amix-mode — not listed as required here #

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

The audmix module is bypassed from hardware or not.

Allowed values (enum): "none", "bypass", "audmix"

Default value (default): "none"

fsl,sai-mclk-direction-output — not listed as required here #

SAI will output the SAI MCLK clock.

Value type (type): "boolean"

fsl,sai-synchronous-rx — not listed as required here #

SAI will work in the synchronous mode (sync Tx with Rx) which means both the transmitter and the receiver will send and receive data by following receiver's bit clocks and frame sync clocks.

Value type (type): "boolean"

fsl,sai-asynchronous — not listed as required here #

SAI will work in the asynchronous mode, which means both transmitter and receiver will send and receive data by following their own bit clocks and frame sync clocks separately. If both fsl,sai-asynchronous and fsl,sai-synchronous-rx are absent, the default synchronous mode (sync Rx with Tx) will be used, which means both transmitter and receiver will send and receive data by following clocks of transmitter.

Value type (type): "boolean"

fsl,shared-interrupt — not listed as required here #

Interrupt is shared with other modules.

Value type (type): "boolean"

lsb-first — not listed as required here #

Configures whether the LSB or the MSB is transmitted first for the fifo data. If this property is absent, the MSB is transmitted first as default, or the LSB is transmitted first.

Value type (type): "boolean"

#sound-dai-cells — not listed as required here #

Exact value (const): 0

optional, some dts node didn't add it.

All of these rules must match (allOf) #

Rule 1 #

Shared schema rule ($ref): dai-common.yaml#

Rule 2 #

Condition (if) #

Required in this object (required): "fsl,sai-asynchronous"

When the condition matches (then) #

Properties and child nodes (properties)

fsl,sai-synchronous-rx — not listed as required here

false — Not permitted by this property rule.

Rule 3 #

Condition (if) #

Required in this object (required): "fsl,sai-amix-mode"

When the condition matches (then) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Exact value (const): "fsl,imx952-sai"

Required in this object (required): "compatible", "reg", "clocks", "clock-names", "dmas", "dma-names", "interrupts"

Properties not evaluated by applicable rules (unevaluatedProperties) #

false

Not allowed by this rule.

Examples (examples) #

#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/vf610-clock.h>
sai2: sai@40031000 {
    compatible = "fsl,vf610-sai";
    reg = <0x40031000 0x1000>;
    interrupts = <86 IRQ_TYPE_LEVEL_HIGH>;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_sai2_1>;
    clocks = <&clks VF610_CLK_PLATFORM_BUS>,
             <&clks VF610_CLK_SAI2>,
             <&clks 0>, <&clks 0>;
    clock-names = "bus", "mclk1", "mclk2", "mclk3";
    dma-names = "rx", "tx";
    dmas = <&edma0 0 20>, <&edma0 0 21>;
    big-endian;
    lsb-first;
};
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/imx8mm-clock.h>
sai1: sai@30010000 {
    compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai";
    reg = <0x30010000 0x10000>;
    interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
    clocks = <&clk IMX8MM_CLK_SAI1_IPG>,
             <&clk IMX8MM_CLK_DUMMY>,
             <&clk IMX8MM_CLK_SAI1_ROOT>,
             <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
    clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
    dmas = <&sdma2 0 2 0>, <&sdma2 1 2 0>;
    dma-names = "rx", "tx";
    fsl,dataline = <1 0xff 0xff 2 0xff 0x11>;
    #sound-dai-cells = <0>;

    ports {
        #address-cells = <1>;
        #size-cells = <0>;

        port@1 {
            reg = <1>;
            playback-only;

            sai1_endpoint0: endpoint {
               dai-tdm-slot-num = <8>;
               dai-tdm-slot-width = <32>;
               dai-tdm-slot-width-map = <32 8 32>;
               dai-format = "dsp_a";
               bitclock-master;
               frame-master;
               remote-endpoint = <&mcodec01_ep>;
            };
        };

        port@2 {
            reg = <2>;
            capture-only;

            sai1_endpoint1: endpoint {
                dai-tdm-slot-num = <8>;
                dai-tdm-slot-width = <32>;
                dai-tdm-slot-width-map = <32 8 32>;
                dai-format = "dsp_a";
                remote-endpoint = <&fe02_ep>;
            };
        };
    };
};

Source notes #

Annotations retained from the schema source

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

Edit this page