linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Lubomir Rintel <lkundrak@v3.sk>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Jason Cooper <jason@lakedaemon.net>,
	Linus Walleij <linus.walleij@linaro.org>,
	Marc Zyngier <maz@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/9] dt-bindings: i2c: Convert i2c-pxa to json-schema
Date: Thu, 28 May 2020 16:57:47 -0600	[thread overview]
Message-ID: <20200528225747.GA830663@bogus> (raw)
In-Reply-To: <20200521091356.2211020-4-lkundrak@v3.sk>

On Thu, May 21, 2020 at 11:13:50AM +0200, Lubomir Rintel wrote:
> A conversion of the i2c-pxa binding to DT schema format using json-schema.
> 
> This also cleans ups some errors in the binding: The compatible string
> description suggested that "mmp" in "mrvl,mmp-twsi" is to be substituted
> with a processor model, which wouldn't be a right thing to do and indeed
> nobody seems to have been doing that. There also was "Recommended
> properties" section that included optional as well as mandatory
> properties. Missing mandatory properties were added to the example.
> 
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> 
> ---
> Changes since v1:
> - Add default GPL-2.0-only license tag
> - Fill in maintainers from MAINTAINERS file
> 
>  .../devicetree/bindings/i2c/i2c-pxa.txt       | 31 --------
>  .../devicetree/bindings/i2c/i2c-pxa.yaml      | 72 +++++++++++++++++++
>  2 files changed, 72 insertions(+), 31 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-pxa.txt
>  create mode 100644 Documentation/devicetree/bindings/i2c/i2c-pxa.yaml
> 
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-pxa.txt b/Documentation/devicetree/bindings/i2c/i2c-pxa.txt
> deleted file mode 100644
> index c30783c0eca0..000000000000
> --- a/Documentation/devicetree/bindings/i2c/i2c-pxa.txt
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -* Marvell MMP I2C controller
> -
> -Required properties :
> -
> - - reg : Offset and length of the register set for the device
> - - compatible : should be "mrvl,mmp-twsi" where mmp is the name of a
> -   compatible processor, e.g. pxa168, pxa910, mmp2, mmp3.
> -   For the pxa2xx/pxa3xx, an additional node "mrvl,pxa-i2c" is required
> -   as shown in the example below.
> -   For the Armada 3700, the compatible should be "marvell,armada-3700-i2c".
> -
> -Recommended properties :
> -
> - - interrupts : the interrupt number
> - - mrvl,i2c-polling : Disable interrupt of i2c controller. Polling
> -   status register of i2c controller instead.
> - - mrvl,i2c-fast-mode : Enable fast mode of i2c controller.
> -
> -Examples:
> -	twsi1: i2c@d4011000 {
> -		compatible = "mrvl,mmp-twsi";
> -		reg = <0xd4011000 0x1000>;
> -		interrupts = <7>;
> -		mrvl,i2c-fast-mode;
> -	};
> -	
> -	twsi2: i2c@d4025000 {
> -		compatible = "mrvl,mmp-twsi";
> -		reg = <0xd4025000 0x1000>;
> -		interrupts = <58>;
> -	};
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-pxa.yaml b/Documentation/devicetree/bindings/i2c/i2c-pxa.yaml
> new file mode 100644
> index 000000000000..19c81972243d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/i2c/i2c-pxa.yaml
> @@ -0,0 +1,72 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/i2c/i2c-pxa.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Marvell MMP I2C controller bindings
> +
> +maintainers:
> +  - Rob Herring <robh+dt@kernel.org>
> +
> +allOf:
> +  - $ref: /schemas/i2c/i2c-controller.yaml#
> +  - if:
> +      not:
> +        required:
> +          - mrvl,i2c-polling
> +    then:
> +        required:
> +          - interrupts
> +
> +properties:
> +  compatible:
> +    enum:
> +      - mrvl,mmp-twsi
> +      - mrvl,pxa-i2c
> +      - marvell,armada-3700-i2c
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    minItems: 1
> +
> +  resets:
> +    minItems: 1
> +
> +  mrvl,i2c-polling:
> +    $ref: /schemas/types.yaml#/definitions/flag
> +    description: |
> +      Disable interrupt of i2c controller. Polling status register of i2c
> +      controller instead.
> +
> +  mrvl,i2c-fast-mode:
> +    $ref: /schemas/types.yaml#/definitions/flag
> +    description: Enable fast mode of i2c controller.
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - '#address-cells'
> +  - '#size-cells'

Add: 

unevaluatedProperties: false

> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/marvell,mmp2.h>
> +    i2c@d4011000 {
> +        compatible = "mrvl,mmp-twsi";
> +        reg = <0xd4011000 0x1000>;
> +        interrupts = <7>;
> +        clocks = <&soc_clocks MMP2_CLK_TWSI1>;
> +        mrvl,i2c-fast-mode;
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +    };
> +
> +...
> -- 
> 2.26.2
> 

  reply	other threads:[~2020-05-28 22:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-21  9:13 [PATCH 0/9] DT: Improve validation for Marvell SoCs Lubomir Rintel
2020-05-21  9:13 ` [PATCH v2 1/9] dt-bindings: mmc: Convert sdhci-pxa to json-schema Lubomir Rintel
2020-05-27  7:59   ` Ulf Hansson
2020-05-28 22:54     ` Rob Herring
2020-05-29 11:10       ` Ulf Hansson
2020-05-21  9:13 ` [PATCH v2 2/9] dt-bindings: gpio: Convert mrvl-gpio " Lubomir Rintel
2020-05-21 19:57   ` robh
2020-05-21  9:13 ` [PATCH v2 3/9] dt-bindings: i2c: Convert i2c-pxa " Lubomir Rintel
2020-05-28 22:57   ` Rob Herring [this message]
2020-05-21  9:13 ` [PATCH v2 4/9] dt-bindings: interrupt-controller: Convert mrvl,intc " Lubomir Rintel
2020-05-21  9:13 ` [PATCH v2 5/9] dt-bindings: media: Convert marvell,mmp2-ccic " Lubomir Rintel
2020-05-28 22:59   ` Rob Herring
2020-05-21  9:13 ` [PATCH v2 6/9] dt-bindings: rtc: Convert sa1100-rtc " Lubomir Rintel
2020-05-21  9:13 ` [PATCH v2 7/9] dt-bindings: spi: Convert spi-pxa2xx " Lubomir Rintel
2020-05-28 23:03   ` Rob Herring
2020-05-21  9:13 ` [PATCH v2 8/9] dt-bindings: timer: Convert mrvl,mmp-timer " Lubomir Rintel
2020-05-21  9:13 ` [PATCH v2 9/9] dt-bindings: usb: Convert ehci-mv " Lubomir Rintel
2020-05-28 23:05   ` Rob Herring
2020-05-28 22:52 ` [PATCH 0/9] DT: Improve validation for Marvell SoCs Rob Herring
2020-05-30 18:14   ` Lubomir Rintel

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=20200528225747.GA830663@bogus \
    --to=robh@kernel.org \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jason@lakedaemon.net \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkundrak@v3.sk \
    --cc=maz@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=ulf.hansson@linaro.org \
    /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).