diff mbox series

dt-bindings: pinctrl: qcom,pmic-mpp: clean up example

Message ID 20231130172834.12653-1-johan+linaro@kernel.org
State Accepted
Commit caf08a8250d619cfcd2b6f5967218a2e36133ecc
Headers show
Series dt-bindings: pinctrl: qcom,pmic-mpp: clean up example | expand

Commit Message

Johan Hovold Nov. 30, 2023, 5:28 p.m. UTC
The Multi-Purpose Pin controller block is part of an SPMI PMIC (which in
turns sits on an SPMI bus) and uses a single value for the register
property that corresponds to its base address.

Clean up the example by adding a parent PMIC node with proper
'#address-cells' and '#size-cells' properties, dropping the incorrect
second register value, adding some newline separators and increasing the
indentation to four spaces.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 .../bindings/pinctrl/qcom,pmic-mpp.yaml       | 62 ++++++++++---------
 1 file changed, 34 insertions(+), 28 deletions(-)

Comments

Rob Herring (Arm) Dec. 1, 2023, 7:51 p.m. UTC | #1
On Fri, Dec 1, 2023 at 10:56 AM Johan Hovold <johan@kernel.org> wrote:
>
> On Fri, Dec 01, 2023 at 08:43:20AM -0600, Rob Herring wrote:
> > On Thu, Nov 30, 2023 at 06:28:34PM +0100, Johan Hovold wrote:
> > > The Multi-Purpose Pin controller block is part of an SPMI PMIC (which in
> > > turns sits on an SPMI bus) and uses a single value for the register
> > > property that corresponds to its base address.
> > >
> > > Clean up the example by adding a parent PMIC node with proper
> > > '#address-cells' and '#size-cells' properties, dropping the incorrect
> > > second register value, adding some newline separators and increasing the
> > > indentation to four spaces.
> >
> > This is fine, but I prefer these MFDs have 1 complete example rather
> > than piecemeal examples for each child device.
>
> Yeah, this is not ideal. The closest thing we've got are the examples
> in:
>
>         Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
>
> Are you suggesting eventually dropping the examples from the child node
> bindings and adding (several) complete examples in the parent one?

Yes, but if the child nodes are truly reused across multiple PMICs
then, it is probably a worthwhile exception. There's not a great deal
of reuse on most MFDs.

> I guess there would need to be more than one if you want to cover all
> the various child nodes with real examples.

We don't want examples to be exhaustive permutations of every
possibility either.

Rob
Johan Hovold Dec. 4, 2023, 9:48 a.m. UTC | #2
On Fri, Dec 01, 2023 at 01:51:06PM -0600, Rob Herring wrote:
> On Fri, Dec 1, 2023 at 10:56 AM Johan Hovold <johan@kernel.org> wrote:
> > On Fri, Dec 01, 2023 at 08:43:20AM -0600, Rob Herring wrote:

> > > This is fine, but I prefer these MFDs have 1 complete example rather
> > > than piecemeal examples for each child device.
> >
> > Yeah, this is not ideal. The closest thing we've got are the examples
> > in:
> >
> >         Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
> >
> > Are you suggesting eventually dropping the examples from the child node
> > bindings and adding (several) complete examples in the parent one?
> 
> Yes, but if the child nodes are truly reused across multiple PMICs
> then, it is probably a worthwhile exception. There's not a great deal
> of reuse on most MFDs.

Yes, they are indeed reused by multiple PMICs in this case.
 
> > I guess there would need to be more than one if you want to cover all
> > the various child nodes with real examples.
> 
> We don't want examples to be exhaustive permutations of every
> possibility either.

Not every possible permutation but I guess we'd want coverage of all the
various child nodes still (i.e. the child node examples that would have
been removed).

Johan
Johan Hovold Dec. 19, 2023, 4 p.m. UTC | #3
Hi Linus,

On Thu, Nov 30, 2023 at 06:28:34PM +0100, Johan Hovold wrote:
> The Multi-Purpose Pin controller block is part of an SPMI PMIC (which in
> turns sits on an SPMI bus) and uses a single value for the register
> property that corresponds to its base address.
> 
> Clean up the example by adding a parent PMIC node with proper
> '#address-cells' and '#size-cells' properties, dropping the incorrect
> second register value, adding some newline separators and increasing the
> indentation to four spaces.
> 
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>

Can you pick this one up for 6.8?

Johan
Linus Walleij Dec. 20, 2023, 10:47 a.m. UTC | #4
On Tue, Dec 19, 2023 at 5:00 PM Johan Hovold <johan@kernel.org> wrote:

> Hi Linus,
>
> On Thu, Nov 30, 2023 at 06:28:34PM +0100, Johan Hovold wrote:
> > The Multi-Purpose Pin controller block is part of an SPMI PMIC (which in
> > turns sits on an SPMI bus) and uses a single value for the register
> > property that corresponds to its base address.
> >
> > Clean up the example by adding a parent PMIC node with proper
> > '#address-cells' and '#size-cells' properties, dropping the incorrect
> > second register value, adding some newline separators and increasing the
> > indentation to four spaces.
> >
> > Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
>
> Can you pick this one up for 6.8?

OK, patch applied!

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml
index 80f960671857..fe717d8d4798 100644
--- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml
@@ -158,34 +158,40 @@  examples:
   - |
     #include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
 
-    pm8841_mpp: mpps@a000 {
-      compatible = "qcom,pm8841-mpp", "qcom,spmi-mpp";
-      reg = <0xa000 0>;
-      gpio-controller;
-      #gpio-cells = <2>;
-      gpio-ranges = <&pm8841_mpp 0 0 4>;
-      gpio-line-names = "VDD_PX_BIAS", "WLAN_LED_CTRL",
-              "BT_LED_CTRL", "GPIO-F";
-      interrupt-controller;
-      #interrupt-cells = <2>;
-
-      pinctrl-names = "default";
-      pinctrl-0 = <&pm8841_default>;
-
-      mpp1-state {
-        pins = "mpp1";
-        function = "digital";
-        input-enable;
-        power-source = <PM8841_MPP_S3>;
-      };
-
-      default-state {
-        gpio-pins {
-          pins = "mpp1", "mpp2", "mpp3", "mpp4";
-          function = "digital";
-          input-enable;
-          power-source = <PM8841_MPP_S3>;
+    pmic {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        pm8841_mpp: mpps@a000 {
+            compatible = "qcom,pm8841-mpp", "qcom,spmi-mpp";
+            reg = <0xa000>;
+
+            gpio-controller;
+            #gpio-cells = <2>;
+            gpio-ranges = <&pm8841_mpp 0 0 4>;
+            gpio-line-names = "VDD_PX_BIAS", "WLAN_LED_CTRL",
+                              "BT_LED_CTRL", "GPIO-F";
+            interrupt-controller;
+            #interrupt-cells = <2>;
+
+            pinctrl-names = "default";
+            pinctrl-0 = <&pm8841_default>;
+
+            mpp1-state {
+                pins = "mpp1";
+                function = "digital";
+                input-enable;
+                power-source = <PM8841_MPP_S3>;
+            };
+
+            default-state {
+                gpio-pins {
+                    pins = "mpp1", "mpp2", "mpp3", "mpp4";
+                    function = "digital";
+                    input-enable;
+                    power-source = <PM8841_MPP_S3>;
+                };
+            };
         };
-      };
     };
 ...