]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
regulator: i.MX anatop: Allow supply regulator
authorSascha Hauer <s.hauer@pengutronix.de>
Tue, 13 Oct 2015 10:45:30 +0000 (12:45 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 16 Oct 2015 16:59:34 +0000 (17:59 +0100)
The anatop regulators are SoC internal LDO regulators usually supplied
by an external PMIC. This patch adds support for specifying the supply
from the device tree using the vin-supply property.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Documentation/devicetree/bindings/regulator/anatop-regulator.txt
drivers/regulator/anatop-regulator.c

index 758eae24082a56567fbad2c9069a66606f7c4708..37c4ea076f88e694b773a6233e37c8dd68dc5192 100644 (file)
@@ -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
+- vin-supply: The supply for this regulator
 
 Any property defined as part of the core regulator
 binding, defined in regulator.txt, can also be used.
index 738adfa5332bcdc5f3ef935436dcf79ca512ea62..7d99f2c8cef3e95f48667cb3f12530138adb1895 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/regmap.h>
 #include <linux/regulator/driver.h>
 #include <linux/regulator/of_regulator.h>
+#include <linux/regulator/machine.h>
 
 #define LDO_RAMP_UP_UNIT_IN_CYCLES      64 /* 64 cycles per step */
 #define LDO_RAMP_UP_FREQ_IN_MHZ         24 /* cycle based on 24M OSC */
@@ -199,6 +200,7 @@ static int anatop_regulator_probe(struct platform_device *pdev)
        rdesc->owner = THIS_MODULE;
 
        initdata = of_get_regulator_init_data(dev, np, rdesc);
+       initdata->supply_regulator = "vin";
        sreg->initdata = initdata;
 
        anatop_np = of_get_parent(np);
@@ -262,6 +264,7 @@ static int anatop_regulator_probe(struct platform_device *pdev)
        rdesc->vsel_reg = sreg->control_reg;
        rdesc->vsel_mask = ((1 << sreg->vol_bit_width) - 1) <<
                           sreg->vol_bit_shift;
+       rdesc->min_dropout_uV = 125000;
 
        config.dev = &pdev->dev;
        config.init_data = initdata;