Skip to contentSkip to conversation

dt-bindings: mfd: x-powers,axp152: make interrupt optional for more chips

PATCH Superseded Andre Przywara 6 participants 8 messages Aug 2, 2023 – Aug 7, 2023

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: mfd: x-powers,axp152: make interrupt optional for more chips

All X-Powers PMICs described by this binding have an IRQ pin, and so far (almost) all boards connected this to some NMI pin or GPIO on the SoC they are connected to.
However we start to see boards that omit this connection, and technically the IRQ pin is not essential to the basic PMIC operation.
The existing Linux driver allows skipping an IRQ pin setup for some chips already, so update the binding to also make the DT property optional for these chips, so that we can actually have DTs describing boards with the PMIC interrupt not wired up.

---
Hi,

arguably the IRQ functionality is optional for many more PMICs, especially if a board doesn't use GPIOs or a power key.
So I wonder if the interrupts property should become optional for all? After all it's more a board designer's decision to wire up the IRQ pin or not, and nothing that's really related to a particular PMIC.

Cheers,
Andre

 Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml +4 -1
index 9ad55746133b5..06f1779835a1e 100644
@@ -67,7 +67,10 @@ allOf:
         properties:
           compatible:
             contains:
-              const: x-powers,axp305
+              enum:
+                - x-powers,axp15060
+                - x-powers,axp305
+                - x-powers,axp313a
 
     then:
       required:
Signature · 1 line
2.25.1
Tested-by on v1 1/1
#1 lore raw
Quoted 42 lines · Andre Przywara

All X-Powers PMICs described by this binding have an IRQ pin, and so far (almost) all boards connected this to some NMI pin or GPIO on the SoC they are connected to.
However we start to see boards that omit this connection, and technically the IRQ pin is not essential to the basic PMIC operation.
The existing Linux driver allows skipping an IRQ pin setup for some chips already, so update the binding to also make the DT property optional for these chips, so that we can actually have DTs describing boards with the PMIC interrupt not wired up.

---
Hi,

arguably the IRQ functionality is optional for many more PMICs, especially if a board doesn't use GPIOs or a power key.
So I wonder if the interrupts property should become optional for all? After all it's more a board designer's decision to wire up the IRQ pin or not, and nothing that's really related to a particular PMIC.

Cheers,
Andre

  Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml +4 -1
index 9ad55746133b5..06f1779835a1e 100644
@@ -67,7 +67,10 @@ allOf:
          properties:
            compatible:
              contains:
-              const: x-powers,axp305
+              enum:
+                - x-powers,axp15060
+                - x-powers,axp305
+                - x-powers,axp313a
 
      then:
        required:
Acked-by on v1 1/1
#2 lore raw
In reply to Andre Przywara
Quoted 11 lines · Andre Przywara

All X-Powers PMICs described by this binding have an IRQ pin, and so far (almost) all boards connected this to some NMI pin or GPIO on the SoC they are connected to.
However we start to see boards that omit this connection, and technically the IRQ pin is not essential to the basic PMIC operation.
The existing Linux driver allows skipping an IRQ pin setup for some chips already, so update the binding to also make the DT property optional for these chips, so that we can actually have DTs describing boards with the PMIC interrupt not wired up.

Quoted 8 lines

---
Hi,

arguably the IRQ functionality is optional for many more PMICs, especially if a board doesn't use GPIOs or a power key.
So I wonder if the interrupts property should become optional for all? After all it's more a board designer's decision to wire up the IRQ pin or not, and nothing that's really related to a particular PMIC.

No ack for this, but if the things function without the interrupts wired up, it seems like it'd make sense to drop others too.

Cheers,
Conor.

Quoted 26 lines

Cheers,
Andre

 Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml +4 -1
index 9ad55746133b5..06f1779835a1e 100644
@@ -67,7 +67,10 @@ allOf:
         properties:
           compatible:
             contains:
-              const: x-powers,axp305
+              enum:
+                - x-powers,axp15060
+                - x-powers,axp305
+                - x-powers,axp313a
 
     then:
       required:
Signature · 1 line
2.25.1
maintainer
#3 lore raw
In reply to Andre Przywara
Quoted 11 lines · Andre Przywara

All X-Powers PMICs described by this binding have an IRQ pin, and so far (almost) all boards connected this to some NMI pin or GPIO on the SoC they are connected to.
However we start to see boards that omit this connection, and technically the IRQ pin is not essential to the basic PMIC operation.
The existing Linux driver allows skipping an IRQ pin setup for some chips already, so update the binding to also make the DT property optional for these chips, so that we can actually have DTs describing boards with the PMIC interrupt not wired up.

Quoted 8 lines

---
Hi,

arguably the IRQ functionality is optional for many more PMICs, especially if a board doesn't use GPIOs or a power key.
So I wonder if the interrupts property should become optional for all? After all it's more a board designer's decision to wire up the IRQ pin or not, and nothing that's really related to a particular PMIC.

I would say yes. Particularly if it gets rid of a conditional schema.

Rob

#4 lore raw

On Fri, 4 Aug 2023 09:34:32 -0600
Rob Herring <[email protected]> wrote:

Hi,

Quoted 15 lines · Andre Przywara
Quoted 14 lines

All X-Powers PMICs described by this binding have an IRQ pin, and so far (almost) all boards connected this to some NMI pin or GPIO on the SoC they are connected to.
However we start to see boards that omit this connection, and technically the IRQ pin is not essential to the basic PMIC operation.
The existing Linux driver allows skipping an IRQ pin setup for some chips already, so update the binding to also make the DT property optional for these chips, so that we can actually have DTs describing boards with the PMIC interrupt not wired up.

---
Hi,

Quoted 7 lines
Quoted 5 lines

arguably the IRQ functionality is optional for many more PMICs, especially if a board doesn't use GPIOs or a power key.
So I wonder if the interrupts property should become optional for all? After all it's more a board designer's decision to wire up the IRQ pin or not, and nothing that's really related to a particular PMIC.

I would say yes. Particularly if it gets rid of a conditional schema.

I see your point, and we might get there, but after some digging extending this to more/all PMICs needs more work, see below.
Given that I was wondering if we can merge this patch now, as this blocks multiple DTs from being merged (and Connor already ACKed it). I sent an MFD driver fix to make this actually work for the AXP313a:
https://lore.kernel.org/lkml/[email protected]/

For supporting this on more PMICs:
Currently many Linux (sub-)drivers registered by the MFD driver crash when there is no valid interrupt registered, and we so far just special cased the very simple PMICs to skip just the power key driver registration, which works for those chips. However this affects more drivers (I tested ac-power-supply), so it's not clear if that's really something useful for the other PMICs providing more functionality. I guess we can postpone this until either there is actually a use case for those other PMICs (boards without the IRQ line connected), or when this list of exceptions grows too large.

Cheers,
Andre

#5 lore raw
Quoted 27 lines · Andre Przywara

On Fri, 4 Aug 2023 09:34:32 -0600
Rob Herring <[email protected]> wrote:

Hi,

Quoted 21 lines · Andre Przywara
Quoted 19 lines

All X-Powers PMICs described by this binding have an IRQ pin, and so far (almost) all boards connected this to some NMI pin or GPIO on the SoC they are connected to.
However we start to see boards that omit this connection, and technically the IRQ pin is not essential to the basic PMIC operation.
The existing Linux driver allows skipping an IRQ pin setup for some chips already, so update the binding to also make the DT property optional for these chips, so that we can actually have DTs describing boards with the PMIC interrupt not wired up.

---
Hi,

arguably the IRQ functionality is optional for many more PMICs, especially if a board doesn't use GPIOs or a power key.
So I wonder if the interrupts property should become optional for all? After all it's more a board designer's decision to wire up the IRQ pin or not, and nothing that's really related to a particular PMIC.

Quoted 8 lines
Quoted 1 line

I would say yes. Particularly if it gets rid of a conditional schema.

I see your point, and we might get there, but after some digging extending this to more/all PMICs needs more work, see below.
Given that I was wondering if we can merge this patch now, as this blocks multiple DTs from being merged (and Connor already ACKed it). I sent an MFD driver fix to make this actually work for the AXP313a:
https://lore.kernel.org/lkml/[email protected]/

Question is which tree we merge it through. We can't merge the DTs without this guaranteed to go in the same cycle without causing DT validation errors.

ChenYu

Quoted 13 lines

For supporting this on more PMICs:
Currently many Linux (sub-)drivers registered by the MFD driver crash when there is no valid interrupt registered, and we so far just special cased the very simple PMICs to skip just the power key driver registration, which works for those chips. However this affects more drivers (I tested ac-power-supply), so it's not clear if that's really something useful for the other PMICs providing more functionality. I guess we can postpone this until either there is actually a use case for those other PMICs (boards without the IRQ line connected), or when this list of exceptions grows too large.

Cheers,
Andre

#6 lore raw
In reply to Andre Przywara

Hi Andre,

No, you can't only add the binding stuff. The PEK driver would crash when

there's no IRQ config in dts.

Best regards,

Shengyu

Quoted 42 lines

All X-Powers PMICs described by this binding have an IRQ pin, and so far (almost) all boards connected this to some NMI pin or GPIO on the SoC they are connected to.
However we start to see boards that omit this connection, and technically the IRQ pin is not essential to the basic PMIC operation.
The existing Linux driver allows skipping an IRQ pin setup for some chips already, so update the binding to also make the DT property optional for these chips, so that we can actually have DTs describing boards with the PMIC interrupt not wired up.

---
Hi,

arguably the IRQ functionality is optional for many more PMICs, especially if a board doesn't use GPIOs or a power key.
So I wonder if the interrupts property should become optional for all? After all it's more a board designer's decision to wire up the IRQ pin or not, and nothing that's really related to a particular PMIC.

Cheers,
Andre

  Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml +4 -1
index 9ad55746133b5..06f1779835a1e 100644
@@ -67,7 +67,10 @@ allOf:
          properties:
            compatible:
              contains:
-              const: x-powers,axp305
+              enum:
+                - x-powers,axp15060
+                - x-powers,axp305
+                - x-powers,axp313a
 
      then:
        required:
#7 lore raw

On Sat, 5 Aug 2023 23:43:35 +0800
Shengyu Qu <[email protected]> wrote:

Hi Shengyu,

Quoted 2 lines

No, you can't only add the binding stuff. The PEK driver would crash when there's no IRQ config in dts.

Well, that's strictly speaking a problem of the existing Linux driver then, which cannot cope with this new updated binding yet. But the binding needs to be updated first in any case, so this patch needs to come first.

But yeah, indeed this is missing the extension of the "IRQ > 0" check from the 15060 MFD code, I will send a patch shortly to extend this to the AXP305 and AXP313a.

Thanks for the heads up!

Cheers,
Andre

Quoted 46 lines

Best regards,

Shengyu

Quoted 42 lines

All X-Powers PMICs described by this binding have an IRQ pin, and so far (almost) all boards connected this to some NMI pin or GPIO on the SoC they are connected to.
However we start to see boards that omit this connection, and technically the IRQ pin is not essential to the basic PMIC operation.
The existing Linux driver allows skipping an IRQ pin setup for some chips already, so update the binding to also make the DT property optional for these chips, so that we can actually have DTs describing boards with the PMIC interrupt not wired up.

---
Hi,

arguably the IRQ functionality is optional for many more PMICs, especially if a board doesn't use GPIOs or a power key.
So I wonder if the interrupts property should become optional for all? After all it's more a board designer's decision to wire up the IRQ pin or not, and nothing that's really related to a particular PMIC.

Cheers,
Andre

  Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml +4 -1
index 9ad55746133b5..06f1779835a1e 100644
@@ -67,7 +67,10 @@ allOf:
          properties:
            compatible:
              contains:
-              const: x-powers,axp305
+              enum:
+                - x-powers,axp15060
+                - x-powers,axp305
+                - x-powers,axp313a
 
      then:
        required: