Skip to content

Commit f9cbf56

Browse files
fschrempfbroonie
authored andcommitted
dt-bindings: regulator: pca9450: Add properties for handling LDO5
This reverts commit 27866e3 and implements a new future-proof way of handling the mismatch between the PMIC driver and the hardware for LDO5. It turned out that this feature was implemented based on the wrong assumption that the SD_VSEL signal needs to be controlled as GPIO in any case. In fact the straight-forward approach is to mux the signal as USDHC_VSELECT and let the USDHC controller do the job. Most users never even used this property and the few who did have been or are getting migrated to the alternative approach. 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 | | | | | +-------+ | | | | | +-----------------------+ +-------------------+ For boards which have the SD_VSEL tied to a fixed low level, we add 'nxp,sd-vsel-fixed-low'. The voltage of LDO5 is therefore only controlled by writing to the LDO5CTRL_L register. If none of 'nxp,sd-vsel-fixed-low' or 'sd-vsel-gpios' is set, we keep the same behavior as before. The driver assumes that SD_VSEL is tied high and the LDO5CTRL_H register can be used, which is in fact not true for all known boards and works merely by chance. Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://patch.msgid.link/20241218152842.97483-2-frieder@fris.de Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 2014c95 commit f9cbf56

1 file changed

Lines changed: 23 additions & 6 deletions

File tree

Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,30 @@ properties:
4242
description: |
4343
list of regulators provided by this controller
4444
45+
properties:
46+
LDO5:
47+
type: object
48+
$ref: regulator.yaml#
49+
description:
50+
Properties for single LDO5 regulator.
51+
52+
properties:
53+
nxp,sd-vsel-fixed-low:
54+
type: boolean
55+
description:
56+
Let the driver know that SD_VSEL is hardwired to low level and
57+
there is no GPIO to get the actual value from.
58+
59+
sd-vsel-gpios:
60+
description:
61+
GPIO that can be used to read the current status of the SD_VSEL
62+
signal in order for the driver to know if LDO5CTRL_L or LDO5CTRL_H
63+
is used by the hardware.
64+
65+
unevaluatedProperties: false
66+
4567
patternProperties:
46-
"^LDO[1-5]$":
68+
"^LDO[1-4]$":
4769
type: object
4870
$ref: regulator.yaml#
4971
description:
@@ -78,11 +100,6 @@ properties:
78100

79101
additionalProperties: false
80102

81-
sd-vsel-gpios:
82-
description: GPIO that is used to switch LDO5 between being configured by
83-
LDO5CTRL_L or LDO5CTRL_H register. Use this if the SD_VSEL signal is
84-
connected to a host GPIO.
85-
86103
nxp,i2c-lt-enable:
87104
type: boolean
88105
description:

0 commit comments

Comments
 (0)