Re: [PATCH] ASoC: dt-bindings: Centralize the 'sound-dai' definition

From: Jerome Brunet
Date: Thu Jan 27 2022 - 11:23:27 EST



On Thu 27 Jan 2022 at 08:35, Rob Herring <robh@xxxxxxxxxx> wrote:

> On Thu, Jan 27, 2022 at 3:05 AM Jerome Brunet <jbrunet@xxxxxxxxxxxx> wrote:
>>
>>
>> On Wed 26 Jan 2022 at 17:14, Rob Herring <robh@xxxxxxxxxx> wrote:
>>
>> > 'sound-dai' is a common property, but has duplicate type definitions.
>> > Create a new common definition to define the type and then update all
>> > the other occurrences to just define how many entries there are just
>> > like other phandle+arg properties.
>> >
>> > The constraints on the number of entries is based on the examples and
>> > could be wrong.
>> >
>> > Cc: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxx>
>> > Signed-off-by: Rob Herring <robh@xxxxxxxxxx>
>> > ---
>> > Please ack, this depends on commit abf0fee97313 ("dt-bindings: Improve
>> > phandle-array schemas") in my tree.
>> > ---
>> > .../bindings/sound/amlogic,gx-sound-card.yaml | 4 ++--
>> > .../bindings/sound/google,sc7180-trogdor.yaml | 6 ++++--
>> > .../bindings/sound/imx-audio-card.yaml | 7 +++++--
>> > .../bindings/sound/qcom,sm8250.yaml | 10 +++++++---
>> > .../bindings/sound/samsung,aries-wm8994.yaml | 5 +----
>> > .../bindings/sound/samsung,midas-audio.yaml | 2 --
>> > .../bindings/sound/samsung,odroid.yaml | 9 +++------
>> > .../devicetree/bindings/sound/sound-dai.yaml | 20 +++++++++++++++++++
>> > 8 files changed, 42 insertions(+), 21 deletions(-)
>> > create mode 100644 Documentation/devicetree/bindings/sound/sound-dai.yaml
>> >
>> > diff --git a/Documentation/devicetree/bindings/sound/amlogic,gx-sound-card.yaml b/Documentation/devicetree/bindings/sound/amlogic,gx-sound-card.yaml
>> > index 2e35aeaa8781..8b5be4b92f35 100644
>> > --- a/Documentation/devicetree/bindings/sound/amlogic,gx-sound-card.yaml
>> > +++ b/Documentation/devicetree/bindings/sound/amlogic,gx-sound-card.yaml
>> > @@ -57,7 +57,7 @@ patternProperties:
>> > rate
>> >
>> > sound-dai:
>> > - $ref: /schemas/types.yaml#/definitions/phandle-array
>> > + maxItems: 1
>> > description: phandle of the CPU DAI
>> >
>> > patternProperties:
>> > @@ -71,7 +71,7 @@ patternProperties:
>> >
>> > properties:
>> > sound-dai:
>> > - $ref: /schemas/types.yaml#/definitions/phandle-array
>> > + maxItems: 1
>>
>> No min or max here. Links may have more than one codec.
>>
>> Ex:
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts#n158
>
> What do you mean? Every 'sound-dai' there only has 1 phande+args. Each
> codec is a child node.

Yes it is a child - sorry I misunderstood.
I thought the MaxItems: 1 would limit the number of codecs

For the amlogic part:
Acked-by: Jerome Brunet <jbrunet@xxxxxxxxxxxx>

>
> Rob