Skip to content

Commit

Permalink
ASoC: dt-bindings: Fix patternProperties with fixed strings
Browse files Browse the repository at this point in the history
The simple-audio-card and renesas,rsnd bindings used 'patternProperties'
with fixed strings to work-around a dtschema meta-schema limitation. This
is now fixed and the schemas can be fixed to use 'properties' instead.

Signed-off-by: Rob Herring <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
robherring authored and broonie committed Mar 14, 2022
1 parent ccb4214 commit 910f42b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 30 deletions.
16 changes: 7 additions & 9 deletions Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ properties:
$ref: audio-graph-port.yaml#
unevaluatedProperties: false

# use patternProperties to avoid naming "xxx,yyy" issue
patternProperties:
"^rcar_sound,dvc$":
rcar_sound,dvc:
description: DVC subnode.
type: object
patternProperties:
Expand All @@ -141,7 +139,7 @@ patternProperties:
- dma-names
additionalProperties: false

"^rcar_sound,mix$":
rcar_sound,mix:
description: MIX subnode.
type: object
patternProperties:
Expand All @@ -150,7 +148,7 @@ patternProperties:
# no properties
additionalProperties: false

"^rcar_sound,ctu$":
rcar_sound,ctu:
description: CTU subnode.
type: object
patternProperties:
Expand All @@ -159,7 +157,7 @@ patternProperties:
# no properties
additionalProperties: false

"^rcar_sound,src$":
rcar_sound,src:
description: SRC subnode.
type: object
patternProperties:
Expand All @@ -182,7 +180,7 @@ patternProperties:
- dma-names
additionalProperties: false

"^rcar_sound,ssiu$":
rcar_sound,ssiu:
description: SSIU subnode.
type: object
patternProperties:
Expand All @@ -202,7 +200,7 @@ patternProperties:
- dma-names
additionalProperties: false

"^rcar_sound,ssi$":
rcar_sound,ssi:
description: SSI subnode.
type: object
patternProperties:
Expand Down Expand Up @@ -239,7 +237,7 @@ patternProperties:
additionalProperties: false

# For DAI base
"^rcar_sound,dai$":
rcar_sound,dai:
description: DAI subnode.
type: object
patternProperties:
Expand Down
42 changes: 21 additions & 21 deletions Documentation/devicetree/bindings/sound/simple-card.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,45 +167,45 @@ properties:
description: User specified audio sound card name.
$ref: /schemas/types.yaml#/definitions/string

# use patternProperties to avoid naming "xxx,yyy" issue
patternProperties:
"^simple-audio-card,widgets$":
simple-audio-card,widgets:
$ref: "#/definitions/widgets"
"^simple-audio-card,routing$":
simple-audio-card,routing:
$ref: "#/definitions/routing"
"^simple-audio-card,cpu(@[0-9a-f]+)?":
$ref: "#/definitions/dai"
"^simple-audio-card,codec(@[0-9a-f]+)?":
$ref: "#/definitions/dai"

# common properties
"^simple-audio-card,frame-master$":
simple-audio-card,frame-master:
$ref: "#/definitions/frame-master"
"^simple-audio-card,bitclock-master$":
simple-audio-card,bitclock-master:
$ref: "#/definitions/bitclock-master"
"^simple-audio-card,frame-inversion$":
simple-audio-card,frame-inversion:
$ref: "#/definitions/frame-inversion"
"^simple-audio-card,bitclock-inversion$":
simple-audio-card,bitclock-inversion:
$ref: "#/definitions/bitclock-inversion"
"^simple-audio-card,format$":
simple-audio-card,format:
$ref: "#/definitions/format"
"^simple-audio-card,mclk-fs$":
simple-audio-card,mclk-fs:
$ref: "#/definitions/mclk-fs"
"^simple-audio-card,aux-devs$":
simple-audio-card,aux-devs:
$ref: "#/definitions/aux-devs"
"^simple-audio-card,convert-rate$":
simple-audio-card,convert-rate:
$ref: "#/definitions/convert-rate"
"^simple-audio-card,convert-channels$":
simple-audio-card,convert-channels:
$ref: "#/definitions/convert-channels"
"^simple-audio-card,prefix$":
simple-audio-card,prefix:
$ref: "#/definitions/prefix"
"^simple-audio-card,pin-switches$":
simple-audio-card,pin-switches:
$ref: "#/definitions/pin-switches"
"^simple-audio-card,hp-det-gpio$":
simple-audio-card,hp-det-gpio:
maxItems: 1
"^simple-audio-card,mic-det-gpio$":
simple-audio-card,mic-det-gpio:
maxItems: 1

patternProperties:
"^simple-audio-card,cpu(@[0-9a-f]+)?$":
$ref: "#/definitions/dai"
"^simple-audio-card,codec(@[0-9a-f]+)?$":
$ref: "#/definitions/dai"

"^simple-audio-card,dai-link(@[0-9a-f]+)?$":
description: |
Container for dai-link level properties and the CPU and CODEC sub-nodes.
Expand Down

0 comments on commit 910f42b

Please sign in to comment.