Skip to content

Commit

Permalink
ASoC: dt-bindings: Definitions for DAI params
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Kuninori Morimoto <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
pujars authored and broonie committed Aug 15, 2022
1 parent 4d39265 commit b79b622
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 12 deletions.
13 changes: 5 additions & 8 deletions Documentation/devicetree/bindings/sound/audio-graph-port.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ properties:
description: "device name prefix"
$ref: /schemas/types.yaml#/definitions/string
convert-rate:
description: CPU to Codec rate convert.
$ref: /schemas/types.yaml#/definitions/uint32
$ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate"
convert-channels:
description: CPU to Codec rate channels.
$ref: /schemas/types.yaml#/definitions/uint32
$ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels"

patternProperties:
"^endpoint(@[0-9a-f]+)?":
$ref: /schemas/graph.yaml#/$defs/endpoint-base
Expand Down Expand Up @@ -65,11 +64,9 @@ patternProperties:
- msb
- lsb
convert-rate:
description: CPU to Codec rate convert.
$ref: /schemas/types.yaml#/definitions/uint32
$ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate"
convert-channels:
description: CPU to Codec rate channels.
$ref: /schemas/types.yaml#/definitions/uint32
$ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels"

dai-tdm-slot-width-map:
description: Mapping of sample widths to slot widths. For hardware
Expand Down
7 changes: 3 additions & 4 deletions Documentation/devicetree/bindings/sound/audio-graph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ properties:
description: User specified audio sound widgets.
$ref: /schemas/types.yaml#/definitions/non-unique-string-array
convert-rate:
description: CPU to Codec rate convert.
$ref: /schemas/types.yaml#/definitions/uint32
$ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate"
convert-channels:
description: CPU to Codec rate channels.
$ref: /schemas/types.yaml#/definitions/uint32
$ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels"

pa-gpios:
maxItems: 1
hp-det-gpio:
Expand Down
30 changes: 30 additions & 0 deletions Documentation/devicetree/bindings/sound/dai-params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/dai-params.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Digital Audio Interface (DAI) Stream Parameters

maintainers:
- Kuninori Morimoto <[email protected]>

select: false

$defs:

dai-channels:
description: Number of audio channels used by DAI
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 1
maximum: 32

dai-sample-rate:
description: Audio sample rate used by DAI
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 8000
maximum: 192000

properties: {}

additionalProperties: true

0 comments on commit b79b622

Please sign in to comment.