linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Rob Herring <robh+dt@kernel.org>
Cc: "Tony Lindgren" <tony@atomide.com>,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	bcm-kernel-feedback-list@broadcom.com,
	"Rafał Miłecki" <rafal@milecki.pl>
Subject: [PATCH V3 1/2] dt-bindings: pinctrl: support specifying pins, groups & functions
Date: Fri, 10 Dec 2021 12:42:21 +0100	[thread overview]
Message-ID: <20211210114222.26581-2-zajec5@gmail.com> (raw)
In-Reply-To: <20211210114222.26581-1-zajec5@gmail.com>

From: Rafał Miłecki <rafal@milecki.pl>

This binding change is meant to introduce a generic way of describing
pinctrl blocks details. Every pinmux block is expected to have:
1. Named pins
2. Named groups containing one or more pins
3. Named functions referencing one or more groups

It doesn't describe how hw should be programmed. That remains binding
and driver specific.

This commit describes a common syntax for "pins", "groups" & "functions"
nodes. Every node allows specifying its entries.

That design is meant to be extendable and minimalistic enough to be
generic (matching any hardware). Relations between pins, groups and
functions are expected to be the same for every hardware.

Using subnode objects allows extending this binding to cover hardware
specific needs (e.g. custom values). Example to consider:

pins {
    foo: foo {
        vendor,magic = <0xc0fe>;
    };
}

groups {
    bar {
        pins = <&foo>;
        vendor,secret = <0xbeaf>;
    };
};

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 .../devicetree/bindings/pinctrl/pinctrl.yaml  | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml
index d471563119a9..e36662cb1f3b 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml
@@ -42,4 +42,38 @@ properties:
       This property can be set either globally for the pin controller or in
       child nodes for individual pin group control.
 
+  pins:
+    type: object
+
+    patternProperties:
+      "^.*$":
+        type: object
+        description: Pin named by node name
+
+  groups:
+    type: object
+
+    patternProperties:
+      "^.*$":
+        type: object
+        description: Group named by node name
+
+        properties:
+          pins:
+            $ref: /schemas/types.yaml#/definitions/phandle-array
+            description: Array of pins belonging to this group
+
+  functions:
+    type: object
+
+    patternProperties:
+      "^.*$":
+        type: object
+        description: Function named by node name
+
+        properties:
+          groups:
+            $ref: /schemas/types.yaml#/definitions/phandle-array
+            description: Array of groups used by this function
+
 additionalProperties: true
-- 
2.31.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-12-10 11:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10 11:42 [PATCH V3 0/2] dt-bindings: pinctrl: pins, groups & functions Rafał Miłecki
2021-12-10 11:42 ` Rafał Miłecki [this message]
2021-12-10 23:26   ` [PATCH V3 1/2] dt-bindings: pinctrl: support specifying " Linus Walleij
2021-12-11 11:16     ` Rafał Miłecki
2021-12-14 19:59       ` Rob Herring
2021-12-14 20:10         ` Rafał Miłecki
2021-12-14 21:50           ` Rafał Miłecki
2021-12-10 11:42 ` [PATCH V3 2/2] dt-bindings: pinctrl: brcm, ns-pinmux: describe " Rafał Miłecki
2021-12-10 14:02   ` Rob Herring
2021-12-11  7:07   ` [PATCH V3 2/2] dt-bindings: pinctrl: brcm,ns-pinmux: " Tony Lindgren

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=20211210114222.26581-2-zajec5@gmail.com \
    --to=zajec5@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=rafal@milecki.pl \
    --cc=robh+dt@kernel.org \
    --cc=tony@atomide.com \
    /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).