* [PATCH] dt-bindings: mfd: x-powers,axp152: make interrupt optional for more chips
@ 2023-08-02 14:18 Andre Przywara
2023-08-02 19:07 ` Martin Botka
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Andre Przywara @ 2023-08-02 14:18 UTC (permalink / raw)
To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chen-Yu Tsai
Cc: devicetree, linux-kernel, Icenowy Zheng, Shengyu Qu, Martin Botka,
Martin Botka, Mark Brown
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.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
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(-)
diff --git a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
index 9ad55746133b5..06f1779835a1e 100644
--- a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
+++ b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
@@ -67,7 +67,10 @@ allOf:
properties:
compatible:
contains:
- const: x-powers,axp305
+ enum:
+ - x-powers,axp15060
+ - x-powers,axp305
+ - x-powers,axp313a
then:
required:
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] dt-bindings: mfd: x-powers,axp152: make interrupt optional for more chips
2023-08-02 14:18 [PATCH] dt-bindings: mfd: x-powers,axp152: make interrupt optional for more chips Andre Przywara
@ 2023-08-02 19:07 ` Martin Botka
2023-08-03 15:55 ` Conor Dooley
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Martin Botka @ 2023-08-02 19:07 UTC (permalink / raw)
To: Andre Przywara, Lee Jones, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Chen-Yu Tsai
Cc: devicetree, linux-kernel, Icenowy Zheng, Shengyu Qu, Martin Botka,
Mark Brown
Tested-by: Martin Botka <martin@biqu3d.com>
On 8/2/23 4:18 PM, Andre Przywara wrote:
> 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.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
> 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(-)
>
> diff --git a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> index 9ad55746133b5..06f1779835a1e 100644
> --- a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> +++ b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> @@ -67,7 +67,10 @@ allOf:
> properties:
> compatible:
> contains:
> - const: x-powers,axp305
> + enum:
> + - x-powers,axp15060
> + - x-powers,axp305
> + - x-powers,axp313a
>
> then:
> required:
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dt-bindings: mfd: x-powers,axp152: make interrupt optional for more chips
2023-08-02 14:18 [PATCH] dt-bindings: mfd: x-powers,axp152: make interrupt optional for more chips Andre Przywara
2023-08-02 19:07 ` Martin Botka
@ 2023-08-03 15:55 ` Conor Dooley
2023-08-04 15:34 ` Rob Herring
2023-08-05 15:43 ` Shengyu Qu
3 siblings, 0 replies; 8+ messages in thread
From: Conor Dooley @ 2023-08-03 15:55 UTC (permalink / raw)
To: Andre Przywara
Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chen-Yu Tsai, devicetree, linux-kernel, Icenowy Zheng, Shengyu Qu,
Martin Botka, Martin Botka, Mark Brown
[-- Attachment #1: Type: text/plain, Size: 2089 bytes --]
On Wed, Aug 02, 2023 at 03:18:29PM +0100, Andre Przywara wrote:
> 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.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
> ---
> 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.
>
> Cheers,
> Andre
>
> Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> index 9ad55746133b5..06f1779835a1e 100644
> --- a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> +++ b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> @@ -67,7 +67,10 @@ allOf:
> properties:
> compatible:
> contains:
> - const: x-powers,axp305
> + enum:
> + - x-powers,axp15060
> + - x-powers,axp305
> + - x-powers,axp313a
>
> then:
> required:
> --
> 2.25.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dt-bindings: mfd: x-powers,axp152: make interrupt optional for more chips
2023-08-02 14:18 [PATCH] dt-bindings: mfd: x-powers,axp152: make interrupt optional for more chips Andre Przywara
2023-08-02 19:07 ` Martin Botka
2023-08-03 15:55 ` Conor Dooley
@ 2023-08-04 15:34 ` Rob Herring
2023-08-07 13:42 ` Andre Przywara
2023-08-05 15:43 ` Shengyu Qu
3 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2023-08-04 15:34 UTC (permalink / raw)
To: Andre Przywara
Cc: Lee Jones, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai,
devicetree, linux-kernel, Icenowy Zheng, Shengyu Qu, Martin Botka,
Martin Botka, Mark Brown
On Wed, Aug 02, 2023 at 03:18:29PM +0100, Andre Przywara wrote:
> 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.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dt-bindings: mfd: x-powers,axp152: make interrupt optional for more chips
2023-08-02 14:18 [PATCH] dt-bindings: mfd: x-powers,axp152: make interrupt optional for more chips Andre Przywara
` (2 preceding siblings ...)
2023-08-04 15:34 ` Rob Herring
@ 2023-08-05 15:43 ` Shengyu Qu
2023-08-05 22:50 ` Andre Przywara
3 siblings, 1 reply; 8+ messages in thread
From: Shengyu Qu @ 2023-08-05 15:43 UTC (permalink / raw)
To: Andre Przywara, Lee Jones, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Chen-Yu Tsai
Cc: wiagn233, devicetree, linux-kernel, Icenowy Zheng, Martin Botka,
Martin Botka, Mark Brown
[-- Attachment #1.1.1: Type: text/plain, Size: 1948 bytes --]
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
> 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.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
> 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(-)
>
> diff --git a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> index 9ad55746133b5..06f1779835a1e 100644
> --- a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> +++ b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> @@ -67,7 +67,10 @@ allOf:
> properties:
> compatible:
> contains:
> - const: x-powers,axp305
> + enum:
> + - x-powers,axp15060
> + - x-powers,axp305
> + - x-powers,axp313a
>
> then:
> required:
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 6977 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dt-bindings: mfd: x-powers,axp152: make interrupt optional for more chips
2023-08-05 15:43 ` Shengyu Qu
@ 2023-08-05 22:50 ` Andre Przywara
0 siblings, 0 replies; 8+ messages in thread
From: Andre Przywara @ 2023-08-05 22:50 UTC (permalink / raw)
To: Shengyu Qu
Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chen-Yu Tsai, devicetree, linux-kernel, Icenowy Zheng,
Martin Botka, Martin Botka, Mark Brown
On Sat, 5 Aug 2023 23:43:35 +0800
Shengyu Qu <wiagn233@outlook.com> wrote:
Hi Shengyu,
> 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
> Best regards,
>
> Shengyu
>
> > 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.
> >
> > Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> > ---
> > 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(-)
> >
> > diff --git a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> > index 9ad55746133b5..06f1779835a1e 100644
> > --- a/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> > +++ b/Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml
> > @@ -67,7 +67,10 @@ allOf:
> > properties:
> > compatible:
> > contains:
> > - const: x-powers,axp305
> > + enum:
> > + - x-powers,axp15060
> > + - x-powers,axp305
> > + - x-powers,axp313a
> >
> > then:
> > required:
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dt-bindings: mfd: x-powers,axp152: make interrupt optional for more chips
2023-08-04 15:34 ` Rob Herring
@ 2023-08-07 13:42 ` Andre Przywara
2023-08-07 16:34 ` Chen-Yu Tsai
0 siblings, 1 reply; 8+ messages in thread
From: Andre Przywara @ 2023-08-07 13:42 UTC (permalink / raw)
To: Rob Herring
Cc: Lee Jones, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai,
devicetree, linux-kernel, Icenowy Zheng, Shengyu Qu, Martin Botka,
Martin Botka, Mark Brown
On Fri, 4 Aug 2023 09:34:32 -0600
Rob Herring <robh@kernel.org> wrote:
Hi,
> On Wed, Aug 02, 2023 at 03:18:29PM +0100, Andre Przywara wrote:
> > 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.
> >
> > Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> > ---
> > 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.
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/20230807133930.94309-1-andre.przywara@arm.com/
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dt-bindings: mfd: x-powers,axp152: make interrupt optional for more chips
2023-08-07 13:42 ` Andre Przywara
@ 2023-08-07 16:34 ` Chen-Yu Tsai
0 siblings, 0 replies; 8+ messages in thread
From: Chen-Yu Tsai @ 2023-08-07 16:34 UTC (permalink / raw)
To: Andre Przywara
Cc: Rob Herring, Lee Jones, Krzysztof Kozlowski, Conor Dooley,
devicetree, linux-kernel, Icenowy Zheng, Shengyu Qu, Martin Botka,
Martin Botka, Mark Brown
On Mon, Aug 7, 2023 at 9:42 PM Andre Przywara <andre.przywara@arm.com> wrote:
>
> On Fri, 4 Aug 2023 09:34:32 -0600
> Rob Herring <robh@kernel.org> wrote:
>
> Hi,
>
> > On Wed, Aug 02, 2023 at 03:18:29PM +0100, Andre Przywara wrote:
> > > 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.
> > >
> > > Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> > > ---
> > > 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.
>
> 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/20230807133930.94309-1-andre.przywara@arm.com/
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
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-08-07 16:35 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-02 14:18 [PATCH] dt-bindings: mfd: x-powers,axp152: make interrupt optional for more chips Andre Przywara
2023-08-02 19:07 ` Martin Botka
2023-08-03 15:55 ` Conor Dooley
2023-08-04 15:34 ` Rob Herring
2023-08-07 13:42 ` Andre Przywara
2023-08-07 16:34 ` Chen-Yu Tsai
2023-08-05 15:43 ` Shengyu Qu
2023-08-05 22:50 ` Andre Przywara
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).