1# Copyright 2023 NXP
2# SPDX-License-Identifier: Apache-2.0
3
4description: NXP Synchronous Audio Interface (SAI) node
5
6compatible: "nxp,dai-sai"
7
8include: [base.yaml, pinctrl-device.yaml]
9
10properties:
11  reg:
12    required: true
13  mclk-is-output:
14    type: boolean
15    description: |
16      Use this property to set the SAI MCLK as output or as input.
17      By default, if this property is not specified, MCLK will be
18      set as input. Setting the MCLK as output for SAIs which don't
19      support MCLK configuration will result in a BUILD_ASSERT()
20      failure.
21  rx-fifo-watermark:
22    type: int
23    description: |
24      Use this property to specify the watermark value for the TX
25      FIFO. This value needs to be in FIFO words (NOT BYTES). This
26      value needs to be in the following interval: (0, DEFAULT_FIFO_DEPTH],
27      otherwise a BUILD_ASSERT() failure will be raised.
28  tx-fifo-watermark:
29    type: int
30    description: |
31      Use this property to specify the watermark value for the RX
32      FIFO. This value needs to be in FIFO words (NOT BYTES). This
33      value needs to be in the following interval: (0, DEFAULT_FIFO_DEPTH],
34      otherwise a BUILD_ASSERT() failure will be raised.
35  interrupts:
36    required: true
37  fifo-depth:
38    type: int
39    description: |
40      Use this property to set the FIFO depth that will be reported
41      to other applications calling dai_get_properties(). This value
42      should be in the following interval: (0, DEFAULT_FIFO_DEPTH],
43      otherwise a BUILD_ASSERT() failure will be raised.
44      By DEFAULT_FIFO_DEPTH we mean the actual (hardware) value of
45      the FIFO depth. This is needed because some applications (e.g: SOF)
46      use this value to compute the DMA burst size, in which case
47      DEFAULT_FIFO_DEPTH cannot be used. Generally, reporting a false
48      FIFO depth should be avoided. Please note that the sanity check
49      for tx/rx-fifo-watermark uses DEFAULT_FIFO_DEPTH instead of this
50      value so use with caution. If unsure, it's better to simply not
51      use this property, in which case the reported value will be
52      DEFAULT_FIFO_DEPTH.
53  dai-index:
54    type: int
55    description: |
56      Use this property to specify the index of the DAI. At the
57      moment, this is only used by SOF to fetch the "struct device"
58      associated with the DAI whose index Linux passes to SOF
59      through an IPC. If this property is not specified, the DAI
60      index will be considered 0.
61  tx-sync-mode:
62    type: int
63    enum:
64      - 0
65      - 1
66    description: |
67      Use this property to specify which synchronization mode to use
68      for the transmitter. At the moment, the only supported modes are:
69        1) The transmitter is ASYNC (0)
70        2) The transmitter is in SYNC with the receiver (1)
71      If this property is not specified, the transmitter will be set to ASYNC.
72      If one side is SYNC then the other MUST be ASYNC. Failing to meet this
73      condition will result in a failed BUILD_ASSERT().
74  rx-sync-mode:
75    type: int
76    enum:
77      - 0
78      - 1
79    description: |
80      Use this property to specify which synchronization mode to use
81      for the receiver. At the moment, the only supported modes are:
82        1) The receiver is ASYNC (0)
83        2) The receiver is in SYNC with the transmitter (1)
84      If this property is not specified, the receiver will be set to ASYNC.
85      If one side is SYNC then the other MUST be ASYNC. Failing to meet this
86      condition will result in a failed BUILD_ASSERT().
87  tx-dataline:
88    type: int
89    description: |
90      Use this property to specify which transmission data line the SAI should
91      use. To find out which transmission line you should use you can:
92        1) Check the TRM and see if your SAI instance is multiline. If not then
93        you're going to use transmission line 0.
94        2) If your SAI is multiline then you need to check the datasheet and see
95        the index of the transmission line that's connected to your consumer
96        (e.g: the codec).
97      The indexing of the data line starts at 0. If this property is not specified
98      then the index of the transmission data line will be 0.
99      Please note that "channel" and "data line" are synnonyms in this context.
100  rx-dataline:
101    type: int
102    description: |
103      Use this property to specify which receive transmission data line the SAI should
104      use. To find out which receive line you should use you can:
105        1) Check the TRM and see if your SAI instance is multiline. If not then
106        you're going to use receive line 0.
107        2) If your SAI is multiline then you need to check the datasheet and see
108        the index of the receive line that's connected to your consumer (e.g: the codec).
109      The indexing of the data line starts at 0. If this property is not specified
110      then the index of the receive data line will be 0.
111      Please note that "channel" and "data line" are synnonyms in this context.
112