Message ID | 20230213155833.1644366-2-frieder@fris.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2423249wrn; Mon, 13 Feb 2023 08:00:34 -0800 (PST) X-Google-Smtp-Source: AK7set/KxCRROBPM4ux/LFVIGhnpD+ljwfxSqBU9vQI1659X/jZ47/HjpDilcQmFbXQnabB87R59 X-Received: by 2002:a17:90b:388b:b0:233:e0d5:a2ab with SMTP id mu11-20020a17090b388b00b00233e0d5a2abmr6385057pjb.34.1676304034416; Mon, 13 Feb 2023 08:00:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676304034; cv=none; d=google.com; s=arc-20160816; b=wgWicj1HxBtte1SC7cCEF/hqxvwEXVEI8C0TjlzTUOjDULslU5vkQ371DDON7KWkGY z+Ddvb9/ansXCANms4iLTnASQk5ShSlC3qSz6s/Y6+qo3KIHC+tCdO7jAjXJL2PS9aXG 2xjJSnx/tGpYkvUYfyojdwGPW8RQCdxdyjFCr8SRiOdCW4ZOZK6kgxAuqT4mt0fBhp64 Hi8NKyaW9EZE/F0MtQv7ByqtFlXbvGFze9Cdcq293paqAcQL7fdR40bL4tedQ3RODX2y xova2p54qTX20TKQ3SKu/Lm/zjDEAFuutpWREhV1xMtoiPWCFgUFKXuVs868R5J/9BHv jpNw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1hMuNgLfmYKnEteM9D2HKTHTutb/TpNG5wgcFSK2t6I=; b=w3f+rTL39JmbGVduXlcNNGpUqLODF1coPD9mr+gBc6JCc5awV4QaIXJgYknKWPijPd GYJsXw7W1irNum+53qTuD8kQaglvW1BVo/ybdvmCXLtmSt2eAZMvbhSfA398m9jx8fLN FEPfMgLclNz/ODNICwf/kZvcLXr7/dkBSKyU3AFfBYfwZGxk7zb/mFyenZp8tlmUoe4i rlu/Hc5U0CKl6f+Zip3uamdvzCNlTpKaXFD1+VPu2s6zVvEHmgL7BWFCIPOBfxhseBeS iP17Jc5PS+yrEtBLgeNbDg1QSmvSG53SbCzn0nv6Cn0o7UOkOaW/4aI/tL2PdCeY6F9Y MHgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fris.de header.s=dkim header.b=EYOHLaah; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fris.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lb9-20020a17090b4a4900b002307345bf7bsi16607344pjb.23.2023.02.13.08.00.21; Mon, 13 Feb 2023 08:00:34 -0800 (PST) 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; dkim=pass header.i=@fris.de header.s=dkim header.b=EYOHLaah; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fris.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231311AbjBMP75 (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Mon, 13 Feb 2023 10:59:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231310AbjBMP7q (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 13 Feb 2023 10:59:46 -0500 Received: from mail.fris.de (mail.fris.de [IPv6:2a01:4f8:c2c:390b::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 028182687; Mon, 13 Feb 2023 07:59:45 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 2F64DC0176; Mon, 13 Feb 2023 16:59:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fris.de; s=dkim; t=1676303984; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=1hMuNgLfmYKnEteM9D2HKTHTutb/TpNG5wgcFSK2t6I=; b=EYOHLaahGl9AS5iE/8SSCDIFFURc8P60qTcUkxBkiX+UIXON6UQC+WV3qmIwjAQmyUp6iS 01fYBcrJOXFxoOnhZ/NxCFoINDiNw5CuU6m4zL2lol829B2DEvVMGpw+Ka2r4K1GiNtohP LZaWUFbQvPH4AygtVS84gUZT8TsAmqelmsVW3IOA67Fl4u40xHr9UvOkrQKVgXL4iz3/bK rD0Vap2FcH68o11+3G1A0pZDyGT2Y09t+i0ekuqhqUHcMJQWzjt8i/3qCMP6hUnW2B7xw7 N7b3wJh+dDIs5CEGTvTbVhuGjfEw6IEWGMAf4GxsP764IPKUM751BZHog+azPg== From: Frieder Schrempf <frieder@fris.de> To: devicetree@vger.kernel.org, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Liam Girdwood <lgirdwood@gmail.com>, linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>, Robin Gong <yibin.gong@nxp.com> Cc: Marek Vasut <marex@denx.de>, Frieder Schrempf <frieder.schrempf@kontron.de>, Per-Daniel Olsson <perdo@axis.com>, Rickard x Andersson <rickaran@axis.com> Subject: [PATCH 1/6] dt-bindings: regulator: pca9450: Document new usage of sd-vsel-gpios Date: Mon, 13 Feb 2023 16:58:19 +0100 Message-Id: <20230213155833.1644366-2-frieder@fris.de> In-Reply-To: <20230213155833.1644366-1-frieder@fris.de> References: <20230213155833.1644366-1-frieder@fris.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757732179308848892?= X-GMAIL-MSGID: =?utf-8?q?1757732179308848892?= |
Series |
Use correct LDO5 control registers for PCA9450
|
|
Commit Message
Frieder Schrempf
Feb. 13, 2023, 3:58 p.m. UTC
From: Frieder Schrempf <frieder.schrempf@kontron.de> The sd-vsel-gpios property is abandoned in its current meaning as an output. We now use it to specify an optional signal that can be evaluated by the driver in order to retrieve the current status of the SD_VSEL signal that is used to select the control register of LDO5. Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> --- .../regulator/nxp,pca9450-regulator.yaml | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-)
Comments
On Mon, Feb 13, 2023 at 04:58:19PM +0100, Frieder Schrempf wrote: > From: Frieder Schrempf <frieder.schrempf@kontron.de> > > The sd-vsel-gpios property is abandoned in its current meaning as an > output. We now use it to specify an optional signal that can be > evaluated by the driver in order to retrieve the current status > of the SD_VSEL signal that is used to select the control register > of LDO5. > > Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> > --- > .../regulator/nxp,pca9450-regulator.yaml | 23 ++++++++++++++----- > 1 file changed, 17 insertions(+), 6 deletions(-) > > diff --git a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml > index 835b53302db8..c86534538a4e 100644 > --- a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml > +++ b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml > @@ -40,8 +40,24 @@ properties: > description: | > list of regulators provided by this controller > > + properties: > + LDO5: > + type: object > + $ref: regulator.yaml# > + description: > + Properties for single LDO5 regulator. > + > + properties: > + sd-vsel-gpios: It is a pin on the device, right? Then it belongs in the device node as it was. Can't the direction of the signal tell you how it is used? Assuming the pin is bidirectional? The binding should support any possible way the device is wired, not just what's been seen so far on some boards. Rob
On 2/15/23 21:02, Rob Herring wrote: > On Mon, Feb 13, 2023 at 04:58:19PM +0100, Frieder Schrempf wrote: >> From: Frieder Schrempf <frieder.schrempf@kontron.de> >> >> The sd-vsel-gpios property is abandoned in its current meaning as an >> output. We now use it to specify an optional signal that can be >> evaluated by the driver in order to retrieve the current status >> of the SD_VSEL signal that is used to select the control register >> of LDO5. >> >> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> >> --- >> .../regulator/nxp,pca9450-regulator.yaml | 23 ++++++++++++++----- >> 1 file changed, 17 insertions(+), 6 deletions(-) >> >> diff --git a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml >> index 835b53302db8..c86534538a4e 100644 >> --- a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml >> +++ b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml >> @@ -40,8 +40,24 @@ properties: >> description: | >> list of regulators provided by this controller >> >> + properties: >> + LDO5: >> + type: object >> + $ref: regulator.yaml# >> + description: >> + Properties for single LDO5 regulator. >> + >> + properties: >> + sd-vsel-gpios: > > It is a pin on the device, right? Then it belongs in the device node as > it was. > > Can't the direction of the signal tell you how it is used? Assuming the > pin is bidirectional? The pin is input to the PMIC, it is unidirection, i.e. SoC(output)---->(input)PMIC > The binding should support any possible way the device is wired, not > just what's been seen so far on some boards. The usage is always the above as far as I can tell.
On Wed, Feb 15, 2023 at 7:27 PM Marek Vasut <marex@denx.de> wrote: > > On 2/15/23 21:02, Rob Herring wrote: > > On Mon, Feb 13, 2023 at 04:58:19PM +0100, Frieder Schrempf wrote: > >> From: Frieder Schrempf <frieder.schrempf@kontron.de> > >> > >> The sd-vsel-gpios property is abandoned in its current meaning as an > >> output. We now use it to specify an optional signal that can be > >> evaluated by the driver in order to retrieve the current status > >> of the SD_VSEL signal that is used to select the control register > >> of LDO5. > >> > >> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> > >> --- > >> .../regulator/nxp,pca9450-regulator.yaml | 23 ++++++++++++++----- > >> 1 file changed, 17 insertions(+), 6 deletions(-) > >> > >> diff --git a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml > >> index 835b53302db8..c86534538a4e 100644 > >> --- a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml > >> +++ b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml > >> @@ -40,8 +40,24 @@ properties: > >> description: | > >> list of regulators provided by this controller > >> > >> + properties: > >> + LDO5: > >> + type: object > >> + $ref: regulator.yaml# > >> + description: > >> + Properties for single LDO5 regulator. > >> + > >> + properties: > >> + sd-vsel-gpios: > > > > It is a pin on the device, right? Then it belongs in the device node as > > it was. > > > > Can't the direction of the signal tell you how it is used? Assuming the > > pin is bidirectional? > > The pin is input to the PMIC, it is unidirection, i.e. > > SoC(output)---->(input)PMIC > > > The binding should support any possible way the device is wired, not > > just what's been seen so far on some boards. > > The usage is always the above as far as I can tell. This patch is saying the opposite though. Something else drives the signal, but the signal is also routed to the SoC to sample the state. Rob
On 16.02.23 03:30, Rob Herring wrote: > On Wed, Feb 15, 2023 at 7:27 PM Marek Vasut <marex@denx.de> wrote: >> >> On 2/15/23 21:02, Rob Herring wrote: >>> On Mon, Feb 13, 2023 at 04:58:19PM +0100, Frieder Schrempf wrote: >>>> From: Frieder Schrempf <frieder.schrempf@kontron.de> >>>> >>>> The sd-vsel-gpios property is abandoned in its current meaning as an >>>> output. We now use it to specify an optional signal that can be >>>> evaluated by the driver in order to retrieve the current status >>>> of the SD_VSEL signal that is used to select the control register >>>> of LDO5. >>>> >>>> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> >>>> --- >>>> .../regulator/nxp,pca9450-regulator.yaml | 23 ++++++++++++++----- >>>> 1 file changed, 17 insertions(+), 6 deletions(-) >>>> >>>> diff --git a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml >>>> index 835b53302db8..c86534538a4e 100644 >>>> --- a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml >>>> +++ b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml >>>> @@ -40,8 +40,24 @@ properties: >>>> description: | >>>> list of regulators provided by this controller >>>> >>>> + properties: >>>> + LDO5: >>>> + type: object >>>> + $ref: regulator.yaml# >>>> + description: >>>> + Properties for single LDO5 regulator. >>>> + >>>> + properties: >>>> + sd-vsel-gpios: >>> >>> It is a pin on the device, right? Then it belongs in the device node as >>> it was. Physically it's a pin on the PCA9450 chip. If you look at the block diagram in the datasheet [1] (page 3) you can see though, that the SD_VSEL signal is routed to the LD05 regulator block inside the chip. This makes me think that the signal is best described inside the LDO5 node. >>> >>> Can't the direction of the signal tell you how it is used? Assuming the >>> pin is bidirectional? >> >> The pin is input to the PMIC, it is unidirection, i.e. >> >> SoC(output)---->(input)PMIC >> >>> The binding should support any possible way the device is wired, not >>> just what's been seen so far on some boards. >> >> The usage is always the above as far as I can tell. There is only one usage that is likely to occur and that is the one we describe here. There are other ways to wire up the signal of course and in some unlikely event a hardware engineer might have the idea to hard-wire the SD_VSEL to a fixed level or wire it up to a SoC pin that doesn't have the VSELECT mux option. But I don't really see a good reason for covering these cases in the binding/driver if there are good chances we won't ever need them. > This patch is saying the opposite though. Something else drives the > signal, but the signal is also routed to the SoC to sample the state. SoC PMIC +-----------------------+ +-------------------+ | | | | | | | | | GPIO <----------+ | | | | | | SD_VSEL| +-------+ | | USHC_VSELECT -->+------------------->| LDO5 | | | | | +-------+ | | | | | +-----------------------+ +-------------------+ This is how the setup looks like. The SD_VSEL on the PMIC is always an input. It's driven by the SoC's VSELECT signal (controlled by the USDHC controller) and we use the SION bit in the IOMUX to internally loop back the signal in order to sample it using the GPIO. [1] https://www.nxp.com/docs/en/data-sheet/PCA9450DS.pdf
diff --git a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml index 835b53302db8..c86534538a4e 100644 --- a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml @@ -40,8 +40,24 @@ properties: description: | list of regulators provided by this controller + properties: + LDO5: + type: object + $ref: regulator.yaml# + description: + Properties for single LDO5 regulator. + + properties: + sd-vsel-gpios: + description: + GPIO that can be used to read the current status of the SD_VSEL + signal in order for the driver to know if LDO5CTRL_L or LDO5CTRL_H + is used by the hardware. + + unevaluatedProperties: false + patternProperties: - "^LDO[1-5]$": + "^LDO[1-4]$": type: object $ref: regulator.yaml# description: @@ -76,11 +92,6 @@ properties: additionalProperties: false - sd-vsel-gpios: - description: GPIO that is used to switch LDO5 between being configured by - LDO5CTRL_L or LDO5CTRL_H register. Use this if the SD_VSEL signal is - connected to a host GPIO. - nxp,i2c-lt-enable: type: boolean description: