[PATCH] dt-bindings: Improve phandle-array schemas

Krzysztof Kozlowski krzysztof.kozlowski at canonical.com
Mon Jan 24 17:55:06 CET 2022


On Wed, 19 Jan 2022 at 02:50, Rob Herring <robh at kernel.org> wrote:
>
> The 'phandle-array' type is a bit ambiguous. It can be either just an
> array of phandles or an array of phandles plus args. Many schemas for
> phandle-array properties aren't clear in the schema which case applies
> though the description usually describes it.
>

Hi Rob,

I have few questions below.

(...)

> diff --git a/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml b/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml
> index 095775c598fa..3a4df2ce1728 100644
> --- a/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml
> +++ b/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml
> @@ -21,8 +21,7 @@ properties:
>      type: object
>      properties:
>        sound-dai:
> -        $ref: /schemas/types.yaml#/definitions/phandle-array
> -        maxItems: 1
> +        $ref: /schemas/types.yaml#/definitions/phandle
>          description: phandle to the I2S controller
>      required:
>        - sound-dai

This passes the example only because the example was simplified to
hide dtschema errors.

The cpu dai node is like:
cpu {
    sound-dai = <&i2s0 0>;
};

and this fails with errors missing phandle tag in 0.

I am converting rest of Samsung audio bindings to dtschema and have
trouble expressing this. How schema should express such cpu node?

Best regards,
Krzysztof


More information about the Alsa-devel mailing list