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 1/5] dt-bindings: pinctrl: support specifying pins, groups & functions
Date: Thu, 18 Nov 2021 14:21:48 +0100 [thread overview]
Message-ID: <20211118132152.15722-2-zajec5@gmail.com> (raw)
In-Reply-To: <20211118132152.15722-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 is still binding
specific.
This commit describes syntax for "pins", "groups" & "functions" nodes in
a standard pinctrl binding. Every above node allows specifying its
entries and it's done using subnodes because:
1. It's required with reg = <n> ("pins")
2. It's generic & extendable (hw specific properties can be added)
Pins are number based so they use reg = <n>. It's also required as
binding needs to allow gaps. It's to avoid hacks like:
pins = <"foo" "-ENODEV" "-ENODEV" "-ENODEV" "bar">;
(for hw with pins 0 and 4 present).
Subnodes also allow storing hw specific pin/group/function
configuration. While it would be possible to have:
groups {
foo-pins = <0 1>;
bar-pins = <2 3>;
};
that doesn't allow hw specific quirks.
Introduced design allows e.g.:
groups {
foo {
pins = <0 1>;
vendor,magic = <0xbeaf>;
};
};
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
.../devicetree/bindings/pinctrl/pinctrl.yaml | 50 +++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml
index d471563119a9..1a99920e94ef 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml
@@ -42,4 +42,54 @@ properties:
This property can be set either globally for the pin controller or in
child nodes for individual pin group control.
+ pins:
+ type: object
+
+ properties:
+ '#address-cells':
+ const: 1
+
+ '#size-cells':
+ const: 0
+
+ patternProperties:
+ "^pin@[0-9a-z]+$":
+ type: object
+
+ properties:
+ reg:
+ description: Pin number
+
+ label:
+ description: Pin name
+ $ref: /schemas/types.yaml#/definitions/string
+
+ additionalProperties: false
+
+ groups:
+ type: object
+
+ patternProperties:
+ "^.*$":
+ type: object
+ description: Group identified by node name
+
+ properties:
+ pins:
+ $ref: /schemas/types.yaml#/definitions/uint32-array
+ description: Array of pins belonging to this group
+
+ functions:
+ type: object
+
+ patternProperties:
+ "^.*$":
+ type: object
+ description: Function identified by node name
+
+ properties:
+ groups:
+ $ref: /schemas/types.yaml#/definitions/phandle-array
+ description: Array of pins groups used by this function
+
additionalProperties: true
--
2.31.1
next prev parent reply other threads:[~2021-11-18 13:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 13:21 [PATCH 0/5] pinctrl: allow storing pins, groups & functions in DT Rafał Miłecki
2021-11-18 13:21 ` Rafał Miłecki [this message]
2021-11-18 13:21 ` [PATCH 2/5] dt-bindings: pinctrl: brcm,ns-pinmux: extend example Rafał Miłecki
2021-11-18 22:09 ` Rob Herring
2021-11-19 6:24 ` Rafał Miłecki
2021-11-23 7:38 ` Tony Lindgren
2021-11-23 7:56 ` Rafał Miłecki
2021-11-23 8:01 ` Rafał Miłecki
2021-11-23 9:15 ` Tony Lindgren
2021-11-23 13:51 ` Rafał Miłecki
2021-11-18 13:21 ` [PATCH 3/5] pinctrl: add helpers reading pins, groups & functions from DT Rafał Miłecki
2021-11-18 13:57 ` Andy Shevchenko
2021-11-18 14:17 ` Rafał Miłecki
2021-11-18 16:22 ` Andy Shevchenko
2021-11-21 23:53 ` Linus Walleij
2021-11-18 13:21 ` [PATCH 4/5] pinctrl: bcm: pinctrl-ns: supoprt DT specified pins, groups & functions Rafał Miłecki
2021-11-18 13:21 ` [PATCH 5/5] ARM: dts: BCM5301X: add pinctrl " Rafał Miłecki
2021-11-18 13:52 ` [PATCH 0/5] pinctrl: allow storing pins, groups & functions in DT Andy Shevchenko
2021-11-18 13:59 ` Rafał Miłecki
2021-11-18 16:30 ` Andy Shevchenko
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=20211118132152.15722-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).