xref: /linux/Documentation/devicetree/bindings/sound/fsl,ssi.yaml (revision 33e02dc69afbd8f1b85a51d74d72f139ba4ca623)
1*2da01ca3SShengjiu Wang# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*2da01ca3SShengjiu Wang%YAML 1.2
3*2da01ca3SShengjiu Wang---
4*2da01ca3SShengjiu Wang$id: http://devicetree.org/schemas/sound/fsl,ssi.yaml#
5*2da01ca3SShengjiu Wang$schema: http://devicetree.org/meta-schemas/core.yaml#
6*2da01ca3SShengjiu Wang
7*2da01ca3SShengjiu Wangtitle: Freescale Synchronous Serial Interface
8*2da01ca3SShengjiu Wang
9*2da01ca3SShengjiu Wangmaintainers:
10*2da01ca3SShengjiu Wang  - Shengjiu Wang <shengjiu.wang@nxp.com>
11*2da01ca3SShengjiu Wang
12*2da01ca3SShengjiu Wangdescription:
13*2da01ca3SShengjiu Wang  Notes on fsl,playback-dma and fsl,capture-dma
14*2da01ca3SShengjiu Wang  On SOCs that have an SSI, specific DMA channels are hard-wired for playback
15*2da01ca3SShengjiu Wang  and capture.  On the MPC8610, for example, SSI1 must use DMA channel 0 for
16*2da01ca3SShengjiu Wang  playback and DMA channel 1 for capture.  SSI2 must use DMA channel 2 for
17*2da01ca3SShengjiu Wang  playback and DMA channel 3 for capture.  The developer can choose which
18*2da01ca3SShengjiu Wang  DMA controller to use, but the channels themselves are hard-wired.  The
19*2da01ca3SShengjiu Wang  purpose of these two properties is to represent this hardware design.
20*2da01ca3SShengjiu Wang
21*2da01ca3SShengjiu Wang  The device tree nodes for the DMA channels that are referenced by
22*2da01ca3SShengjiu Wang  "fsl,playback-dma" and "fsl,capture-dma" must be marked as compatible with
23*2da01ca3SShengjiu Wang  "fsl,ssi-dma-channel".  The SOC-specific compatible string (e.g.
24*2da01ca3SShengjiu Wang  "fsl,mpc8610-dma-channel") can remain.  If these nodes are left as
25*2da01ca3SShengjiu Wang  "fsl,elo-dma-channel" or "fsl,eloplus-dma-channel", then the generic Elo DMA
26*2da01ca3SShengjiu Wang  drivers (fsldma) will attempt to use them, and it will conflict with the
27*2da01ca3SShengjiu Wang  sound drivers.
28*2da01ca3SShengjiu Wang
29*2da01ca3SShengjiu Wangproperties:
30*2da01ca3SShengjiu Wang  compatible:
31*2da01ca3SShengjiu Wang    oneOf:
32*2da01ca3SShengjiu Wang      - items:
33*2da01ca3SShengjiu Wang          - enum:
34*2da01ca3SShengjiu Wang              - fsl,imx50-ssi
35*2da01ca3SShengjiu Wang              - fsl,imx53-ssi
36*2da01ca3SShengjiu Wang          - const: fsl,imx51-ssi
37*2da01ca3SShengjiu Wang          - const: fsl,imx21-ssi
38*2da01ca3SShengjiu Wang      - items:
39*2da01ca3SShengjiu Wang          - enum:
40*2da01ca3SShengjiu Wang              - fsl,imx25-ssi
41*2da01ca3SShengjiu Wang              - fsl,imx27-ssi
42*2da01ca3SShengjiu Wang              - fsl,imx35-ssi
43*2da01ca3SShengjiu Wang              - fsl,imx51-ssi
44*2da01ca3SShengjiu Wang          - const: fsl,imx21-ssi
45*2da01ca3SShengjiu Wang      - items:
46*2da01ca3SShengjiu Wang          - enum:
47*2da01ca3SShengjiu Wang              - fsl,imx6q-ssi
48*2da01ca3SShengjiu Wang              - fsl,imx6sl-ssi
49*2da01ca3SShengjiu Wang              - fsl,imx6sx-ssi
50*2da01ca3SShengjiu Wang          - const: fsl,imx51-ssi
51*2da01ca3SShengjiu Wang      - items:
52*2da01ca3SShengjiu Wang          - const: fsl,imx21-ssi
53*2da01ca3SShengjiu Wang      - items:
54*2da01ca3SShengjiu Wang          - const: fsl,mpc8610-ssi
55*2da01ca3SShengjiu Wang
56*2da01ca3SShengjiu Wang  reg:
57*2da01ca3SShengjiu Wang    maxItems: 1
58*2da01ca3SShengjiu Wang
59*2da01ca3SShengjiu Wang  interrupts:
60*2da01ca3SShengjiu Wang    maxItems: 1
61*2da01ca3SShengjiu Wang
62*2da01ca3SShengjiu Wang  clocks:
63*2da01ca3SShengjiu Wang    items:
64*2da01ca3SShengjiu Wang      - description: The ipg clock for register access
65*2da01ca3SShengjiu Wang      - description: clock for SSI master mode
66*2da01ca3SShengjiu Wang    minItems: 1
67*2da01ca3SShengjiu Wang
68*2da01ca3SShengjiu Wang  clock-names:
69*2da01ca3SShengjiu Wang    items:
70*2da01ca3SShengjiu Wang      - const: ipg
71*2da01ca3SShengjiu Wang      - const: baud
72*2da01ca3SShengjiu Wang    minItems: 1
73*2da01ca3SShengjiu Wang
74*2da01ca3SShengjiu Wang  dmas:
75*2da01ca3SShengjiu Wang    oneOf:
76*2da01ca3SShengjiu Wang      - items:
77*2da01ca3SShengjiu Wang          - description: DMA controller phandle and request line for RX
78*2da01ca3SShengjiu Wang          - description: DMA controller phandle and request line for TX
79*2da01ca3SShengjiu Wang      - items:
80*2da01ca3SShengjiu Wang          - description: DMA controller phandle and request line for RX0
81*2da01ca3SShengjiu Wang          - description: DMA controller phandle and request line for TX0
82*2da01ca3SShengjiu Wang          - description: DMA controller phandle and request line for RX1
83*2da01ca3SShengjiu Wang          - description: DMA controller phandle and request line for TX1
84*2da01ca3SShengjiu Wang
85*2da01ca3SShengjiu Wang  dma-names:
86*2da01ca3SShengjiu Wang    oneOf:
87*2da01ca3SShengjiu Wang      - items:
88*2da01ca3SShengjiu Wang          - const: rx
89*2da01ca3SShengjiu Wang          - const: tx
90*2da01ca3SShengjiu Wang      - items:
91*2da01ca3SShengjiu Wang          - const: rx0
92*2da01ca3SShengjiu Wang          - const: tx0
93*2da01ca3SShengjiu Wang          - const: rx1
94*2da01ca3SShengjiu Wang          - const: tx1
95*2da01ca3SShengjiu Wang
96*2da01ca3SShengjiu Wang  "#sound-dai-cells":
97*2da01ca3SShengjiu Wang    const: 0
98*2da01ca3SShengjiu Wang    description: optional, some dts node didn't add it.
99*2da01ca3SShengjiu Wang
100*2da01ca3SShengjiu Wang  cell-index:
101*2da01ca3SShengjiu Wang    $ref: /schemas/types.yaml#/definitions/uint32
102*2da01ca3SShengjiu Wang    enum: [0, 1, 2]
103*2da01ca3SShengjiu Wang    description: The SSI index
104*2da01ca3SShengjiu Wang
105*2da01ca3SShengjiu Wang  ac97-gpios:
106*2da01ca3SShengjiu Wang    $ref: /schemas/types.yaml#/definitions/phandle-array
107*2da01ca3SShengjiu Wang    description: Please refer to soc-ac97link.txt
108*2da01ca3SShengjiu Wang
109*2da01ca3SShengjiu Wang  codec-handle:
110*2da01ca3SShengjiu Wang    $ref: /schemas/types.yaml#/definitions/phandle
111*2da01ca3SShengjiu Wang    description:
112*2da01ca3SShengjiu Wang      Phandle to a 'codec' node that defines an audio
113*2da01ca3SShengjiu Wang      codec connected to this SSI.  This node is typically
114*2da01ca3SShengjiu Wang      a child of an I2C or other control node.
115*2da01ca3SShengjiu Wang
116*2da01ca3SShengjiu Wang  fsl,fifo-depth:
117*2da01ca3SShengjiu Wang    $ref: /schemas/types.yaml#/definitions/uint32
118*2da01ca3SShengjiu Wang    description:
119*2da01ca3SShengjiu Wang      The number of elements in the transmit and receive FIFOs.
120*2da01ca3SShengjiu Wang      This number is the maximum allowed value for SFCSR[TFWM0].
121*2da01ca3SShengjiu Wang    enum: [8, 15]
122*2da01ca3SShengjiu Wang
123*2da01ca3SShengjiu Wang  fsl,fiq-stream-filter:
124*2da01ca3SShengjiu Wang    type: boolean
125*2da01ca3SShengjiu Wang    description:
126*2da01ca3SShengjiu Wang      Disabled DMA and use FIQ instead to filter the codec stream.
127*2da01ca3SShengjiu Wang      This is necessary for some boards where an incompatible codec
128*2da01ca3SShengjiu Wang      is connected to this SSI, e.g. on pca100 and pcm043.
129*2da01ca3SShengjiu Wang
130*2da01ca3SShengjiu Wang  fsl,mode:
131*2da01ca3SShengjiu Wang    $ref: /schemas/types.yaml#/definitions/string
132*2da01ca3SShengjiu Wang    enum: [ ac97-slave, ac97-master, i2s-slave, i2s-master,
133*2da01ca3SShengjiu Wang            lj-slave, lj-master, rj-slave, rj-master ]
134*2da01ca3SShengjiu Wang    description: |
135*2da01ca3SShengjiu Wang      "ac97-slave" - AC97 mode, SSI is clock slave
136*2da01ca3SShengjiu Wang      "ac97-master" - AC97 mode, SSI is clock master
137*2da01ca3SShengjiu Wang      "i2s-slave" - I2S mode, SSI is clock slave
138*2da01ca3SShengjiu Wang      "i2s-master" - I2S mode, SSI is clock master
139*2da01ca3SShengjiu Wang      "lj-slave" - Left justified mode, SSI is clock slave
140*2da01ca3SShengjiu Wang      "lj-master" - Left justified mode, SSI is clock master
141*2da01ca3SShengjiu Wang      "rj-slave" - Right justified mode, SSI is clock slave
142*2da01ca3SShengjiu Wang      "rj-master" - Right justified mode, SSI is clock master
143*2da01ca3SShengjiu Wang
144*2da01ca3SShengjiu Wang  fsl,ssi-asynchronous:
145*2da01ca3SShengjiu Wang    type: boolean
146*2da01ca3SShengjiu Wang    description: If specified, the SSI is to be programmed in asynchronous
147*2da01ca3SShengjiu Wang      mode.  In this mode, pins SRCK, STCK, SRFS, and STFS must
148*2da01ca3SShengjiu Wang      all be connected to valid signals.  In synchronous mode,
149*2da01ca3SShengjiu Wang      SRCK and SRFS are ignored.  Asynchronous mode allows
150*2da01ca3SShengjiu Wang      playback and capture to use different sample sizes and
151*2da01ca3SShengjiu Wang      sample rates.  Some drivers may require that SRCK and STCK
152*2da01ca3SShengjiu Wang      be connected together, and SRFS and STFS be connected
153*2da01ca3SShengjiu Wang      together.  This would still allow different sample sizes,
154*2da01ca3SShengjiu Wang      but not different sample rates.
155*2da01ca3SShengjiu Wang
156*2da01ca3SShengjiu Wang  fsl,playback-dma:
157*2da01ca3SShengjiu Wang    $ref: /schemas/types.yaml#/definitions/phandle
158*2da01ca3SShengjiu Wang    description: Phandle to a node for the DMA channel to use for
159*2da01ca3SShengjiu Wang      playback of audio.  This is typically dictated by SOC
160*2da01ca3SShengjiu Wang      design. Only used on Power Architecture.
161*2da01ca3SShengjiu Wang
162*2da01ca3SShengjiu Wang  fsl,capture-dma:
163*2da01ca3SShengjiu Wang    $ref: /schemas/types.yaml#/definitions/phandle
164*2da01ca3SShengjiu Wang    description: Phandle to a node for the DMA channel to use for
165*2da01ca3SShengjiu Wang      capture (recording) of audio.  This is typically dictated
166*2da01ca3SShengjiu Wang      by SOC design. Only used on Power Architecture.
167*2da01ca3SShengjiu Wang
168*2da01ca3SShengjiu Wangrequired:
169*2da01ca3SShengjiu Wang  - compatible
170*2da01ca3SShengjiu Wang  - reg
171*2da01ca3SShengjiu Wang  - interrupts
172*2da01ca3SShengjiu Wang  - fsl,fifo-depth
173*2da01ca3SShengjiu Wang
174*2da01ca3SShengjiu WangallOf:
175*2da01ca3SShengjiu Wang  - $ref: dai-common.yaml#
176*2da01ca3SShengjiu Wang
177*2da01ca3SShengjiu WangunevaluatedProperties: false
178*2da01ca3SShengjiu Wang
179*2da01ca3SShengjiu Wangexamples:
180*2da01ca3SShengjiu Wang  - |
181*2da01ca3SShengjiu Wang    #include <dt-bindings/interrupt-controller/arm-gic.h>
182*2da01ca3SShengjiu Wang    #include <dt-bindings/clock/imx6qdl-clock.h>
183*2da01ca3SShengjiu Wang    ssi@2028000 {
184*2da01ca3SShengjiu Wang        compatible = "fsl,imx6q-ssi", "fsl,imx51-ssi";
185*2da01ca3SShengjiu Wang        reg = <0x02028000 0x4000>;
186*2da01ca3SShengjiu Wang        interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
187*2da01ca3SShengjiu Wang        clocks = <&clks IMX6QDL_CLK_SSI1_IPG>,
188*2da01ca3SShengjiu Wang                 <&clks IMX6QDL_CLK_SSI1>;
189*2da01ca3SShengjiu Wang        clock-names = "ipg", "baud";
190*2da01ca3SShengjiu Wang        dmas = <&sdma 37 1 0>, <&sdma 38 1 0>;
191*2da01ca3SShengjiu Wang        dma-names = "rx", "tx";
192*2da01ca3SShengjiu Wang        #sound-dai-cells = <0>;
193*2da01ca3SShengjiu Wang        fsl,fifo-depth = <15>;
194*2da01ca3SShengjiu Wang    };
195