|
| 1 | +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) |
| 2 | +%YAML 1.2 |
| 3 | +--- |
| 4 | +$id: http://devicetree.org/schemas/sound/microchip,asrc-card.yaml# |
| 5 | +$schema: http://devicetree.org/meta-schemas/core.yaml# |
| 6 | + |
| 7 | +title: Sound Card driver for Microchip's Asynchronous Sample Rate Converter |
| 8 | + |
| 9 | +maintainers: |
| 10 | + - Codrin Ciubotariu <codrin.ciubotariu@microchip.com> |
| 11 | + |
| 12 | +description: |
| 13 | + Sound Card driver to be used with Microchip's ASRC. It is able to register |
| 14 | + the ASRC as Front-End and makes the rest of the audio IPs behave as |
| 15 | + Back-ends and as normal PCMs as well. The ASRC use is optional though. |
| 16 | + |
| 17 | +definitions: |
| 18 | + model: |
| 19 | + description: User specified audio sound card name. |
| 20 | + $ref: /schemas/types.yaml#/definitions/string |
| 21 | + |
| 22 | + audio-routing: |
| 23 | + description: | |
| 24 | + A list of the connections between audio components. |
| 25 | + Each entry is a pair of strings, the first being the |
| 26 | + connection's sink, the second being the connection's source. |
| 27 | + $ref: /schemas/types.yaml#/definitions/non-unique-string-array |
| 28 | + |
| 29 | + dai-tdm-slot-num: |
| 30 | + description: see tdm-slot.txt. |
| 31 | + $ref: /schemas/types.yaml#/definitions/uint32 |
| 32 | + |
| 33 | + dai-tdm-slot-width: |
| 34 | + description: see tdm-slot.txt. |
| 35 | + $ref: /schemas/types.yaml#/definitions/uint32 |
| 36 | + |
| 37 | + frame-master: |
| 38 | + description: Indicates dai-link frame master. |
| 39 | + $ref: /schemas/types.yaml#/definitions/phandle |
| 40 | + |
| 41 | + bitclock-master: |
| 42 | + description: Indicates dai-link bit clock master |
| 43 | + $ref: /schemas/types.yaml#/definitions/phandle |
| 44 | + |
| 45 | + label: |
| 46 | + maxItems: 1 |
| 47 | + |
| 48 | + format: |
| 49 | + description: audio format. |
| 50 | + items: |
| 51 | + enum: |
| 52 | + - i2s |
| 53 | + - right_j |
| 54 | + - left_j |
| 55 | + - dsp_a |
| 56 | + - dsp_b |
| 57 | + - pdm |
| 58 | + |
| 59 | + convert-rate: |
| 60 | + description: Front-End to Back-End rate convert. |
| 61 | + $ref: /schemas/types.yaml#/definitions/uint32 |
| 62 | + |
| 63 | + convert-channels: |
| 64 | + description: Front-end to Back-end channels convert. |
| 65 | + $ref: /schemas/types.yaml#/definitions/uint32 |
| 66 | + |
| 67 | + convert-sample-format: |
| 68 | + description: Front-end to Back-end sample format convert. |
| 69 | + $ref: /schemas/types.yaml#/definitions/uint32 |
| 70 | + |
| 71 | + dai: |
| 72 | + type: object |
| 73 | + properties: |
| 74 | + sound-dai: |
| 75 | + maxItems: 1 |
| 76 | + |
| 77 | + # common properties |
| 78 | + frame-master: |
| 79 | + $ref: /schemas/types.yaml#/definitions/flag |
| 80 | + bitclock-master: |
| 81 | + $ref: /schemas/types.yaml#/definitions/flag |
| 82 | + dai-tdm-slot-num: |
| 83 | + $ref: "#/definitions/dai-tdm-slot-num" |
| 84 | + dai-tdm-slot-width: |
| 85 | + $ref: "#/definitions/dai-tdm-slot-width" |
| 86 | + required: |
| 87 | + - sound-dai |
| 88 | +properties: |
| 89 | + compatible: |
| 90 | + const: microchip,sama7g5-asrc-card |
| 91 | + |
| 92 | + "#address-cells": |
| 93 | + const: 1 |
| 94 | + "#size-cells": |
| 95 | + const: 0 |
| 96 | + |
| 97 | + label: |
| 98 | + $ref: "#/definitions/label" |
| 99 | + |
| 100 | +patternProperties: |
| 101 | + "^microchip,dai-link(@[0-9a-f]+)?$": |
| 102 | + description: | |
| 103 | + Container for dai-link level properties and the CPU and CODEC sub-nodes. |
| 104 | + This container may be omitted when the card has only one DAI link. |
| 105 | + type: object |
| 106 | + properties: |
| 107 | + |
| 108 | + # common properties |
| 109 | + microchip,frame-master: |
| 110 | + $ref: "#/definitions/frame-master" |
| 111 | + microchip,bitclock-master: |
| 112 | + $ref: "#/definitions/bitclock-master" |
| 113 | + microchip,format: |
| 114 | + $ref: "#/definitions/format" |
| 115 | + microchip,convert-rate: |
| 116 | + $ref: "#/definitions/convert-rate" |
| 117 | + microchip,convert-channels: |
| 118 | + $ref: "#/definitions/convert-channels" |
| 119 | + microchip,convert-sample-format: |
| 120 | + $ref: "#/definitions/convert-sample-format" |
| 121 | + |
| 122 | + patternProperties: |
| 123 | + "^cpu(@[0-9a-f]+)?": |
| 124 | + $ref: "#/definitions/dai" |
| 125 | + "^codec(@[0-9a-f]+)?": |
| 126 | + $ref: "#/definitions/dai" |
| 127 | + additionalProperties: false |
| 128 | + |
| 129 | +required: |
| 130 | + - compatible |
| 131 | + - microchip,model |
| 132 | + |
| 133 | +additionalProperties: false |
| 134 | + |
| 135 | +examples: |
| 136 | + - | |
| 137 | + #include <dt-bindings/sound/microchip,asrc-card.h> |
| 138 | +
|
| 139 | + sound: sound { |
| 140 | + #address-cells = <1>; |
| 141 | + #size-cells = <0>; |
| 142 | + compatible = "microchip,asrc-card"; |
| 143 | + microchip,model = "mchp-asrc-card @ sama5g7 EK"; |
| 144 | +
|
| 145 | + microchip,audio-asrc = <&asrc 0>, <&asrc 1>, <&asrc 2>, <&asrc 3>; |
| 146 | +
|
| 147 | + microchip,dai-link@0 { |
| 148 | + reg = <0>; |
| 149 | + microchip,format = "i2s"; |
| 150 | + microchip,frame-master = <&dailink_master>; |
| 151 | + microchip,bitclock-master = <&dailink_master>; |
| 152 | + microchip,convert-channels = <2>; |
| 153 | + microchip,convert-rate = <48000>; |
| 154 | + microchip,convert-sample-format = <MCHP_ASRC_PCM_FORMAT_S24_LE>; |
| 155 | + dailink_master: cpu { |
| 156 | + sound-dai = <&i2s0>; |
| 157 | + }; |
| 158 | + codec { |
| 159 | + sound-dai = <&wm8731>; |
| 160 | + }; |
| 161 | + }; |
| 162 | + }; |
0 commit comments