Received: by 10.192.165.148 with SMTP id m20csp3504723imm; Mon, 23 Apr 2018 07:40:50 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/8i1DC986U3HHh3Zrbn2gAdYtpSffx1Sn1BXxZoZlTPsXxIhUncD6Z1TqG32gpMitbNFg7 X-Received: by 10.99.105.195 with SMTP id e186mr7531536pgc.353.1524494450584; Mon, 23 Apr 2018 07:40:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524494450; cv=none; d=google.com; s=arc-20160816; b=GOnwO9CByX2FaOotAdbnn8Vu09dhf4PaW4hB3NGBQbg//jehSwYVYZUFJhFpoddvso 52lMHVfjMHZx5Wn9qz18r2ysaLOp32esAsNbOjWgRs3mwRgqw81nHXobRlydBj7zZoTv jZmopL2mYAyQGoVwj6D9RSfQFNAScNzh3balXUAKJnAaBVaN44GLm38iQXl1Ht9urDou 2Oc/NLX11ajL7uitH7b0KCccrCl3tYwyI82eH665saQjO2tBj8IJim4XnBwQes/eNEWN L14D3HsF5LBj6/d9lXdK+S77DbAQziWuAyJMwx0V9kux9YsINLhUvfHOyVnsXWfgR5Zj 4q7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dmarc-filter :arc-authentication-results; bh=djnQomR3XKcjh1iAbyiLm8qqn1Aznh6B6r60d29u0zM=; b=RIb9dxbaWaioQ6YqpunOeQB0dnp7kGjEqF3EB/qaHfsi0HyVefXBeIn+OxDe6NqR0O i3lZXppwHRovZC6FhRAez/nvhs8nLvSv086ME0ZfruSSt7iVSFjHC3gWJue18UD7x4Vu O1LO8G5Coen/eQjZ4ncOU52GUVbHoxS5MAUeov5ouwmuhxc08b7A33Lapu5hlitzF308 WU1Covj7nY51Cr9Erq+zvuNH8E7BiNhjdlc49hXpvEY60DoBCtogwQ32dk34y8zLh9gg nFSWmY9qz1O9zWtYaUXOuII6faeu31YzarJJIG9pUtIuXwgRBVT1qf2ykpXTZjlBpDbh cbEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si11709028plv.217.2018.04.23.07.40.35; Mon, 23 Apr 2018 07:40:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755494AbeDWOjZ (ORCPT + 99 others); Mon, 23 Apr 2018 10:39:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:40610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755207AbeDWOjV (ORCPT ); Mon, 23 Apr 2018 10:39:21 -0400 Received: from mail-qt0-f176.google.com (mail-qt0-f176.google.com [209.85.216.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3F38F217D4; Mon, 23 Apr 2018 14:39:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F38F217D4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=robh@kernel.org Received: by mail-qt0-f176.google.com with SMTP id s2-v6so17910146qti.2; Mon, 23 Apr 2018 07:39:21 -0700 (PDT) X-Gm-Message-State: ALQs6tDFb+9+90xwZUvNdqRLNmySeqLRfOL6EtrGcrgMV8vZxlZoQe4A YykTdfAB+o8xcMH1TabGKJwGVGpQ0Au2hHOZmw== X-Received: by 2002:ac8:c89:: with SMTP id n9-v6mr23607382qti.362.1524494360360; Mon, 23 Apr 2018 07:39:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.163.228 with HTTP; Mon, 23 Apr 2018 07:38:59 -0700 (PDT) In-Reply-To: <63a1c096-7d78-3850-83b7-94c6009e93f0@arm.com> References: <20180418222905.10414-1-robh@kernel.org> <152424282214.46528.2511757264045171935@swboyd.mtv.corp.google.com> <152426770474.46528.1592920281091105196@swboyd.mtv.corp.google.com> <63a1c096-7d78-3850-83b7-94c6009e93f0@arm.com> From: Rob Herring Date: Mon, 23 Apr 2018 09:38:59 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH] dt-bindings: add a jsonschema binding example To: Grant Likely Cc: Stephen Boyd , devicetree-spec@vger.kernel.org, devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Frank Rowand , Mark Rutland , Geert Uytterhoeven , Linus Walleij , Thierry Reding , Mark Brown , Shawn Guo , Bjorn Andersson , Arnd Bergmann , Jonathan Cameron Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 23, 2018 at 9:01 AM, Grant Likely wrote: > On 21/04/2018 00:41, Stephen Boyd wrote: >> >> Quoting Rob Herring (2018-04-20 11:15:04) >>> >>> On Fri, Apr 20, 2018 at 11:47 AM, Stephen Boyd wrote: >>>> >>>> Quoting Rob Herring (2018-04-18 15:29:05) >>>>> >>>>> diff --git a/Documentation/devicetree/bindings/example-schema.yaml >>>>> b/Documentation/devicetree/bindings/example-schema.yaml >>>>> new file mode 100644 >>>>> index 000000000000..fe0a3bd1668e >>>>> --- /dev/null >>>>> +++ b/Documentation/devicetree/bindings/example-schema.yaml > > [...] >>>>> >>>>> + interrupts: >>>>> + # Either 1 or 2 interrupts can be present >>>>> + minItems: 1 >>>>> + maxItems: 2 >>>>> + items: >>>>> + - description: tx or combined interrupt >>>>> + - description: rx interrupt >>>>> + >>>>> + description: | >>>> >>>> >>>> The '|' is needed to make yaml happy? >>> >>> >>> Yes, this is simply how you do literal text blocks in yaml. >>> >>> We don't really need for this one really, but for the top-level >>> 'description' we do. The long term intent is 'description' would be >>> written in sphinx/rst and can be extracted into the DT spec (for >>> common bindings). Grant has experimented with that some. >> >> >> Ok. That sounds cool. Then we could embed links to datasheets and SVGs >> too. > > > I'd like it if we can define the description text blocks to be > reStructeredText markup. That makes it even easier to integrate with the > specification documentation. I think that's going to require thinking about how each binding is integrated into the spec. We're only talking about common bindings I presume, but still we have no model defined. For example, with properties, I'd assume we'd want to generate a table of properties and we wouldn't want the property descriptions in rST because the description becomes just a cell in the table. So we need some sort of template. Also, how do we validate that description contains valid rST? No point requiring it until we can validate it. > [...] >>>>> >>>>> + # Property names starting with '#' must be quoted >>>>> + '#interrupt-cells': >>>>> + # A simple case where the value must always be '2'. >>>>> + # The core schema handles that this must be a single integer. >>>>> + const: 2 >>>>> + >>>>> + interrupt-controller: {} >>>> >>>> >>>> Does '{}' mean nothing to see here? >>> >>> >>> Yes. It's just an empty schema that's always valid. > > > IIRC, in the current jsonschema draft-6 spec, the following also has the > same behaviour, which I like slightly better: > interrupt-controller: true They are not exactly the same. '{}' is a schema object and 'true' is just a boolean. But yes, it can work. We need to drop "type: object" from meta-schemas/boolean.yaml and it will work. Rob