Skip to content

Commit b79b622

Browse files
pujarsbroonie
authored andcommitted
ASoC: dt-bindings: Definitions for DAI params
The "convert-channels" and "convert-rate" bindings are available for audio-graph-card and are documented in the audio-graph-port.yaml and the audio-graph.yaml. There is duplication of property details at multiple places. Introduce a new schema to have common definitions for DAI params and these can be re-used in other schemas wherever applicable. Presently update audio-graph-card bindings to use these definitions. If required simple-card bindings can be extended to make use of common definitions. Signed-off-by: Sameer Pujar <spujar@nvidia.com> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/1659936452-2254-2-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 4d39265 commit b79b622

File tree

3 files changed

+38
-12
lines changed

3 files changed

+38
-12
lines changed

Documentation/devicetree/bindings/sound/audio-graph-port.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ properties:
1919
description: "device name prefix"
2020
$ref: /schemas/types.yaml#/definitions/string
2121
convert-rate:
22-
description: CPU to Codec rate convert.
23-
$ref: /schemas/types.yaml#/definitions/uint32
22+
$ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate"
2423
convert-channels:
25-
description: CPU to Codec rate channels.
26-
$ref: /schemas/types.yaml#/definitions/uint32
24+
$ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels"
25+
2726
patternProperties:
2827
"^endpoint(@[0-9a-f]+)?":
2928
$ref: /schemas/graph.yaml#/$defs/endpoint-base
@@ -65,11 +64,9 @@ patternProperties:
6564
- msb
6665
- lsb
6766
convert-rate:
68-
description: CPU to Codec rate convert.
69-
$ref: /schemas/types.yaml#/definitions/uint32
67+
$ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate"
7068
convert-channels:
71-
description: CPU to Codec rate channels.
72-
$ref: /schemas/types.yaml#/definitions/uint32
69+
$ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels"
7370

7471
dai-tdm-slot-width-map:
7572
description: Mapping of sample widths to slot widths. For hardware

Documentation/devicetree/bindings/sound/audio-graph.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ properties:
2727
description: User specified audio sound widgets.
2828
$ref: /schemas/types.yaml#/definitions/non-unique-string-array
2929
convert-rate:
30-
description: CPU to Codec rate convert.
31-
$ref: /schemas/types.yaml#/definitions/uint32
30+
$ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate"
3231
convert-channels:
33-
description: CPU to Codec rate channels.
34-
$ref: /schemas/types.yaml#/definitions/uint32
32+
$ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels"
33+
3534
pa-gpios:
3635
maxItems: 1
3736
hp-det-gpio:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/sound/dai-params.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Digital Audio Interface (DAI) Stream Parameters
8+
9+
maintainers:
10+
- Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
11+
12+
select: false
13+
14+
$defs:
15+
16+
dai-channels:
17+
description: Number of audio channels used by DAI
18+
$ref: /schemas/types.yaml#/definitions/uint32
19+
minimum: 1
20+
maximum: 32
21+
22+
dai-sample-rate:
23+
description: Audio sample rate used by DAI
24+
$ref: /schemas/types.yaml#/definitions/uint32
25+
minimum: 8000
26+
maximum: 192000
27+
28+
properties: {}
29+
30+
additionalProperties: true

0 commit comments

Comments
 (0)