1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/sound/audio-graph-port.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Audio Graph Card 'port'
8
9maintainers:
10  - Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
11
12select: false
13
14definitions:
15  port-base:
16    $ref: /schemas/graph.yaml#/$defs/port-base
17    properties:
18      convert-rate:
19        $ref: /schemas/sound/dai-params.yaml#/$defs/dai-sample-rate
20      convert-channels:
21        $ref: /schemas/sound/dai-params.yaml#/$defs/dai-channels
22      convert-sample-format:
23        $ref: /schemas/sound/dai-params.yaml#/$defs/dai-sample-format
24      mclk-fs:
25        $ref: simple-card.yaml#/definitions/mclk-fs
26
27  endpoint-base:
28    $ref: /schemas/graph.yaml#/$defs/endpoint-base
29    properties:
30      mclk-fs:
31        $ref: simple-card.yaml#/definitions/mclk-fs
32      frame-inversion:
33        description: dai-link uses frame clock inversion
34        $ref: /schemas/types.yaml#/definitions/flag
35      bitclock-inversion:
36        description: dai-link uses bit clock inversion
37        $ref: /schemas/types.yaml#/definitions/flag
38      frame-master:
39        description: Indicates dai-link frame master.
40        oneOf:
41          - $ref: /schemas/types.yaml#/definitions/flag
42          - $ref: /schemas/types.yaml#/definitions/phandle
43      bitclock-master:
44        description: Indicates dai-link bit clock master
45        oneOf:
46          - $ref: /schemas/types.yaml#/definitions/flag
47          - $ref: /schemas/types.yaml#/definitions/phandle
48      clocks:
49        description: Indicates system clock
50        $ref: /schemas/types.yaml#/definitions/phandle
51      system-clock-frequency:
52        $ref: simple-card.yaml#/definitions/system-clock-frequency
53      system-clock-direction-out:
54        $ref: simple-card.yaml#/definitions/system-clock-direction-out
55      system-clock-fixed:
56        $ref: simple-card.yaml#/definitions/system-clock-fixed
57
58      dai-format:
59        description: audio format.
60        items:
61          enum:
62            - i2s
63            - right_j
64            - left_j
65            - dsp_a
66            - dsp_b
67            - ac97
68            - pdm
69            - msb
70            - lsb
71      convert-rate:
72        $ref: /schemas/sound/dai-params.yaml#/$defs/dai-sample-rate
73      convert-channels:
74        $ref: /schemas/sound/dai-params.yaml#/$defs/dai-channels
75      convert-sample-format:
76        $ref: /schemas/sound/dai-params.yaml#/$defs/dai-sample-format
77
78      dai-tdm-slot-num:
79        description: Number of slots in use.
80        $ref: /schemas/types.yaml#/definitions/uint32
81      dai-tdm-slot-width:
82        description: Width in bits for each slot.
83        $ref: /schemas/types.yaml#/definitions/uint32
84      dai-tdm-slot-width-map:
85        description: Mapping of sample widths to slot widths. For hardware
86          that cannot support a fixed slot width or a slot width always
87          equal to sample width. A matrix of one or more 3-tuples.
88        $ref: /schemas/types.yaml#/definitions/uint32-matrix
89        items:
90          items:
91            -
92              description: Sample width in bits
93              minimum: 8
94              maximum: 64
95            -
96              description: Slot width in bits
97              minimum: 8
98              maximum: 256
99            -
100              description: Slot count
101              minimum: 1
102              maximum: 64
103
104  ports:
105    $ref: "#/definitions/port-base"
106    unevaluatedProperties: false
107    patternProperties:
108      "^port(@[0-9a-f]+)?$":
109        $ref: "#/definitions/port-base"
110        unevaluatedProperties: false
111        patternProperties:
112          "^endpoint(@[0-9a-f]+)?":
113            $ref: "#/definitions/endpoint-base"
114            unevaluatedProperties: false
115
116allOf:
117  - $ref: "#/definitions/port-base"
118
119patternProperties:
120  "^endpoint(@[0-9a-f]+)?":
121    $ref: "#/definitions/endpoint-base"
122    unevaluatedProperties: false
123
124additionalProperties: true
125