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 <[email protected]>
---
.../bindings/pinctrl/qcom,pmic-mpp.yaml | 62 ++++++++++---------
1 file changed, 34 insertions(+), 28 deletions(-)
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>;
+ };
+ };
};
- };
};
...
--
2.41.0
On 30/11/2023 18:28, 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 <[email protected]>
> ---
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Best regards,
Krzysztof
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.
Rob
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?
I guess there would need to be more than one if you want to cover all
the various child nodes with real examples.
Johan
On Fri, Dec 1, 2023 at 10:56 AM Johan Hovold <[email protected]> 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
On Fri, Dec 01, 2023 at 01:51:06PM -0600, Rob Herring wrote:
> On Fri, Dec 1, 2023 at 10:56 AM Johan Hovold <[email protected]> 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
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 <[email protected]>
Can you pick this one up for 6.8?
Johan
On Tue, Dec 19, 2023 at 5:00 PM Johan Hovold <[email protected]> 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 <[email protected]>
>
> Can you pick this one up for 6.8?
OK, patch applied!
Yours,
Linus Walleij