Skip to content

Commit de90db7

Browse files
author
Codrin Ciubotariu
committed
ASoC: dt-bindings: document Microchip's ASRC Sound Card
Add DT bindings for the new Sound Card that can be used to enable ASRC present in sama7g5 SoCs. Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
1 parent 2c1ab8c commit de90db7

2 files changed

Lines changed: 174 additions & 0 deletions

File tree

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
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+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef __DT_BINDINGS_MICROCHIP_ASRC_CARD_H__
3+
#define __DT_BINDINGS_MICROCHIP_ASRC_CARD_H__
4+
5+
/* formats to be used for Back-ends of Microhip's ASRC */
6+
/* must be kept in-sync with include/uapi/sound/asound.h */
7+
#define MCHP_ASRC_PCM_FORMAT_S8 0
8+
#define MCHP_ASRC_PCM_FORMAT_S16_LE 2
9+
#define MCHP_ASRC_PCM_FORMAT_S24_LE 6
10+
#define MCHP_ASRC_PCM_FORMAT_S32_LE 10
11+
12+
#endif /* __DT_BINDINGS_MICROCHIP_ASRC_CARD_H__ */

0 commit comments

Comments
 (0)