xref: /openbmc/linux/Documentation/devicetree/bindings/sound/simple-card.yaml (revision c900529f3d9161bfde5cca0754f83b4d3c3e0220)
179149fb8SKuninori Morimoto# SPDX-License-Identifier: GPL-2.0
279149fb8SKuninori Morimoto%YAML 1.2
379149fb8SKuninori Morimoto---
479149fb8SKuninori Morimoto$id: http://devicetree.org/schemas/sound/simple-card.yaml#
579149fb8SKuninori Morimoto$schema: http://devicetree.org/meta-schemas/core.yaml#
679149fb8SKuninori Morimoto
7dd3cb467SAndrew Lunntitle: Simple Audio Card Driver
879149fb8SKuninori Morimoto
979149fb8SKuninori Morimotomaintainers:
1079149fb8SKuninori Morimoto  - Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
1179149fb8SKuninori Morimoto
1279149fb8SKuninori Morimotodefinitions:
1379149fb8SKuninori Morimoto
1479149fb8SKuninori Morimoto  frame-master:
1579149fb8SKuninori Morimoto    description: Indicates dai-link frame master.
16251bf658SRob Herring    $ref: /schemas/types.yaml#/definitions/phandle
1779149fb8SKuninori Morimoto
1879149fb8SKuninori Morimoto  bitclock-master:
1979149fb8SKuninori Morimoto    description: Indicates dai-link bit clock master
20251bf658SRob Herring    $ref: /schemas/types.yaml#/definitions/phandle
2179149fb8SKuninori Morimoto
2279149fb8SKuninori Morimoto  frame-inversion:
2379149fb8SKuninori Morimoto    description: dai-link uses frame clock inversion
2479149fb8SKuninori Morimoto    $ref: /schemas/types.yaml#/definitions/flag
2579149fb8SKuninori Morimoto
2679149fb8SKuninori Morimoto  bitclock-inversion:
2779149fb8SKuninori Morimoto    description: dai-link uses bit clock inversion
2879149fb8SKuninori Morimoto    $ref: /schemas/types.yaml#/definitions/flag
2979149fb8SKuninori Morimoto
3079149fb8SKuninori Morimoto  dai-tdm-slot-num:
3179149fb8SKuninori Morimoto    description: see tdm-slot.txt.
3279149fb8SKuninori Morimoto    $ref: /schemas/types.yaml#/definitions/uint32
3379149fb8SKuninori Morimoto
3479149fb8SKuninori Morimoto  dai-tdm-slot-width:
3579149fb8SKuninori Morimoto    description: see tdm-slot.txt.
3679149fb8SKuninori Morimoto    $ref: /schemas/types.yaml#/definitions/uint32
3779149fb8SKuninori Morimoto
3879149fb8SKuninori Morimoto  system-clock-frequency:
3979149fb8SKuninori Morimoto    description: |
4079149fb8SKuninori Morimoto      If a clock is specified and a multiplication factor is given with
4179149fb8SKuninori Morimoto      mclk-fs, the clock will be set to the calculated mclk frequency
4279149fb8SKuninori Morimoto      when the stream starts.
4379149fb8SKuninori Morimoto    $ref: /schemas/types.yaml#/definitions/uint32
4479149fb8SKuninori Morimoto
4579149fb8SKuninori Morimoto  system-clock-direction-out:
4679149fb8SKuninori Morimoto    description: |
4779149fb8SKuninori Morimoto      specifies clock direction as 'out' on initialization.
4879149fb8SKuninori Morimoto      It is useful for some aCPUs with fixed clocks.
4979149fb8SKuninori Morimoto    $ref: /schemas/types.yaml#/definitions/flag
5079149fb8SKuninori Morimoto
51e9fed03aSRobert Hancock  system-clock-fixed:
52e9fed03aSRobert Hancock    description: |
53e9fed03aSRobert Hancock      Specifies that the clock frequency should not be modified.
54e9fed03aSRobert Hancock      Implied when system-clock-frequency is specified, but can be used when
55e9fed03aSRobert Hancock      a clock is mapped to the device whose frequency cannot or should not be
56e9fed03aSRobert Hancock      changed. When mclk-fs is also specified, this restricts the device to a
57e9fed03aSRobert Hancock      single fixed sampling rate.
58e9fed03aSRobert Hancock    $ref: /schemas/types.yaml#/definitions/flag
59e9fed03aSRobert Hancock
6079149fb8SKuninori Morimoto  mclk-fs:
6179149fb8SKuninori Morimoto    description: |
6279149fb8SKuninori Morimoto      Multiplication factor between stream rate and codec mclk.
6379149fb8SKuninori Morimoto      When defined, mclk-fs property defined in dai-link sub nodes are ignored.
6479149fb8SKuninori Morimoto    $ref: /schemas/types.yaml#/definitions/uint32
6579149fb8SKuninori Morimoto
6679149fb8SKuninori Morimoto  aux-devs:
6779149fb8SKuninori Morimoto    description: |
6879149fb8SKuninori Morimoto      List of phandles pointing to auxiliary devices, such
6979149fb8SKuninori Morimoto      as amplifiers, to be added to the sound card.
7079149fb8SKuninori Morimoto    $ref: /schemas/types.yaml#/definitions/phandle-array
7179149fb8SKuninori Morimoto
7279149fb8SKuninori Morimoto  convert-rate:
7379149fb8SKuninori Morimoto    description: CPU to Codec rate convert.
7479149fb8SKuninori Morimoto    $ref: /schemas/types.yaml#/definitions/uint32
7579149fb8SKuninori Morimoto
7679149fb8SKuninori Morimoto  convert-channels:
7779149fb8SKuninori Morimoto    description: CPU to Codec rate channels.
7879149fb8SKuninori Morimoto    $ref: /schemas/types.yaml#/definitions/uint32
7979149fb8SKuninori Morimoto
8079149fb8SKuninori Morimoto  prefix:
81d9e909e2SRob Herring    description: device name prefix
8279149fb8SKuninori Morimoto    $ref: /schemas/types.yaml#/definitions/string
8379149fb8SKuninori Morimoto
8479149fb8SKuninori Morimoto  label:
8579149fb8SKuninori Morimoto    maxItems: 1
8679149fb8SKuninori Morimoto
8779149fb8SKuninori Morimoto  routing:
8879149fb8SKuninori Morimoto    description: |
8979149fb8SKuninori Morimoto      A list of the connections between audio components.
9079149fb8SKuninori Morimoto      Each entry is a pair of strings, the first being the
9179149fb8SKuninori Morimoto      connection's sink, the second being the connection's source.
9279149fb8SKuninori Morimoto    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
9379149fb8SKuninori Morimoto
9479149fb8SKuninori Morimoto  widgets:
9579149fb8SKuninori Morimoto    description: User specified audio sound widgets.
9679149fb8SKuninori Morimoto    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
9779149fb8SKuninori Morimoto
9879149fb8SKuninori Morimoto  pin-switches:
9979149fb8SKuninori Morimoto    description: the widget names for which pin switches must be created.
10079149fb8SKuninori Morimoto    $ref: /schemas/types.yaml#/definitions/string-array
10179149fb8SKuninori Morimoto
10279149fb8SKuninori Morimoto  format:
10379149fb8SKuninori Morimoto    description: audio format.
10479149fb8SKuninori Morimoto    items:
10579149fb8SKuninori Morimoto      enum:
10679149fb8SKuninori Morimoto        - i2s
10779149fb8SKuninori Morimoto        - right_j
10879149fb8SKuninori Morimoto        - left_j
10979149fb8SKuninori Morimoto        - dsp_a
11079149fb8SKuninori Morimoto        - dsp_b
11179149fb8SKuninori Morimoto        - ac97
11279149fb8SKuninori Morimoto        - pdm
11379149fb8SKuninori Morimoto        - msb
11479149fb8SKuninori Morimoto        - lsb
11579149fb8SKuninori Morimoto
11679149fb8SKuninori Morimoto  dai:
11779149fb8SKuninori Morimoto    type: object
11879149fb8SKuninori Morimoto    properties:
11979149fb8SKuninori Morimoto      sound-dai:
12079149fb8SKuninori Morimoto        maxItems: 1
12179149fb8SKuninori Morimoto
12279149fb8SKuninori Morimoto      # common properties
12379149fb8SKuninori Morimoto      mclk-fs:
12479149fb8SKuninori Morimoto        $ref: "#/definitions/mclk-fs"
12579149fb8SKuninori Morimoto      prefix:
12679149fb8SKuninori Morimoto        $ref: "#/definitions/prefix"
12779149fb8SKuninori Morimoto      frame-inversion:
12879149fb8SKuninori Morimoto        $ref: "#/definitions/frame-inversion"
12979149fb8SKuninori Morimoto      bitclock-inversion:
13079149fb8SKuninori Morimoto        $ref: "#/definitions/bitclock-inversion"
13179149fb8SKuninori Morimoto      frame-master:
13279149fb8SKuninori Morimoto        $ref: /schemas/types.yaml#/definitions/flag
13379149fb8SKuninori Morimoto      bitclock-master:
13479149fb8SKuninori Morimoto        $ref: /schemas/types.yaml#/definitions/flag
13579149fb8SKuninori Morimoto
13679149fb8SKuninori Morimoto      dai-tdm-slot-num:
13779149fb8SKuninori Morimoto        $ref: "#/definitions/dai-tdm-slot-num"
13879149fb8SKuninori Morimoto      dai-tdm-slot-width:
13979149fb8SKuninori Morimoto        $ref: "#/definitions/dai-tdm-slot-width"
14079149fb8SKuninori Morimoto      clocks:
14179149fb8SKuninori Morimoto        maxItems: 1
14279149fb8SKuninori Morimoto      system-clock-frequency:
14379149fb8SKuninori Morimoto        $ref: "#/definitions/system-clock-frequency"
14479149fb8SKuninori Morimoto      system-clock-direction-out:
14579149fb8SKuninori Morimoto        $ref: "#/definitions/system-clock-direction-out"
146e9fed03aSRobert Hancock      system-clock-fixed:
147e9fed03aSRobert Hancock        $ref: "#/definitions/system-clock-fixed"
14879149fb8SKuninori Morimoto    required:
14979149fb8SKuninori Morimoto      - sound-dai
15079149fb8SKuninori Morimoto
151*b5f34841SHerve Codina  additional-devs:
152*b5f34841SHerve Codina    type: object
153*b5f34841SHerve Codina    description:
154*b5f34841SHerve Codina      Additional devices used by the simple audio card.
155*b5f34841SHerve Codina    patternProperties:
156*b5f34841SHerve Codina      '^iio-aux(-.+)?$':
157*b5f34841SHerve Codina        type: object
158*b5f34841SHerve Codina        $ref: audio-iio-aux.yaml#
159*b5f34841SHerve Codina
16079149fb8SKuninori Morimotoproperties:
16179149fb8SKuninori Morimoto  compatible:
16279149fb8SKuninori Morimoto    contains:
16379149fb8SKuninori Morimoto      enum:
16479149fb8SKuninori Morimoto        - simple-audio-card
16579149fb8SKuninori Morimoto        - simple-scu-audio-card
16679149fb8SKuninori Morimoto
16779149fb8SKuninori Morimoto  "#address-cells":
16879149fb8SKuninori Morimoto    const: 1
16979149fb8SKuninori Morimoto  "#size-cells":
17079149fb8SKuninori Morimoto    const: 0
17179149fb8SKuninori Morimoto
17279149fb8SKuninori Morimoto  label:
17379149fb8SKuninori Morimoto    $ref: "#/definitions/label"
17479149fb8SKuninori Morimoto
17579149fb8SKuninori Morimoto  simple-audio-card,name:
17679149fb8SKuninori Morimoto    description: User specified audio sound card name.
17779149fb8SKuninori Morimoto    $ref: /schemas/types.yaml#/definitions/string
17879149fb8SKuninori Morimoto
179910f42bfSRob Herring  simple-audio-card,widgets:
18079149fb8SKuninori Morimoto    $ref: "#/definitions/widgets"
181910f42bfSRob Herring  simple-audio-card,routing:
18279149fb8SKuninori Morimoto    $ref: "#/definitions/routing"
18379149fb8SKuninori Morimoto
18479149fb8SKuninori Morimoto  # common properties
185910f42bfSRob Herring  simple-audio-card,frame-master:
18679149fb8SKuninori Morimoto    $ref: "#/definitions/frame-master"
187910f42bfSRob Herring  simple-audio-card,bitclock-master:
18879149fb8SKuninori Morimoto    $ref: "#/definitions/bitclock-master"
189910f42bfSRob Herring  simple-audio-card,frame-inversion:
19079149fb8SKuninori Morimoto    $ref: "#/definitions/frame-inversion"
191910f42bfSRob Herring  simple-audio-card,bitclock-inversion:
19279149fb8SKuninori Morimoto    $ref: "#/definitions/bitclock-inversion"
193910f42bfSRob Herring  simple-audio-card,format:
19479149fb8SKuninori Morimoto    $ref: "#/definitions/format"
195910f42bfSRob Herring  simple-audio-card,mclk-fs:
19679149fb8SKuninori Morimoto    $ref: "#/definitions/mclk-fs"
197910f42bfSRob Herring  simple-audio-card,aux-devs:
19879149fb8SKuninori Morimoto    $ref: "#/definitions/aux-devs"
199*b5f34841SHerve Codina  simple-audio-card,additional-devs:
200*b5f34841SHerve Codina    $ref: "#/definitions/additional-devs"
201910f42bfSRob Herring  simple-audio-card,convert-rate:
20279149fb8SKuninori Morimoto    $ref: "#/definitions/convert-rate"
203910f42bfSRob Herring  simple-audio-card,convert-channels:
20479149fb8SKuninori Morimoto    $ref: "#/definitions/convert-channels"
205910f42bfSRob Herring  simple-audio-card,prefix:
20679149fb8SKuninori Morimoto    $ref: "#/definitions/prefix"
207910f42bfSRob Herring  simple-audio-card,pin-switches:
20879149fb8SKuninori Morimoto    $ref: "#/definitions/pin-switches"
209910f42bfSRob Herring  simple-audio-card,hp-det-gpio:
21079149fb8SKuninori Morimoto    maxItems: 1
211910f42bfSRob Herring  simple-audio-card,mic-det-gpio:
21279149fb8SKuninori Morimoto    maxItems: 1
21379149fb8SKuninori Morimoto
214910f42bfSRob HerringpatternProperties:
215910f42bfSRob Herring  "^simple-audio-card,cpu(@[0-9a-f]+)?$":
216910f42bfSRob Herring    $ref: "#/definitions/dai"
217910f42bfSRob Herring  "^simple-audio-card,codec(@[0-9a-f]+)?$":
218910f42bfSRob Herring    $ref: "#/definitions/dai"
219e7e2b92eSFaiz Abbas  "^simple-audio-card,plat(@[0-9a-f]+)?$":
220e7e2b92eSFaiz Abbas    $ref: "#/definitions/dai"
221910f42bfSRob Herring
22279149fb8SKuninori Morimoto  "^simple-audio-card,dai-link(@[0-9a-f]+)?$":
22379149fb8SKuninori Morimoto    description: |
22479149fb8SKuninori Morimoto      Container for dai-link level properties and the CPU and CODEC sub-nodes.
22579149fb8SKuninori Morimoto      This container may be omitted when the card has only one DAI link.
22679149fb8SKuninori Morimoto    type: object
22779149fb8SKuninori Morimoto    properties:
22879149fb8SKuninori Morimoto      reg:
22979149fb8SKuninori Morimoto        maxItems: 1
23079149fb8SKuninori Morimoto
2319e8593ecSKuninori Morimoto      "#address-cells":
2329e8593ecSKuninori Morimoto        const: 1
2339e8593ecSKuninori Morimoto      "#size-cells":
2349e8593ecSKuninori Morimoto        const: 0
23579149fb8SKuninori Morimoto      # common properties
23679149fb8SKuninori Morimoto      frame-master:
23779149fb8SKuninori Morimoto        $ref: "#/definitions/frame-master"
23879149fb8SKuninori Morimoto      bitclock-master:
23979149fb8SKuninori Morimoto        $ref: "#/definitions/bitclock-master"
24079149fb8SKuninori Morimoto      frame-inversion:
24179149fb8SKuninori Morimoto        $ref: "#/definitions/frame-inversion"
24279149fb8SKuninori Morimoto      bitclock-inversion:
24379149fb8SKuninori Morimoto        $ref: "#/definitions/bitclock-inversion"
24479149fb8SKuninori Morimoto      format:
24579149fb8SKuninori Morimoto        $ref: "#/definitions/format"
24679149fb8SKuninori Morimoto      mclk-fs:
24779149fb8SKuninori Morimoto        $ref: "#/definitions/mclk-fs"
24879149fb8SKuninori Morimoto      aux-devs:
24979149fb8SKuninori Morimoto        $ref: "#/definitions/aux-devs"
25079149fb8SKuninori Morimoto      convert-rate:
25179149fb8SKuninori Morimoto        $ref: "#/definitions/convert-rate"
25279149fb8SKuninori Morimoto      convert-channels:
25379149fb8SKuninori Morimoto        $ref: "#/definitions/convert-channels"
25479149fb8SKuninori Morimoto      prefix:
25579149fb8SKuninori Morimoto        $ref: "#/definitions/prefix"
25679149fb8SKuninori Morimoto      pin-switches:
25779149fb8SKuninori Morimoto        $ref: "#/definitions/pin-switches"
25879149fb8SKuninori Morimoto      hp-det-gpio:
25979149fb8SKuninori Morimoto        maxItems: 1
26079149fb8SKuninori Morimoto      mic-det-gpio:
26179149fb8SKuninori Morimoto        maxItems: 1
26279149fb8SKuninori Morimoto
26379149fb8SKuninori Morimoto    patternProperties:
264cbf74bafSKrzysztof Kozlowski      "^cpu(-[0-9]+)?$":
26579149fb8SKuninori Morimoto        $ref: "#/definitions/dai"
266cbf74bafSKrzysztof Kozlowski      "^codec(-[0-9]+)?$":
26779149fb8SKuninori Morimoto        $ref: "#/definitions/dai"
26879149fb8SKuninori Morimoto    additionalProperties: false
26979149fb8SKuninori Morimoto
27079149fb8SKuninori Morimotorequired:
27179149fb8SKuninori Morimoto  - compatible
27279149fb8SKuninori Morimoto
27379149fb8SKuninori MorimotoadditionalProperties: false
27479149fb8SKuninori Morimoto
27579149fb8SKuninori Morimotoexamples:
27679149fb8SKuninori Morimoto# --------------------
27779149fb8SKuninori Morimoto# single DAI link
27879149fb8SKuninori Morimoto# --------------------
27979149fb8SKuninori Morimoto  - |
28079149fb8SKuninori Morimoto    sound {
28179149fb8SKuninori Morimoto        compatible = "simple-audio-card";
28279149fb8SKuninori Morimoto        simple-audio-card,name = "VF610-Tower-Sound-Card";
28379149fb8SKuninori Morimoto        simple-audio-card,format = "left_j";
28479149fb8SKuninori Morimoto        simple-audio-card,bitclock-master = <&dailink0_master>;
28579149fb8SKuninori Morimoto        simple-audio-card,frame-master = <&dailink0_master>;
28679149fb8SKuninori Morimoto        simple-audio-card,widgets =
28779149fb8SKuninori Morimoto                "Microphone", "Microphone Jack",
28879149fb8SKuninori Morimoto                "Headphone", "Headphone Jack",
28979149fb8SKuninori Morimoto                "Speaker", "External Speaker";
29079149fb8SKuninori Morimoto        simple-audio-card,routing =
29179149fb8SKuninori Morimoto                "MIC_IN", "Microphone Jack",
29279149fb8SKuninori Morimoto                "Headphone Jack", "HP_OUT",
29379149fb8SKuninori Morimoto                "External Speaker", "LINE_OUT";
29479149fb8SKuninori Morimoto
29579149fb8SKuninori Morimoto        simple-audio-card,cpu {
29679149fb8SKuninori Morimoto            sound-dai = <&sh_fsi2 0>;
29779149fb8SKuninori Morimoto        };
29879149fb8SKuninori Morimoto
29979149fb8SKuninori Morimoto        dailink0_master: simple-audio-card,codec {
30079149fb8SKuninori Morimoto            sound-dai = <&ak4648>;
30179149fb8SKuninori Morimoto            clocks = <&osc>;
30279149fb8SKuninori Morimoto        };
30379149fb8SKuninori Morimoto    };
30479149fb8SKuninori Morimoto
30579149fb8SKuninori Morimoto# --------------------
30679149fb8SKuninori Morimoto# Multi DAI links
30779149fb8SKuninori Morimoto# --------------------
30879149fb8SKuninori Morimoto  - |
30979149fb8SKuninori Morimoto    sound {
31079149fb8SKuninori Morimoto        compatible = "simple-audio-card";
31179149fb8SKuninori Morimoto        simple-audio-card,name = "Cubox Audio";
31279149fb8SKuninori Morimoto
31379149fb8SKuninori Morimoto        #address-cells = <1>;
31479149fb8SKuninori Morimoto        #size-cells = <0>;
31579149fb8SKuninori Morimoto
31679149fb8SKuninori Morimoto        simple-audio-card,dai-link@0 {		/* I2S - HDMI */
31779149fb8SKuninori Morimoto            reg = <0>;
31879149fb8SKuninori Morimoto            format = "i2s";
31979149fb8SKuninori Morimoto            cpu {
32079149fb8SKuninori Morimoto                sound-dai = <&audio0>;
32179149fb8SKuninori Morimoto            };
32279149fb8SKuninori Morimoto            codec {
32379149fb8SKuninori Morimoto                sound-dai = <&tda998x0>;
32479149fb8SKuninori Morimoto            };
32579149fb8SKuninori Morimoto        };
32679149fb8SKuninori Morimoto
32779149fb8SKuninori Morimoto        simple-audio-card,dai-link@1 {		/* S/PDIF - HDMI */
32879149fb8SKuninori Morimoto            reg = <1>;
32979149fb8SKuninori Morimoto            cpu {
33079149fb8SKuninori Morimoto                sound-dai = <&audio1>;
33179149fb8SKuninori Morimoto            };
33279149fb8SKuninori Morimoto            codec {
33379149fb8SKuninori Morimoto                sound-dai = <&tda998x1>;
33479149fb8SKuninori Morimoto            };
33579149fb8SKuninori Morimoto        };
33679149fb8SKuninori Morimoto
33779149fb8SKuninori Morimoto        simple-audio-card,dai-link@2 {		/* S/PDIF - S/PDIF */
33879149fb8SKuninori Morimoto            reg = <2>;
33979149fb8SKuninori Morimoto            cpu {
34079149fb8SKuninori Morimoto                sound-dai = <&audio2>;
34179149fb8SKuninori Morimoto            };
34279149fb8SKuninori Morimoto            codec {
34379149fb8SKuninori Morimoto                sound-dai = <&spdif_codec>;
34479149fb8SKuninori Morimoto            };
34579149fb8SKuninori Morimoto        };
34679149fb8SKuninori Morimoto    };
34779149fb8SKuninori Morimoto
34879149fb8SKuninori Morimoto# --------------------
34979149fb8SKuninori Morimoto# route audio from IMX6 SSI2 through TLV320DAC3100 codec
35079149fb8SKuninori Morimoto# through TPA6130A2 amplifier to headphones:
35179149fb8SKuninori Morimoto# --------------------
35279149fb8SKuninori Morimoto  - |
35379149fb8SKuninori Morimoto    sound {
35479149fb8SKuninori Morimoto        compatible = "simple-audio-card";
35579149fb8SKuninori Morimoto
35679149fb8SKuninori Morimoto        simple-audio-card,widgets =
35779149fb8SKuninori Morimoto            "Headphone", "Headphone Jack";
35879149fb8SKuninori Morimoto        simple-audio-card,routing =
35979149fb8SKuninori Morimoto            "Headphone Jack", "HPLEFT",
36079149fb8SKuninori Morimoto            "Headphone Jack", "HPRIGHT",
36179149fb8SKuninori Morimoto            "LEFTIN", "HPL",
36279149fb8SKuninori Morimoto            "RIGHTIN", "HPR";
36379149fb8SKuninori Morimoto        simple-audio-card,aux-devs = <&amp>;
36479149fb8SKuninori Morimoto        simple-audio-card,cpu {
36579149fb8SKuninori Morimoto            sound-dai = <&ssi2>;
36679149fb8SKuninori Morimoto        };
36779149fb8SKuninori Morimoto        simple-audio-card,codec {
36879149fb8SKuninori Morimoto            sound-dai = <&codec>;
36979149fb8SKuninori Morimoto            clocks = <&clocks>;
37079149fb8SKuninori Morimoto        };
37179149fb8SKuninori Morimoto    };
37279149fb8SKuninori Morimoto
37379149fb8SKuninori Morimoto# --------------------
374*b5f34841SHerve Codina# route audio to/from a codec through an amplifier
375*b5f34841SHerve Codina# designed with a potentiometer driven by IIO:
376*b5f34841SHerve Codina# --------------------
377*b5f34841SHerve Codina  - |
378*b5f34841SHerve Codina    sound {
379*b5f34841SHerve Codina        compatible = "simple-audio-card";
380*b5f34841SHerve Codina
381*b5f34841SHerve Codina        simple-audio-card,aux-devs = <&amp_in>, <&amp_out>;
382*b5f34841SHerve Codina        simple-audio-card,routing =
383*b5f34841SHerve Codina            "CODEC LEFTIN", "AMP_IN LEFT OUT",
384*b5f34841SHerve Codina            "CODEC RIGHTIN", "AMP_IN RIGHT OUT",
385*b5f34841SHerve Codina            "AMP_OUT LEFT IN", "CODEC LEFTOUT",
386*b5f34841SHerve Codina            "AMP_OUT RIGHT IN", "CODEC RIGHTOUT";
387*b5f34841SHerve Codina
388*b5f34841SHerve Codina        simple-audio-card,additional-devs {
389*b5f34841SHerve Codina            amp_out: iio-aux-out {
390*b5f34841SHerve Codina                compatible = "audio-iio-aux";
391*b5f34841SHerve Codina                io-channels = <&pot_out 0>, <&pot_out 1>;
392*b5f34841SHerve Codina                io-channel-names = "LEFT", "RIGHT";
393*b5f34841SHerve Codina                snd-control-invert-range = <1 1>;
394*b5f34841SHerve Codina                sound-name-prefix = "AMP_OUT";
395*b5f34841SHerve Codina            };
396*b5f34841SHerve Codina
397*b5f34841SHerve Codina            amp_in: iio_aux-in {
398*b5f34841SHerve Codina                compatible = "audio-iio-aux";
399*b5f34841SHerve Codina                io-channels = <&pot_in 0>, <&pot_in 1>;
400*b5f34841SHerve Codina                io-channel-names = "LEFT", "RIGHT";
401*b5f34841SHerve Codina                sound-name-prefix = "AMP_IN";
402*b5f34841SHerve Codina            };
403*b5f34841SHerve Codina        };
404*b5f34841SHerve Codina
405*b5f34841SHerve Codina        simple-audio-card,cpu {
406*b5f34841SHerve Codina            sound-dai = <&cpu>;
407*b5f34841SHerve Codina        };
408*b5f34841SHerve Codina
409*b5f34841SHerve Codina        simple-audio-card,codec {
410*b5f34841SHerve Codina            sound-dai = <&codec>;
411*b5f34841SHerve Codina            clocks = <&clocks>;
412*b5f34841SHerve Codina        };
413*b5f34841SHerve Codina    };
414*b5f34841SHerve Codina
415*b5f34841SHerve Codina# --------------------
41679149fb8SKuninori Morimoto# Sampling Rate Conversion
41779149fb8SKuninori Morimoto# --------------------
41879149fb8SKuninori Morimoto  - |
41979149fb8SKuninori Morimoto    sound {
42079149fb8SKuninori Morimoto        compatible = "simple-audio-card";
42179149fb8SKuninori Morimoto
42279149fb8SKuninori Morimoto        simple-audio-card,name = "rsnd-ak4643";
42379149fb8SKuninori Morimoto        simple-audio-card,format = "left_j";
42479149fb8SKuninori Morimoto        simple-audio-card,bitclock-master = <&sndcodec>;
42579149fb8SKuninori Morimoto        simple-audio-card,frame-master = <&sndcodec>;
42679149fb8SKuninori Morimoto
42779149fb8SKuninori Morimoto        simple-audio-card,convert-rate = <48000>;
42879149fb8SKuninori Morimoto
42979149fb8SKuninori Morimoto        simple-audio-card,prefix = "ak4642";
43079149fb8SKuninori Morimoto        simple-audio-card,routing = "ak4642 Playback", "DAI0 Playback",
43179149fb8SKuninori Morimoto                                    "DAI0 Capture", "ak4642 Capture";
43279149fb8SKuninori Morimoto
43379149fb8SKuninori Morimoto        sndcpu: simple-audio-card,cpu {
43479149fb8SKuninori Morimoto            sound-dai = <&rcar_sound>;
43579149fb8SKuninori Morimoto        };
43679149fb8SKuninori Morimoto
43779149fb8SKuninori Morimoto        sndcodec: simple-audio-card,codec {
43879149fb8SKuninori Morimoto            sound-dai = <&ak4643>;
43979149fb8SKuninori Morimoto            system-clock-frequency = <11289600>;
44079149fb8SKuninori Morimoto        };
44179149fb8SKuninori Morimoto    };
44279149fb8SKuninori Morimoto
44379149fb8SKuninori Morimoto# --------------------
44479149fb8SKuninori Morimoto# 2 CPU 1 Codec (Mixing)
44579149fb8SKuninori Morimoto# --------------------
44679149fb8SKuninori Morimoto  - |
44779149fb8SKuninori Morimoto    sound {
44879149fb8SKuninori Morimoto        compatible = "simple-audio-card";
4495aaec71dSFabio Estevam        #address-cells = <1>;
4505aaec71dSFabio Estevam        #size-cells = <0>;
45179149fb8SKuninori Morimoto
45279149fb8SKuninori Morimoto        simple-audio-card,name = "rsnd-ak4643";
45379149fb8SKuninori Morimoto        simple-audio-card,format = "left_j";
45479149fb8SKuninori Morimoto        simple-audio-card,bitclock-master = <&dpcmcpu>;
45579149fb8SKuninori Morimoto        simple-audio-card,frame-master = <&dpcmcpu>;
45679149fb8SKuninori Morimoto
45779149fb8SKuninori Morimoto        simple-audio-card,convert-rate = <48000>;
45879149fb8SKuninori Morimoto        simple-audio-card,convert-channels = <2>;
45979149fb8SKuninori Morimoto
46079149fb8SKuninori Morimoto        simple-audio-card,routing = "ak4642 Playback", "DAI0 Playback",
46179149fb8SKuninori Morimoto                                    "ak4642 Playback", "DAI1 Playback";
46279149fb8SKuninori Morimoto
46379149fb8SKuninori Morimoto        dpcmcpu: simple-audio-card,cpu@0 {
4645aaec71dSFabio Estevam            reg = <0>;
46579149fb8SKuninori Morimoto            sound-dai = <&rcar_sound 0>;
46679149fb8SKuninori Morimoto        };
46779149fb8SKuninori Morimoto
46879149fb8SKuninori Morimoto        simple-audio-card,cpu@1 {
4695aaec71dSFabio Estevam            reg = <1>;
47079149fb8SKuninori Morimoto            sound-dai = <&rcar_sound 1>;
47179149fb8SKuninori Morimoto        };
47279149fb8SKuninori Morimoto
47379149fb8SKuninori Morimoto        simple-audio-card,codec {
47479149fb8SKuninori Morimoto            prefix = "ak4642";
47579149fb8SKuninori Morimoto            sound-dai = <&ak4643>;
47679149fb8SKuninori Morimoto            clocks = <&audio_clock>;
47779149fb8SKuninori Morimoto        };
47879149fb8SKuninori Morimoto    };
47979149fb8SKuninori Morimoto
48079149fb8SKuninori Morimoto# --------------------
48179149fb8SKuninori Morimoto# Multi DAI links with DPCM:
48279149fb8SKuninori Morimoto#
48379149fb8SKuninori Morimoto# CPU0 ------ ak4613
48479149fb8SKuninori Morimoto# CPU1 ------ PCM3168A-p  /* DPCM 1ch/2ch */
48579149fb8SKuninori Morimoto# CPU2 --/                /* DPCM 3ch/4ch */
48679149fb8SKuninori Morimoto# CPU3 --/                /* DPCM 5ch/6ch */
48779149fb8SKuninori Morimoto# CPU4 --/                /* DPCM 7ch/8ch */
48879149fb8SKuninori Morimoto# CPU5 ------ PCM3168A-c
48979149fb8SKuninori Morimoto# --------------------
49079149fb8SKuninori Morimoto  - |
49179149fb8SKuninori Morimoto    sound {
49279149fb8SKuninori Morimoto        compatible = "simple-audio-card";
4935aaec71dSFabio Estevam        #address-cells = <1>;
4945aaec71dSFabio Estevam        #size-cells = <0>;
49579149fb8SKuninori Morimoto
49679149fb8SKuninori Morimoto        simple-audio-card,routing =
49779149fb8SKuninori Morimoto            "pcm3168a Playback", "DAI1 Playback",
49879149fb8SKuninori Morimoto            "pcm3168a Playback", "DAI2 Playback",
49979149fb8SKuninori Morimoto            "pcm3168a Playback", "DAI3 Playback",
50079149fb8SKuninori Morimoto            "pcm3168a Playback", "DAI4 Playback";
50179149fb8SKuninori Morimoto
50279149fb8SKuninori Morimoto        simple-audio-card,dai-link@0 {
5035aaec71dSFabio Estevam            reg = <0>;
50479149fb8SKuninori Morimoto            format = "left_j";
50579149fb8SKuninori Morimoto            bitclock-master = <&sndcpu0>;
50679149fb8SKuninori Morimoto            frame-master = <&sndcpu0>;
50779149fb8SKuninori Morimoto
50879149fb8SKuninori Morimoto            sndcpu0: cpu {
50979149fb8SKuninori Morimoto                sound-dai = <&rcar_sound 0>;
51079149fb8SKuninori Morimoto            };
51179149fb8SKuninori Morimoto            codec {
51279149fb8SKuninori Morimoto                sound-dai = <&ak4613>;
51379149fb8SKuninori Morimoto            };
51479149fb8SKuninori Morimoto        };
51579149fb8SKuninori Morimoto
51679149fb8SKuninori Morimoto        simple-audio-card,dai-link@1 {
5175aaec71dSFabio Estevam            reg = <1>;
51879149fb8SKuninori Morimoto            format = "i2s";
51979149fb8SKuninori Morimoto            bitclock-master = <&sndcpu1>;
52079149fb8SKuninori Morimoto            frame-master = <&sndcpu1>;
52179149fb8SKuninori Morimoto
52279149fb8SKuninori Morimoto            convert-channels = <8>; /* TDM Split */
52379149fb8SKuninori Morimoto
524cbf74bafSKrzysztof Kozlowski            sndcpu1: cpu-0 {
52579149fb8SKuninori Morimoto                sound-dai = <&rcar_sound 1>;
52679149fb8SKuninori Morimoto            };
527cbf74bafSKrzysztof Kozlowski            cpu-1 {
52879149fb8SKuninori Morimoto                sound-dai = <&rcar_sound 2>;
52979149fb8SKuninori Morimoto            };
530cbf74bafSKrzysztof Kozlowski            cpu-2 {
53179149fb8SKuninori Morimoto                sound-dai = <&rcar_sound 3>;
53279149fb8SKuninori Morimoto            };
533cbf74bafSKrzysztof Kozlowski            cpu-3 {
53479149fb8SKuninori Morimoto                sound-dai = <&rcar_sound 4>;
53579149fb8SKuninori Morimoto            };
53679149fb8SKuninori Morimoto            codec {
53779149fb8SKuninori Morimoto                mclk-fs = <512>;
53879149fb8SKuninori Morimoto                prefix = "pcm3168a";
53979149fb8SKuninori Morimoto                dai-tdm-slot-num = <8>;
54079149fb8SKuninori Morimoto                sound-dai = <&pcm3168a 0>;
54179149fb8SKuninori Morimoto            };
54279149fb8SKuninori Morimoto        };
54379149fb8SKuninori Morimoto
54479149fb8SKuninori Morimoto        simple-audio-card,dai-link@2 {
5455aaec71dSFabio Estevam            reg = <2>;
54679149fb8SKuninori Morimoto            format = "i2s";
54779149fb8SKuninori Morimoto            bitclock-master = <&sndcpu2>;
54879149fb8SKuninori Morimoto            frame-master = <&sndcpu2>;
54979149fb8SKuninori Morimoto
55079149fb8SKuninori Morimoto            sndcpu2: cpu {
55179149fb8SKuninori Morimoto                sound-dai = <&rcar_sound 5>;
55279149fb8SKuninori Morimoto            };
55379149fb8SKuninori Morimoto            codec {
55479149fb8SKuninori Morimoto                mclk-fs = <512>;
55579149fb8SKuninori Morimoto                prefix = "pcm3168a";
55679149fb8SKuninori Morimoto                sound-dai = <&pcm3168a 1>;
55779149fb8SKuninori Morimoto            };
55879149fb8SKuninori Morimoto        };
55979149fb8SKuninori Morimoto    };
560