dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh+dt@kernel.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Jacopo Mondi <jacopo+renesas@jmondi.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Maxime Ripard <maxime@cerno.tech>
Subject: Re: [PATCH 4/4] dt-bindings: display: bridge: renesas,lvds: Convert binding to YAML
Date: Mon, 6 Apr 2020 13:19:40 -0600	[thread overview]
Message-ID: <CAL_JsqKhdQdfX4bHe2dxR_TiK2jWpdY=pacHOme+qaJ-MdN_fg@mail.gmail.com> (raw)
In-Reply-To: <CAMuHMdWhj1uS6v1bb0ntsP_b29Sgw+M6KHPceDxmeF3329Aw=g@mail.gmail.com>

On Mon, Apr 6, 2020 at 5:40 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Laurent,
>
> On Mon, Apr 6, 2020 at 1:09 PM Laurent Pinchart
> <laurent.pinchart@ideasonboard.com> wrote:
> > On Mon, Apr 06, 2020 at 10:47:37AM +0200, Geert Uytterhoeven wrote:
> > > On Mon, Apr 6, 2020 at 1:24 AM Laurent Pinchart wrote:
> > > > Convert the Renesas R-Car LVDS encoder text binding to YAML.
> > > >
> > > > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
>
> > > > +if:
> > > > +  properties:
> > > > +    compatible:
> > > > +      enum:
> > > > +        - renesas,r8a774c0-lvds
> > > > +        - renesas,r8a77990-lvds
> > > > +        - renesas,r8a77995-lvds
> > > > +then:
> > > > +  properties:
> > > > +    clocks:
> > > > +      minItems: 1
> > > > +      maxItems: 4
> > > > +      items:
> > > > +        - description: Functional clock
> > > > +        - description: EXTAL input clock
> > > > +        - description: DU_DOTCLKIN0 input clock
> > > > +        - description: DU_DOTCLKIN1 input clock
> > > > +
> > > > +    clock-names:
> > > > +      minItems: 1
> > > > +      maxItems: 4
> > > > +      items:
> > > > +        - const: fck
> > > > +        # The LVDS encoder can use the EXTAL or DU_DOTCLKINx clocks.
> > > > +        # These clocks are optional.
> > > > +        - enum:
> > > > +          - extal
> > > > +          - dclkin.0
> > > > +          - dclkin.1
> > > > +        - enum:
> > > > +          - extal
> > > > +          - dclkin.0
> > > > +          - dclkin.1
> > > > +        - enum:
> > > > +          - extal
> > > > +          - dclkin.0
> > > > +          - dclkin.1
> > >
> > > Can the duplication of the last 3 entries be avoided?
> > > Perhaps like in
> > > Documentation/devicetree/bindings/serial/renesas,scif.yaml?
> >
> > I'd love to, if you can tell me how to make sure the fck entry is
> > mandatory. The following
> >
> >   minItems: 1
> >   maxItems: 4
> >   items:
> >     enum:
> >       - fck
> >       - extal
> >       - dclkin.0
> >       - dclkin.1
> >
> > passes the checks, but would accept
> >
> >         clock-names = "extal";
> >
> > which is not valid. Your
> > Documentation/devicetree/bindings/serial/renesas,scif.yaml bindings
> > suffer from the same problem :-)
>
> Hmm....
>
> > > > +examples:
> > > > +  - |
> > > > +    #include <dt-bindings/clock/renesas-cpg-mssr.h>
> > > > +    #include <dt-bindings/power/r8a7795-sysc.h>
> > > > +
> > > > +    lvds@feb90000 {
> > > > +        compatible = "renesas,r8a7795-lvds";
> > > > +        reg = <0 0xfeb90000 0 0x14>;
> > >
> > > Examples are built with #{address,size}-cells = <1>.
> >
> > Are they ? I don't get any failure from make dt_binding_check.
>
> Hmm... And you do have "reg: maxItems: 1"...

At first glance I was expecting an error too, but there isn't. As far
as the schema is concerned, it's valid because it's a single entry
(i.e. one entry in <>). And then dtc can only check that reg is a
multiple of 2. The size check does work where we have more constraints
like I2C.

If we enforce bracketing, then we should be able to check these.
Otherwise, knowing both the cell sizes and number of entries is a
problem. With bracketing, we can split those checks. I'd been thinking
checking cell sizes would be easier in dtc (we're already doing that
in lots of cases), but thinking about it some more there is a way to
do this with schema:

if:
  properties:
    '#address-cells':
      const: 2
    '#size-cells':
      const: 2
  required:
    - '#address-cells'
    - '#size-cells'
then:
  patternProperties:
    '@':
      properties:
        reg:
          items:
            minItems: 4
            maxItems: 4
      required:
        - reg

...and copy-n-paste for each size combination.

I imagine implementing this will result in another set of fixes.

Rob
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-04-06 19:29 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-05 23:23 [PATCH 0/4] dt-bindings: display: bridge: Convert bindings used by R-Car DU to YAML Laurent Pinchart
2020-04-05 23:23 ` [PATCH 1/4] dt-bindings: display: bridge: Reject additional properties in ports node Laurent Pinchart
2020-04-06  7:47   ` Maxime Ripard
2020-04-14 21:56   ` Rob Herring
2020-04-05 23:23 ` [PATCH 2/4] dt-bindings: display: bridge: Convert simple-bridge bindings to YAML Laurent Pinchart
2020-04-06  7:47   ` Maxime Ripard
2020-04-14 22:00   ` Rob Herring
2020-04-15  0:54     ` Laurent Pinchart
2020-04-15  0:59       ` [PATCH v1.1 " Laurent Pinchart
2020-04-15 13:51         ` Rob Herring
2020-04-05 23:23 ` [PATCH 3/4] dt-bindings: display: bridge: thc63lvd1024: Convert binding " Laurent Pinchart
2020-04-06  6:40   ` Jacopo Mondi
2020-04-06 11:15     ` Laurent Pinchart
2020-05-13 23:21       ` [PATCH 5/4] dt-bindings: display: bridge: thc63lvd1024: Document dual-output mode Laurent Pinchart
2020-05-14  7:18         ` Jacopo Mondi
2020-05-28  2:42         ` Rob Herring
2020-04-06  7:48   ` [PATCH 3/4] dt-bindings: display: bridge: thc63lvd1024: Convert binding to YAML Maxime Ripard
2020-04-14 22:01   ` Rob Herring
2020-04-05 23:23 ` [PATCH 4/4] dt-bindings: display: bridge: renesas, lvds: " Laurent Pinchart
2020-04-06  7:49   ` [PATCH 4/4] dt-bindings: display: bridge: renesas,lvds: " Maxime Ripard
2020-04-06  8:47   ` Geert Uytterhoeven
2020-04-06 11:09     ` Laurent Pinchart
2020-04-06 11:40       ` Geert Uytterhoeven
2020-04-06 19:19         ` Rob Herring [this message]
2020-05-13 23:28   ` [PATCH v1.1 4/4] dt-bindings: display: bridge: renesas, lvds: " Laurent Pinchart
2020-05-14  7:31     ` [PATCH v1.1 4/4] dt-bindings: display: bridge: renesas,lvds: " Geert Uytterhoeven
2020-05-14 15:17       ` Laurent Pinchart
2020-05-14 19:02         ` Geert Uytterhoeven
2020-05-14 21:37           ` Laurent Pinchart
2020-05-14 21:42             ` [PATCH v1.2 4/4] dt-bindings: display: bridge: renesas, lvds: " Laurent Pinchart
2020-05-28 17:50               ` Rob Herring
2020-06-29  8:10               ` Sam Ravnborg
2020-06-29 23:41                 ` Laurent Pinchart
2020-05-13 23:39 ` [PATCH 6/4] dt-bindings: display: renesas: lvds: RZ/G2E needs renesas, companion too Laurent Pinchart
2020-05-14  6:44   ` [PATCH 6/4] dt-bindings: display: renesas: lvds: RZ/G2E needs renesas,companion too Geert Uytterhoeven
2020-06-29  8:11     ` Sam Ravnborg
2020-06-29 23:42       ` Laurent Pinchart

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='CAL_JsqKhdQdfX4bHe2dxR_TiK2jWpdY=pacHOme+qaJ-MdN_fg@mail.gmail.com' \
    --to=robh+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert@linux-m68k.org \
    --cc=jacopo+renesas@jmondi.org \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=maxime@cerno.tech \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).