Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1209198pxb; Sun, 11 Apr 2021 11:07:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3CJxc6YD+4/HNn+OLssopJWVKYL0WvEHuBRF+9MlXiU9x19Xgxp9nTt9KGU+EPMGEoD7A X-Received: by 2002:a17:906:c099:: with SMTP id f25mr24640283ejz.141.1618164446804; Sun, 11 Apr 2021 11:07:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618164446; cv=none; d=google.com; s=arc-20160816; b=Dt/FR9HX3FItZ9t1+ZZZa9RtLy79QHlNkCNoXw5thj8VD5tGPsAuQfM8KxkH1KCneQ jrLsOjj4GCrP/9wpEmNrGH4ozV/Z9NAxpMYAZW5M+IRuSmjp1Vx1tFxtZTVn/wUH7yEf CBQ1lXEpQK+LKk7+J7p5fzLBaRmuK79Qqi2/dIlgcA6oJmtTb0Ng2xrSDIx7/CYobfzw l6jO6CUcOifZqx9makf1J8ljbZ4JE8xI4nHugyJ3EznZzgMbL7MKU9jW4wPJEg822tYr BZR+RNiCzvpiEzQlVdjrVSMN/8gWkZvO7Kmd+0TRAheNM3XiFFetxdrnsKq79ODCrPKe ahlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=nI53kziyfbKnEvjuBZ+bfWn5m7mWLDh7ze9LttdxKG8=; b=hm1IN1EgH22CKI7ZHiZo/4Ggwg/dZTCmrv8jS7n/307HI7mdymF054YbkChNW1UJrl 8QJwl+o1cohmYGdHr4AF2H/s23lurgKF2Vj4I1QMaFMBUknl+qKi6tF4cIPtGKkF9b1M 4TRJzPaDIUW2E0WUMWDKep1yR4Y+OFqXtJnGdWB43LCuAyLuJp+hpcURsDT82+4X5JxS Rg/HCZZS5rAsqT6m+UIJcSSSib7tkR6omeOx2bxfr5wH7Wj1cB/PVWWeLM/xRKDLNF4E uH07Qbi2nxjYAW1w5nKxq7vvUOCiN7RCe/qOnV0P4nDtiJfWYYGKgt+4mBF1YI8rmJDD OCTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e+k+gtKZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si7627139edb.41.2021.04.11.11.07.03; Sun, 11 Apr 2021 11:07:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e+k+gtKZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236077AbhDKRzB (ORCPT + 99 others); Sun, 11 Apr 2021 13:55:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235388AbhDKRzA (ORCPT ); Sun, 11 Apr 2021 13:55:00 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0092EC061574; Sun, 11 Apr 2021 10:54:43 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id r9so16503367ejj.3; Sun, 11 Apr 2021 10:54:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=nI53kziyfbKnEvjuBZ+bfWn5m7mWLDh7ze9LttdxKG8=; b=e+k+gtKZE9MsFc07l1+sdWdw/nfatox4OuF07RPrRCnXMpkKd+8wTn62uTEiOcR0SP oXbt4DPmBn4rrf019iBr4TZMaSarwevpSrnpf97Yt6xYYzdV6RiIdetdvo0Xn27rtL64 jwJYL3JXYydEufEuG3V15GZnNhBMlo5hdPXCgE6L8Ja9nodynWKjUULSrL4J5H21J4KI QN0urQCcePII0gQw4EhtwQIJFpsMef28dMupU56JF1fTsn7SXXFjkOA6rDc3AKYq4UjZ IxJokMUYk7Mnr4/bnSJ8zmGNw+WBGDJuD+mZNoCLi2NM9vZaB9ewElfsHBbm3yD/zANc OJeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nI53kziyfbKnEvjuBZ+bfWn5m7mWLDh7ze9LttdxKG8=; b=FOWocAtbpaks/W/1AslREgRZPM/RaPqI8O6HenXug3kVS9G38Lghb80hmlGW+ev0FT XEK7+cCwuD6DvqhYu+yhOCtHXuAMP2lv/aGWqIm7HTcY68goPzmXq7RTEtlC2j9o9ipi GXq0Jqn8+1HRoKArORw9npEj0pQT5kBL8/YcMngZJSzH8SxdYrOtqLPShOzVBKcMPdce loOS3BuxyAfciiRRXjJ8wUaxFYV8JW7BwlIABk66e0U4y1zUkDz6bBNZB4IrI3z1dB75 44DkFOQUEf0JUI6SCt20eEiXT5EIhAEE6fF6uPGj5/Cl/YkYZNWDVyUo+MV03KlINZwh HN4w== X-Gm-Message-State: AOAM532riFKJAgjuub78UeqAWEwuNROwYdzjdhZOKVLzDyW6R2nRorlX BuXcPQTgG4GBgeXDCxroMjaN1jYTwhlwSA== X-Received: by 2002:a17:906:a1c8:: with SMTP id bx8mr23568241ejb.381.1618163682737; Sun, 11 Apr 2021 10:54:42 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id h15sm5021738edb.74.2021.04.11.10.54.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Apr 2021 10:54:42 -0700 (PDT) From: Johan Jonker To: heiko@sntech.de Cc: robh+dt@kernel.org, linus.walleij@linaro.org, bgolaszewski@baylibre.com, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v1] dt-bindings: gpio: add YAML description for rockchip,gpio-bank Date: Sun, 11 Apr 2021 19:54:35 +0200 Message-Id: <20210411175435.807-1-jbx6244@gmail.com> X-Mailer: git-send-email 2.11.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Current dts files with "rockchip,gpio-bank" subnodes are manually verified. In order to automate this process the text that describes the compatible in rockchip,pinctrl.txt is removed and converted to YAML in rockchip,gpio-bank.yaml. Signed-off-by: Johan Jonker --- .../bindings/gpio/rockchip,gpio-bank.yaml | 82 ++++++++++++++++++++++ .../bindings/pinctrl/rockchip,pinctrl.txt | 58 +-------------- 2 files changed, 83 insertions(+), 57 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/rockchip,gpio-bank.yaml diff --git a/Documentation/devicetree/bindings/gpio/rockchip,gpio-bank.yaml b/Documentation/devicetree/bindings/gpio/rockchip,gpio-bank.yaml new file mode 100644 index 000000000..ac2479732 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/rockchip,gpio-bank.yaml @@ -0,0 +1,82 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/rockchip,gpio-bank.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Rockchip GPIO bank + +maintainers: + - Heiko Stuebner + +properties: + compatible: + enum: + - rockchip,gpio-bank + - rockchip,rk3188-gpio-bank0 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + gpio-controller: true + + "#gpio-cells": + const: 2 + + interrupt-controller: true + + "#interrupt-cells": + const: 2 + +required: + - compatible + - reg + - interrupts + - clocks + - gpio-controller + - "#gpio-cells" + - interrupt-controller + - "#interrupt-cells" + +additionalProperties: false + +examples: + - | + #include + pinctrl: pinctrl { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + gpio0: gpio0@2000a000 { + compatible = "rockchip,rk3188-gpio-bank0"; + reg = <0x2000a000 0x100>; + interrupts = ; + clocks = <&clk_gates8 9>; + + gpio-controller; + #gpio-cells = <2>; + + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio1: gpio1@2003c000 { + compatible = "rockchip,gpio-bank"; + reg = <0x2003c000 0x100>; + interrupts = ; + clocks = <&clk_gates8 10>; + + gpio-controller; + #gpio-cells = <2>; + + interrupt-controller; + #interrupt-cells = <2>; + }; + }; diff --git a/Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt index d3eae61a3..4719a6a07 100644 --- a/Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt @@ -50,23 +50,7 @@ Deprecated properties for iomux controller: Use rockchip,grf and rockchip,pmu described above instead. Required properties for gpio sub nodes: - - compatible: "rockchip,gpio-bank" - - reg: register of the gpio bank (different than the iomux registerset) - - interrupts: base interrupt of the gpio bank in the interrupt controller - - clocks: clock that drives this bank - - gpio-controller: identifies the node as a gpio controller and pin bank. - - #gpio-cells: number of cells in GPIO specifier. Since the generic GPIO - binding is used, the amount of cells must be specified as 2. See generic - GPIO binding documentation for description of particular cells. - - interrupt-controller: identifies the controller node as interrupt-parent. - - #interrupt-cells: the value of this property should be 2 and the interrupt - cells should use the standard two-cell scheme described in - bindings/interrupt-controller/interrupts.txt - -Deprecated properties for gpio sub nodes: - - compatible: "rockchip,rk3188-gpio-bank0" - - reg: second element: separate pull register for rk3188 bank0, use - rockchip,pmu described above instead +See rockchip,gpio-bank.yaml Required properties for pin configuration node: - rockchip,pins: 3 integers array, represents a group of pins mux and config @@ -127,43 +111,3 @@ uart2: serial@20064000 { pinctrl-names = "default"; pinctrl-0 = <&uart2_xfer>; }; - -Example for rk3188: - - pinctrl@20008000 { - compatible = "rockchip,rk3188-pinctrl"; - rockchip,grf = <&grf>; - rockchip,pmu = <&pmu>; - #address-cells = <1>; - #size-cells = <1>; - ranges; - - gpio0: gpio0@2000a000 { - compatible = "rockchip,rk3188-gpio-bank0"; - reg = <0x2000a000 0x100>; - interrupts = ; - clocks = <&clk_gates8 9>; - - gpio-controller; - #gpio-cells = <2>; - - interrupt-controller; - #interrupt-cells = <2>; - }; - - gpio1: gpio1@2003c000 { - compatible = "rockchip,gpio-bank"; - reg = <0x2003c000 0x100>; - interrupts = ; - clocks = <&clk_gates8 10>; - - gpio-controller; - #gpio-cells = <2>; - - interrupt-controller; - #interrupt-cells = <2>; - }; - - ... - - }; -- 2.11.0