public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Frieder Schrempf <frieder@fris.de>
To: linux-arm-kernel@lists.infradead.org, Marek Vasut <marex@denx.de>,
	Conor Dooley <conor+dt@kernel.org>,
	devicetree@vger.kernel.org,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	Rob Herring <robh@kernel.org>, Robin Gong <yibin.gong@nxp.com>
Cc: Frieder Schrempf <frieder.schrempf@kontron.de>,
	Joy Zou <joy.zou@nxp.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Subject: [PATCH v2 02/11] dt-bindings: regulator: pca9450: Add sd-vsel-gpios to read back LDO5 status
Date: Wed, 27 Nov 2024 17:42:18 +0100	[thread overview]
Message-ID: <20241127164337.613915-3-frieder@fris.de> (raw)
In-Reply-To: <20241127164337.613915-1-frieder@fris.de>

From: Frieder Schrempf <frieder.schrempf@kontron.de>

In order to know the current status (which of the two control
registers is used) for the LDO5 regulator, we need to route back the
USDHC_VSELECT signal by setting the SION bit in the IOMUX.

By adding the according GPIO as sd-vsel-gpios to the LDO5 node, we
allow the regulator driver to sample the current status of the
SD_VSEL signal that is used to select the correct control register.

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.

As the SD_VSEL pin is directly routed to the LDO5 regulator in the
PMIC, make the sd-vsel-gpios property part of the LDO5 node.

SoC                                  PMIC
+-----------------------+           +-------------------+
|                       |           |                   |
|                       |           |                   |
|  GPIO <----------+    |           |                   |
|                  |    |    SD_VSEL|   +-------+       |
|  USDHC_VSELECT ->+------------------->| LDO5  |       |
|                       |           |   +-------+       |
|                       |           |                   |
+-----------------------+           +-------------------+

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
Changes for v2:
* extend commit message
* split into two patches (revert old sd-vsel-gpios separately)
---
 .../regulator/nxp,pca9450-regulator.yaml       | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
index 79fc0baf5fa2f..5d0d684186c96 100644
--- a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
+++ b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
@@ -41,8 +41,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:
-- 
2.46.1


  parent reply	other threads:[~2024-11-27 16:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-27 16:42 [PATCH v2 00/11] Use correct LDO5 control registers for PCA9450 Frieder Schrempf
2024-11-27 16:42 ` [PATCH v2 01/11] Revert "regulator: pca9450: Add sd-vsel GPIO" Frieder Schrempf
2024-11-27 16:47   ` Mark Brown
2024-11-28 17:37   ` Conor Dooley
2024-12-10 15:59     ` Frieder Schrempf
2024-12-16 19:59       ` Conor Dooley
2024-11-27 16:42 ` Frieder Schrempf [this message]
2024-11-27 16:42 ` [PATCH v2 03/11] dt-bindings: regulator: pca9450: Document nxp,sd-vsel-fixed-low property for LDO5 Frieder Schrempf
2024-11-28 17:33   ` Conor Dooley
2024-12-10 15:36     ` Frieder Schrempf
2024-12-16 19:50       ` Conor Dooley
2024-11-27 16:42 ` [PATCH v2 04/11] arm64: dts: imx8mp-skov-reva: Use hardware signal for SD card VSELECT Frieder Schrempf
2024-11-27 16:42 ` [PATCH v2 09/11] arm64: dts: imx8mm-kontron: Add support for reading SD_VSEL signal Frieder Schrempf
2024-11-27 16:42 ` [PATCH v2 10/11] arm64: dts: imx93-kontron: Fix SD card IO voltage control Frieder Schrempf
2024-11-27 16:42 ` [PATCH v2 11/11] arm64: dts: imx8mp-kontron: Add support for reading SD_VSEL signal Frieder Schrempf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241127164337.613915-3-frieder@fris.de \
    --to=frieder@fris.de \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frieder.schrempf@kontron.de \
    --cc=joy.zou@nxp.com \
    --cc=krzk+dt@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=robh@kernel.org \
    --cc=yibin.gong@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox