[PATCH 1/2] regulator: anatop: allow LDO bypass to be set from device-tree

Tim Harvey tharvey at gateworks.com
Thu Sep 25 22:59:31 PDT 2014


The core regulators provided by the Anatop regulator (reg_core, reg_soc,
reg_pu) should be set in bypass mode if an extern PMIC regulator is used.
This allows configuring this from device-tree.

Cc: Philipp Zabel <p.zabel at pengutronix.de>
Cc: Fabio Estevam <festevam at gmail.com>
Cc: Mark Brown <broonie at linaro.org>
Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 Documentation/devicetree/bindings/regulator/anatop-regulator.txt | 1 +
 drivers/regulator/anatop-regulator.c                             | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/regulator/anatop-regulator.txt b/Documentation/devicetree/bindings/regulator/anatop-regulator.txt
index 758eae2..e958c60 100644
--- a/Documentation/devicetree/bindings/regulator/anatop-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/anatop-regulator.txt
@@ -13,6 +13,7 @@ Optional properties:
 - anatop-delay-reg-offset: Anatop MFD step time register offset
 - anatop-delay-bit-shift: Bit shift for the step time register
 - anatop-delay-bit-width: Number of bits used in the step time register
+- anatop-ldo-bypass: Enable LDO bypass mode (for core regulators)
 
 Any property defined as part of the core regulator
 binding, defined in regulator.txt, can also be used.
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index 4f730af..0a22d3a 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -279,8 +279,10 @@ static int anatop_regulator_probe(struct platform_device *pdev)
 		}
 
 		sreg->sel = (val & rdesc->vsel_mask) >> sreg->vol_bit_shift;
-		if (sreg->sel == LDO_FET_FULL_ON) {
+		if (sreg->sel == LDO_FET_FULL_ON ||
+		    of_property_read_bool(np, "anatop-ldo-bypass")) {
 			sreg->sel = 0;
+			dev_info(dev, "LDO bypass mode\n");
 			sreg->bypass = true;
 		}
 	} else {
-- 
1.8.3.2




More information about the linux-arm-kernel mailing list