xref: /linux/Documentation/devicetree/bindings/sound/fsl,imx-asrc.yaml (revision 1260ed77798502de9c98020040d2995008de10cc)
120c0c9b3SSebastian Reichel# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
220c0c9b3SSebastian Reichel%YAML 1.2
320c0c9b3SSebastian Reichel---
420c0c9b3SSebastian Reichel$id: http://devicetree.org/schemas/sound/fsl,imx-asrc.yaml#
520c0c9b3SSebastian Reichel$schema: http://devicetree.org/meta-schemas/core.yaml#
620c0c9b3SSebastian Reichel
720c0c9b3SSebastian Reicheltitle: Freescale Asynchronous Sample Rate Converter (ASRC) Controller
820c0c9b3SSebastian Reichel
920c0c9b3SSebastian Reicheldescription:
1020c0c9b3SSebastian Reichel  The Asynchronous Sample Rate Converter (ASRC) converts the sampling rate of
1120c0c9b3SSebastian Reichel  a signal associated with an input clock into a signal associated with a
1220c0c9b3SSebastian Reichel  different output clock. The driver currently works as a Front End of DPCM
1320c0c9b3SSebastian Reichel  with other Back Ends Audio controller such as ESAI, SSI and SAI. It has
1420c0c9b3SSebastian Reichel  three pairs to support three substreams within totally 10 channels.
1520c0c9b3SSebastian Reichel
1620c0c9b3SSebastian Reichelmaintainers:
1720c0c9b3SSebastian Reichel  - Shawn Guo <shawnguo@kernel.org>
1820c0c9b3SSebastian Reichel  - Sascha Hauer <s.hauer@pengutronix.de>
1920c0c9b3SSebastian Reichel
2020c0c9b3SSebastian Reichelproperties:
2120c0c9b3SSebastian Reichel  compatible:
2220c0c9b3SSebastian Reichel    oneOf:
2320c0c9b3SSebastian Reichel      - enum:
2420c0c9b3SSebastian Reichel          - fsl,imx35-asrc
2520c0c9b3SSebastian Reichel          - fsl,imx53-asrc
2620c0c9b3SSebastian Reichel          - fsl,imx8qm-asrc
2720c0c9b3SSebastian Reichel          - fsl,imx8qxp-asrc
2820c0c9b3SSebastian Reichel      - items:
2920c0c9b3SSebastian Reichel          - enum:
3020c0c9b3SSebastian Reichel              - fsl,imx6sx-asrc
3120c0c9b3SSebastian Reichel              - fsl,imx6ul-asrc
3220c0c9b3SSebastian Reichel          - const: fsl,imx53-asrc
3320c0c9b3SSebastian Reichel
3420c0c9b3SSebastian Reichel  reg:
3520c0c9b3SSebastian Reichel    maxItems: 1
3620c0c9b3SSebastian Reichel
3720c0c9b3SSebastian Reichel  interrupts:
3820c0c9b3SSebastian Reichel    maxItems: 1
3920c0c9b3SSebastian Reichel
4020c0c9b3SSebastian Reichel  dmas:
4120c0c9b3SSebastian Reichel    maxItems: 6
4220c0c9b3SSebastian Reichel
4320c0c9b3SSebastian Reichel  dma-names:
4420c0c9b3SSebastian Reichel    items:
4520c0c9b3SSebastian Reichel      - const: rxa
4620c0c9b3SSebastian Reichel      - const: rxb
4720c0c9b3SSebastian Reichel      - const: rxc
4820c0c9b3SSebastian Reichel      - const: txa
4920c0c9b3SSebastian Reichel      - const: txb
5020c0c9b3SSebastian Reichel      - const: txc
5120c0c9b3SSebastian Reichel
5220c0c9b3SSebastian Reichel  clocks:
5320c0c9b3SSebastian Reichel    maxItems: 19
5420c0c9b3SSebastian Reichel
5520c0c9b3SSebastian Reichel  clock-names:
5620c0c9b3SSebastian Reichel    items:
5720c0c9b3SSebastian Reichel      - const: mem
5820c0c9b3SSebastian Reichel      - const: ipg
5920c0c9b3SSebastian Reichel      - const: asrck_0
6020c0c9b3SSebastian Reichel      - const: asrck_1
6120c0c9b3SSebastian Reichel      - const: asrck_2
6220c0c9b3SSebastian Reichel      - const: asrck_3
6320c0c9b3SSebastian Reichel      - const: asrck_4
6420c0c9b3SSebastian Reichel      - const: asrck_5
6520c0c9b3SSebastian Reichel      - const: asrck_6
6620c0c9b3SSebastian Reichel      - const: asrck_7
6720c0c9b3SSebastian Reichel      - const: asrck_8
6820c0c9b3SSebastian Reichel      - const: asrck_9
6920c0c9b3SSebastian Reichel      - const: asrck_a
7020c0c9b3SSebastian Reichel      - const: asrck_b
7120c0c9b3SSebastian Reichel      - const: asrck_c
7220c0c9b3SSebastian Reichel      - const: asrck_d
7320c0c9b3SSebastian Reichel      - const: asrck_e
7420c0c9b3SSebastian Reichel      - const: asrck_f
7520c0c9b3SSebastian Reichel      - const: spba
7620c0c9b3SSebastian Reichel
779b215318SFrank Li  power-domains:
789b215318SFrank Li    maxItems: 1
799b215318SFrank Li
80*db91ad81SShengjiu Wang  port:
81*db91ad81SShengjiu Wang    $ref: audio-graph-port.yaml#
82*db91ad81SShengjiu Wang    unevaluatedProperties: false
83*db91ad81SShengjiu Wang
8420c0c9b3SSebastian Reichel  fsl,asrc-rate:
8520c0c9b3SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
8620c0c9b3SSebastian Reichel    description: The mutual sample rate used by DPCM Back Ends
8720c0c9b3SSebastian Reichel
8820c0c9b3SSebastian Reichel  fsl,asrc-width:
8920c0c9b3SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
9020c0c9b3SSebastian Reichel    description: The mutual sample width used by DPCM Back Ends
9120c0c9b3SSebastian Reichel    enum: [16, 24]
9220c0c9b3SSebastian Reichel
9320c0c9b3SSebastian Reichel  fsl,asrc-clk-map:
9420c0c9b3SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
9520c0c9b3SSebastian Reichel    description:
9620c0c9b3SSebastian Reichel      Defines clock map used in driver
9720c0c9b3SSebastian Reichel      <0> - select the map for asrc0 in imx8qm/imx8qxp
9820c0c9b3SSebastian Reichel      <1> - select the map for asrc1 in imx8qm/imx8qxp
9920c0c9b3SSebastian Reichel    enum: [0, 1]
10020c0c9b3SSebastian Reichel
10120c0c9b3SSebastian Reichel  big-endian:
10220c0c9b3SSebastian Reichel    type: boolean
10320c0c9b3SSebastian Reichel    description:
10420c0c9b3SSebastian Reichel      If this property is absent, the little endian mode will be in use as
10520c0c9b3SSebastian Reichel      default. Otherwise, the big endian mode will be in use for all the
10620c0c9b3SSebastian Reichel      device registers.
10720c0c9b3SSebastian Reichel
10820c0c9b3SSebastian Reichel  fsl,asrc-format:
10920c0c9b3SSebastian Reichel    $ref: /schemas/types.yaml#/definitions/uint32
11020c0c9b3SSebastian Reichel    description:
11120c0c9b3SSebastian Reichel      Defines a mutual sample format used by DPCM Back Ends, which can
11220c0c9b3SSebastian Reichel      replace the fsl,asrc-width. The value is 2 (S16_LE), or 6 (S24_LE).
11320c0c9b3SSebastian Reichel    enum: [2, 6]
11420c0c9b3SSebastian Reichel
11520c0c9b3SSebastian Reichelrequired:
11620c0c9b3SSebastian Reichel  - compatible
11720c0c9b3SSebastian Reichel  - reg
11820c0c9b3SSebastian Reichel  - interrupts
11920c0c9b3SSebastian Reichel  - dmas
12020c0c9b3SSebastian Reichel  - dma-names
12120c0c9b3SSebastian Reichel  - clocks
12220c0c9b3SSebastian Reichel  - clock-names
12320c0c9b3SSebastian Reichel  - fsl,asrc-rate
12420c0c9b3SSebastian Reichel  - fsl,asrc-width
12520c0c9b3SSebastian Reichel
12620c0c9b3SSebastian ReichelallOf:
1273e7b3757SShengjiu Wang  - $ref: dai-common.yaml#
12820c0c9b3SSebastian Reichel  - if:
12920c0c9b3SSebastian Reichel      properties:
13020c0c9b3SSebastian Reichel        compatible:
13120c0c9b3SSebastian Reichel          contains:
13220c0c9b3SSebastian Reichel            enum:
13320c0c9b3SSebastian Reichel              - fsl,imx8qm-asrc
13420c0c9b3SSebastian Reichel              - fsl,imx8qxp-asrc
13520c0c9b3SSebastian Reichel    then:
13620c0c9b3SSebastian Reichel      required:
13720c0c9b3SSebastian Reichel        - fsl,asrc-clk-map
13820c0c9b3SSebastian Reichel    else:
13920c0c9b3SSebastian Reichel      properties:
14020c0c9b3SSebastian Reichel        fsl,asrc-clk-map: false
14120c0c9b3SSebastian Reichel
1429b215318SFrank Li  - if:
1439b215318SFrank Li      properties:
1449b215318SFrank Li        compatible:
1459b215318SFrank Li          contains:
1469b215318SFrank Li            enum:
1479b215318SFrank Li              - fsl,imx8qm-asrc
1489b215318SFrank Li              - fsl,imx8qxp-asrc
1499b215318SFrank Li    then:
1509b215318SFrank Li      required:
1519b215318SFrank Li        - power-domains
1529b215318SFrank Li
1533e7b3757SShengjiu WangunevaluatedProperties: false
15420c0c9b3SSebastian Reichel
15520c0c9b3SSebastian Reichelexamples:
15620c0c9b3SSebastian Reichel  - |
15720c0c9b3SSebastian Reichel    #include <dt-bindings/interrupt-controller/irq.h>
15820c0c9b3SSebastian Reichel    #include <dt-bindings/clock/imx6qdl-clock.h>
15920c0c9b3SSebastian Reichel    asrc: asrc@2034000 {
16020c0c9b3SSebastian Reichel        compatible = "fsl,imx53-asrc";
16120c0c9b3SSebastian Reichel        reg = <0x02034000 0x4000>;
16220c0c9b3SSebastian Reichel        interrupts = <0 50 IRQ_TYPE_LEVEL_HIGH>;
16320c0c9b3SSebastian Reichel        clocks = <&clks IMX6QDL_CLK_ASRC_IPG>,
16420c0c9b3SSebastian Reichel                 <&clks IMX6QDL_CLK_ASRC_MEM>, <&clks 0>,
16520c0c9b3SSebastian Reichel                 <&clks 0>, <&clks 0>, <&clks 0>, <&clks 0>,
16620c0c9b3SSebastian Reichel                 <&clks 0>, <&clks 0>, <&clks 0>, <&clks 0>,
16720c0c9b3SSebastian Reichel                 <&clks 0>, <&clks 0>, <&clks 0>, <&clks 0>,
16820c0c9b3SSebastian Reichel                 <&clks IMX6QDL_CLK_ASRC>, <&clks 0>, <&clks 0>,
16920c0c9b3SSebastian Reichel                 <&clks IMX6QDL_CLK_SPBA>;
17020c0c9b3SSebastian Reichel        clock-names = "mem", "ipg", "asrck_0",
17120c0c9b3SSebastian Reichel                "asrck_1", "asrck_2", "asrck_3", "asrck_4",
17220c0c9b3SSebastian Reichel                "asrck_5", "asrck_6", "asrck_7", "asrck_8",
17320c0c9b3SSebastian Reichel                "asrck_9", "asrck_a", "asrck_b", "asrck_c",
17420c0c9b3SSebastian Reichel                "asrck_d", "asrck_e", "asrck_f", "spba";
17520c0c9b3SSebastian Reichel        dmas = <&sdma 17 23 1>, <&sdma 18 23 1>, <&sdma 19 23 1>,
17620c0c9b3SSebastian Reichel               <&sdma 20 23 1>, <&sdma 21 23 1>, <&sdma 22 23 1>;
17720c0c9b3SSebastian Reichel        dma-names = "rxa", "rxb", "rxc",
17820c0c9b3SSebastian Reichel                    "txa", "txb", "txc";
17920c0c9b3SSebastian Reichel        fsl,asrc-rate  = <48000>;
18020c0c9b3SSebastian Reichel        fsl,asrc-width = <16>;
181*db91ad81SShengjiu Wang
182*db91ad81SShengjiu Wang        port {
183*db91ad81SShengjiu Wang            playback-only;
184*db91ad81SShengjiu Wang
185*db91ad81SShengjiu Wang            asrc_endpoint: endpoint {
186*db91ad81SShengjiu Wang                remote-endpoint = <&fe00_ep>;
187*db91ad81SShengjiu Wang            };
188*db91ad81SShengjiu Wang       };
18920c0c9b3SSebastian Reichel    };
190