All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Sameer Pujar <spujar@nvidia.com>
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
	kuninori.morimoto.gx@renesas.com, lgirdwood@gmail.com,
	linux-kernel@vger.kernel.org, tiwai@suse.com, broonie@kernel.org,
	krzysztof.kozlowski+dt@linaro.org
Subject: Re: [PATCH v2 1/3] ASoC: dt-bindings: Add schema for common DAI params
Date: Tue, 2 Aug 2022 08:46:02 -0600	[thread overview]
Message-ID: <20220802144602.GA30116-robh@kernel.org> (raw)
In-Reply-To: <982b3f0c-0b6c-d531-3d75-27d5ca1aabec@nvidia.com>

On Tue, Aug 02, 2022 at 04:15:28PM +0530, Sameer Pujar wrote:
> Hi Rob, Krzysztof
> 
> On 02-08-2022 01:00, Rob Herring wrote:
> > On Mon, 01 Aug 2022 21:37:30 +0530, Sameer Pujar wrote:
> > > The "convert-channels" and "convert-rate" bindings are provided for both
> > > simple-card and audio-graph-card. However these are separately defined in
> > > their respective schemas. For any new binding addition, which is common to
> > > both, there will be duplication.
> > > 
> > > Introduce a new schema to have common DAI params properties and these can
> > > be re-used in other schemas wherever applicable.
> > > 
> > > Signed-off-by: Sameer Pujar <spujar@nvidia.com>
> > > Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > > ---
> > >   .../bindings/sound/audio-graph-port.yaml           | 13 ++++------
> > >   .../devicetree/bindings/sound/audio-graph.yaml     |  7 +++---
> > >   .../devicetree/bindings/sound/dai-params.yaml      | 28 ++++++++++++++++++++++
> > >   .../devicetree/bindings/sound/simple-card.yaml     | 16 ++++---------
> > >   4 files changed, 40 insertions(+), 24 deletions(-)
> > >   create mode 100644 Documentation/devicetree/bindings/sound/dai-params.yaml
> > > 
> > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> > on your patch (DT_CHECKER_FLAGS is new in v5.13):
> > 
> > yamllint warnings/errors:
> > 
> > dtschema/dtc warnings/errors:
> > /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/simple-card.yaml: properties:simple-audio-card,convert-rate: 'oneOf' conditional failed, one must be fixed:
> >          'type' is a required property
> >                  hint: A vendor boolean property can use "type: boolean"
> >          'description' is a required property
> >                  hint: A vendor boolean property can use "type: boolean"
> >          Additional properties are not allowed ('$ref' was unexpected)
> >                  hint: A vendor boolean property can use "type: boolean"
> >          /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/simple-card.yaml: properties:simple-audio-card,convert-rate: 'oneOf' conditional failed, one must be fixed:
> >                  'enum' is a required property
> >                  'const' is a required property
> >                  hint: A vendor string property with exact values has an implicit type
> >                  from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
> >          '/schemas/sound/dai-params.yaml#/properties/dai-sample-rate' does not match 'types.yaml#/definitions/'
> >                  hint: A vendor property needs a $ref to types.yaml
> >          '/schemas/sound/dai-params.yaml#/properties/dai-sample-rate' does not match '^#/(definitions|\\$defs)/'
> >                  hint: A vendor property can have a $ref to a a $defs schema
> >          hint: Vendor specific properties must have a type and description unless they have a defined, common suffix.
> >          from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
> 
> I am hitting this error if I use properties/definitions from another schema.
> If I define it locally, it works. I see there are examples where properties
> from different schema are used. But not able to understand why errors are
> seen in my case. Am I missing anything here?

You either need to use 'properties' with actual property names and 
reference that schema from the node level. Or you use '$defs' if you are 
going to have references from the (DT) property level. I think I'd just 
leave simple-card out of this and do the former.

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: Sameer Pujar <spujar@nvidia.com>
Cc: krzysztof.kozlowski+dt@linaro.org, perex@perex.cz,
	kuninori.morimoto.gx@renesas.com, alsa-devel@alsa-project.org,
	broonie@kernel.org, tiwai@suse.com, lgirdwood@gmail.com,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] ASoC: dt-bindings: Add schema for common DAI params
Date: Tue, 2 Aug 2022 08:46:02 -0600	[thread overview]
Message-ID: <20220802144602.GA30116-robh@kernel.org> (raw)
In-Reply-To: <982b3f0c-0b6c-d531-3d75-27d5ca1aabec@nvidia.com>

On Tue, Aug 02, 2022 at 04:15:28PM +0530, Sameer Pujar wrote:
> Hi Rob, Krzysztof
> 
> On 02-08-2022 01:00, Rob Herring wrote:
> > On Mon, 01 Aug 2022 21:37:30 +0530, Sameer Pujar wrote:
> > > The "convert-channels" and "convert-rate" bindings are provided for both
> > > simple-card and audio-graph-card. However these are separately defined in
> > > their respective schemas. For any new binding addition, which is common to
> > > both, there will be duplication.
> > > 
> > > Introduce a new schema to have common DAI params properties and these can
> > > be re-used in other schemas wherever applicable.
> > > 
> > > Signed-off-by: Sameer Pujar <spujar@nvidia.com>
> > > Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > > ---
> > >   .../bindings/sound/audio-graph-port.yaml           | 13 ++++------
> > >   .../devicetree/bindings/sound/audio-graph.yaml     |  7 +++---
> > >   .../devicetree/bindings/sound/dai-params.yaml      | 28 ++++++++++++++++++++++
> > >   .../devicetree/bindings/sound/simple-card.yaml     | 16 ++++---------
> > >   4 files changed, 40 insertions(+), 24 deletions(-)
> > >   create mode 100644 Documentation/devicetree/bindings/sound/dai-params.yaml
> > > 
> > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> > on your patch (DT_CHECKER_FLAGS is new in v5.13):
> > 
> > yamllint warnings/errors:
> > 
> > dtschema/dtc warnings/errors:
> > /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/simple-card.yaml: properties:simple-audio-card,convert-rate: 'oneOf' conditional failed, one must be fixed:
> >          'type' is a required property
> >                  hint: A vendor boolean property can use "type: boolean"
> >          'description' is a required property
> >                  hint: A vendor boolean property can use "type: boolean"
> >          Additional properties are not allowed ('$ref' was unexpected)
> >                  hint: A vendor boolean property can use "type: boolean"
> >          /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/simple-card.yaml: properties:simple-audio-card,convert-rate: 'oneOf' conditional failed, one must be fixed:
> >                  'enum' is a required property
> >                  'const' is a required property
> >                  hint: A vendor string property with exact values has an implicit type
> >                  from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
> >          '/schemas/sound/dai-params.yaml#/properties/dai-sample-rate' does not match 'types.yaml#/definitions/'
> >                  hint: A vendor property needs a $ref to types.yaml
> >          '/schemas/sound/dai-params.yaml#/properties/dai-sample-rate' does not match '^#/(definitions|\\$defs)/'
> >                  hint: A vendor property can have a $ref to a a $defs schema
> >          hint: Vendor specific properties must have a type and description unless they have a defined, common suffix.
> >          from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
> 
> I am hitting this error if I use properties/definitions from another schema.
> If I define it locally, it works. I see there are examples where properties
> from different schema are used. But not able to understand why errors are
> seen in my case. Am I missing anything here?

You either need to use 'properties' with actual property names and 
reference that schema from the node level. Or you use '$defs' if you are 
going to have references from the (DT) property level. I think I'd just 
leave simple-card out of this and do the former.

  reply	other threads:[~2022-08-02 14:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-01 16:07 [PATCH v2 0/3] DT binding for sample format conversion Sameer Pujar
2022-08-01 16:07 ` Sameer Pujar
2022-08-01 16:07 ` [PATCH v2 1/3] ASoC: dt-bindings: Add schema for common DAI params Sameer Pujar
2022-08-01 16:07   ` Sameer Pujar
2022-08-01 19:30   ` Rob Herring
2022-08-01 19:30     ` Rob Herring
2022-08-02 10:45     ` Sameer Pujar
2022-08-02 10:45       ` Sameer Pujar
2022-08-02 14:46       ` Rob Herring [this message]
2022-08-02 14:46         ` Rob Herring
2022-08-04 10:09         ` Sameer Pujar
2022-08-01 16:07 ` [PATCH v2 2/3] ASoC: dt-bindings: Add sample format conversion Sameer Pujar
2022-08-01 16:07   ` Sameer Pujar
2022-08-02 14:50   ` Rob Herring
2022-08-02 14:50     ` Rob Herring
2022-08-04 11:09     ` Sameer Pujar
2022-08-01 16:07 ` [PATCH v2 3/3] ASoC: simple-card-utils: Fixup DAI sample format Sameer Pujar
2022-08-01 16:07   ` Sameer Pujar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220802144602.GA30116-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spujar@nvidia.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.