Message ID | 20230802141829.522595-1-andre.przywara@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp524653vqx; Wed, 2 Aug 2023 08:08:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlElUcxHtoYptgcKIRYwhoKBKqibmjF2fiDW2jv1qjrOPlPEuxj1e0qGp/bCr3O3XkHFt1Pi X-Received: by 2002:a17:902:e847:b0:1b8:b41a:d4be with SMTP id t7-20020a170902e84700b001b8b41ad4bemr19963493plg.10.1690988939336; Wed, 02 Aug 2023 08:08:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690988939; cv=none; d=google.com; s=arc-20160816; b=tfo3xmF45fQqg5nwLAnlj/RlKZ5QbItXaaw6rEMl9G8wDFKAMpKVi/FSR4kERfR3ny P/I33gWWhHTFTw7/09OoShZZHvkKOcA10k7PThE1hY6oGxpds707aofSjKhtRdNvWxGF HVn/XKrp1wS/EML/+pWQtjuvddASKXErY8583PXoS48hTC5AoagkNnFm0A+wSTMX0ARd J1QNOFCyz1Q+z9faZg0j4+W7xsYR7h6+8S3CsjrAUDktPvTrR8qK22fV6o7el2+6z7Z0 vGCs/5SteQp9T7HinZuCuRAC4nFux13ABG0YsRloxMUYItwEvV/+2N+XDyegbeUTQaP5 7qWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=z8XMpc0ZtgOnZh4dT8z+/MXgJA08IHKJjvxwDHiq6xI=; fh=SANLfPK3a3TkXUNYcB24b4ZiP9YNBNEcHkwrdUeXB4o=; b=I9gl/woW75r7ikVNPCeb7zy47HTD3inEOn2POoxW7gtaOuDgVr/qcKr/6e7mY2WfsO YVQeJitWcFEbQmhrLSyFc1vRnEvEgDL2ihvGOI8nzP2awZzEBjWjc+LKNbbKiNVdp4Er OGtCs2qypvzq5EGMO6AiSvo4v5HP0vtUM3e0KkENhKr9HWZyEoDf5RnokgcgZ61DC+4g qVQweh+f+zO9kfsl7FoOjr+CfSHbINtM85vHKo48wqj17zOfxVKLufMYUMRbZZnB+W0R iY23vKQQxjtKlbLy2aJBz3EEOgdJ89sWL7M1LW235Qx3NfLE983lzidgbEA1clEH3MuZ nDOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z16-20020a170903019000b001b8b2cb7359si10924567plg.627.2023.08.02.08.08.38; Wed, 02 Aug 2023 08:08:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233746AbjHBOSt (ORCPT <rfc822;maxi.paulin@gmail.com> + 99 others); Wed, 2 Aug 2023 10:18:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232699AbjHBOSp (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 2 Aug 2023 10:18:45 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BDC782711; Wed, 2 Aug 2023 07:18:37 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7F193113E; Wed, 2 Aug 2023 07:19:20 -0700 (PDT) Received: from donnerap.arm.com (donnerap.manchester.arm.com [10.32.100.58]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8E6C73F5A1; Wed, 2 Aug 2023 07:18:35 -0700 (PDT) From: Andre Przywara <andre.przywara@arm.com> To: Lee Jones <lee@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Chen-Yu Tsai <wens@csie.org> Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Icenowy Zheng <uwu@icenowy.me>, Shengyu Qu <wiagn233@outlook.com>, Martin Botka <martin.botka@somainline.org>, Martin Botka <martin@biqu3d.com>, Mark Brown <broonie@kernel.org> Subject: [PATCH] dt-bindings: mfd: x-powers,axp152: make interrupt optional for more chips Date: Wed, 2 Aug 2023 15:18:29 +0100 Message-Id: <20230802141829.522595-1-andre.przywara@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773130418058906445 X-GMAIL-MSGID: 1773130418058906445 |
Series |
dt-bindings: mfd: x-powers,axp152: make interrupt optional for more chips
|
|
Commit Message
Andre Przywara
Aug. 2, 2023, 2:18 p.m. UTC
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(-)
Comments
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:
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 >
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
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:
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:
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
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
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: