1# Copyright 2024 NXP
2# SPDX-License-Identifier: Apache-2.0
3
4description: NXP Enhanced Serial Audio Interface (ESAI) node
5
6compatible: "nxp,dai-esai"
7
8include: base.yaml
9
10properties:
11  reg:
12    required: true
13  dai-index:
14    type: int
15    description: |
16      Use this property to specify the index of the DAI. At the
17      moment, this is only used by SOF to fetch the "struct device"
18      associated with the DAI whose index Linux passes to SOF
19      through an IPC. If this property is not specified, the DAI
20      index will be considered 0.
21  tx-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. If unspecified,
28      the TX FIFO watermark will be set to DEFAULT_FIFO_DEPTH / 2.
29  rx-fifo-watermark:
30    type: int
31    description: |
32      Use this property to specify the watermark value for the RX
33      FIFO. This values needs to be in FIFO words (NOT BYTES). This
34      value needs to be in the following interval: (0, DEFAULT_FIFO_DEPTH],
35      otherwise a BUILD_ASSERT() failure will be raised. If unspecified,
36      the RX FIFO watermark will be set to DEFAULT_FIFO_DEPTH / 2.
37  fifo-depth:
38    type: int
39    description: |
40      Use this property to set the FIFO depth that will be reported
41      to upper layer applications calling dai_get_properties(). This
42      value should be in the following interval: (0, DEFAULT_FIFO_DEPTH],
43      otherwise a BUILD_ASSERT() failure will be raised. By DEFAULT_FIFO_DEPTH
44      we mean the actual (hardware) value of the FIFO depth. This is needed
45      because some applications (e.g: SOF) use this value directly as the
46      DMA burst size in which case DEFAULT_FIFO_DEPTH cannot be used.
47      Generally, reporting a false FIFO depth should be avoided. Please note
48      that the sanity check for tx/rx-fifo-watermark uses DEFAULT_FIFO_DETPH
49      instead of this value so use with caution. If unsure, it's better to
50      not use this property at all, in which case the reported value will be
51      DEFAULT_FIFO_DEPTH.
52  word-width:
53    type: int
54    description: |
55      This property is used to specify the width of a word. If unspecified,
56      the word width used will be 24.
57  esai-pin-modes:
58    type: array
59    description: |
60      This property is used to configure the ESAI pins. Each ESAI pin
61      supports 4 modes:
62        1) DISCONNECTED (PDC[i] = 0, PC[i] = 0)
63        2) GPIO input (PDC[i] = 0, PC[i] = 1)
64        3) GPIO output (PDC[i] = 1, PC[i] = 0)
65        4) ESAI (PDC[i] = 1, PC[i] = 1)
66      If pin is not used then DISCONNECTED mode should be used for said pin.
67      If unsure, don't specify this property at all. By default, all pins will
68      be set to ESAI mode.
69  esai-clock-configuration:
70    type: array
71    description: |
72      Use this property to configure the directions of the ESAI clocks (HCLK, BCLK, FSYNC).
73      This provides extra flexibility since the bespoke configuration is not direction-based.
74      The values from this array will overwrite the values set through the bespoke
75      configuration. If unspecified, the values from the bespoke configuration will be used.
76