Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3578219ybh; Tue, 17 Mar 2020 02:42:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs2MGWK56oFN4b0ykkjYkGzF3LCnfNAjKCHDIxMVLT4rx/MRGV1gjxCuOIVnqi6Tc+3WEI1 X-Received: by 2002:a9d:798d:: with SMTP id h13mr3084808otm.25.1584438154129; Tue, 17 Mar 2020 02:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584438154; cv=none; d=google.com; s=arc-20160816; b=jtxI3CoKGzlZBWzJAAHACD93YeQeU5MmFuIKUqIxNFad61GKcJdt7qy5Vsspd8mnFS G5FCm4kpI05gAsEVGopAGvJnJyCD7M85uXRsvznz0SBSmap691yJSngxZvUm3fsC60pT jpCbOF0DwdGlWPSqPnDhe5KGnX27Jc2z9Yiic+guxQ0Ca+GY3B0bwNsbB+ZZFp3BUgmd Auf+Svys/COlFFn1Q/pMQZSSf9KbwgXVTsw3ubIYBqtfy0+ZSBTGce8qBmYdyLTJo6cV ZCPQUUP4iY1UCSNmIr+mfunpN8Aspjb9cE7+nODa/p9TWMyuLvijhq7xRildaHrPoKdp Gyhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=heCenu7Y9teo6gKuZHvqmT9g4IG6kn/do+eUxWVEyyg=; b=0MhoVSNc1rxpfzjX7+6NuCdFKLCOjOZmZX33/eBAesdUWeesgNIvSSnCnXWHIZ/JMK 8hXHTqwqcCZw4OqiyNY4Q63LAbaWufIWS5Ka0o5YZwFc5BiKCVnizij8N8udzdZ9e7yO VC0QWU9beWl1Rzr4nr0WzvNxh7qcsG/Flo72XylXfb03fmoPEvLwcyqtCWvA7tCTNRkD kGB07ZbM8W5JET6wGJWw7y2GmbPpD68s8XPFyi9LlOr6sZLkqdKtMU0gey7WMlqL/CH3 8Tt0ZveTaxCd+zpdkV7NAyeyOR0/B3EfjZ7qLN5u+4a3DaJMVmFD521XY+26JSXnhSxy 143g== 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 n9si1379748ota.103.2020.03.17.02.42.21; Tue, 17 Mar 2020 02:42:34 -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 S1727160AbgCQJlJ (ORCPT + 99 others); Tue, 17 Mar 2020 05:41:09 -0400 Received: from v6.sk ([167.172.42.174]:50718 "EHLO v6.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726559AbgCQJlE (ORCPT ); Tue, 17 Mar 2020 05:41:04 -0400 Received: from localhost (v6.sk [IPv6:::1]) by v6.sk (Postfix) with ESMTP id 61AF661098; Tue, 17 Mar 2020 09:41:02 +0000 (UTC) From: Lubomir Rintel To: Rob Herring Cc: Linus Walleij , Bartosz Golaszewski , Thomas Gleixner , Jason Cooper , Marc Zyngier , Mauro Carvalho Chehab , Ulf Hansson , Kishon Vijay Abraham I , Alessandro Zummo , Alexandre Belloni , Greg Kroah-Hartman , Mark Brown , Daniel Lezcano , Andrew Lunn , Gregory Clement , Daniel Mack , Haojian Zhuang , Robert Jarzmik , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org, linux-media@vger.kernel.org, linux-mmc@vger.kernel.org, linux-rtc@vger.kernel.org, linux-serial@vger.kernel.org, linux-spi@vger.kernel.org, linux-usb@vger.kernel.org, Lubomir Rintel Subject: [PATCH 22/28] dt-bindings: i2c: Convert i2c-pxa to json-schema Date: Tue, 17 Mar 2020 10:39:16 +0100 Message-Id: <20200317093922.20785-23-lkundrak@v3.sk> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200317093922.20785-1-lkundrak@v3.sk> References: <20200317093922.20785-1-lkundrak@v3.sk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- .../devicetree/bindings/i2c/i2c-pxa.txt | 31 -------- .../devicetree/bindings/i2c/i2c-pxa.yaml | 71 +++++++++++++++++++ 2 files changed, 71 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 c30783c0eca03..0000000000000 --- 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 0000000000000..c04fb81927208 --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/i2c-pxa.yaml @@ -0,0 +1,71 @@ +%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: + - devicetree@vger.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' + +examples: + - | + #include + 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.25.1