]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
regulator: of: add init-microvolt property
authorLaxman Dewangan <ldewangan@nvidia.com>
Tue, 17 Sep 2013 14:35:18 +0000 (20:05 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Fri, 14 Oct 2016 22:35:12 +0000 (15:35 -0700)
Add DT property regulator-init-microvolt to pass the
initial voltage setting of the rail.

Change-Id: I38573973cd70850c70a4e43d4a34817fefe2313b
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/275793
(cherry picked from commit 88219bd52a5d3232f8e1bcf3dbf7115b79b1a760)
Reviewed-on: http://git-master/r/1236225
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Documentation/devicetree/bindings/regulator/regulator.txt
drivers/regulator/of_regulator.c

index 1d112fc456aa9e0ecf31a8e5d796001e24ce20b5..e0471ce94df7a6651077ce1c4df3ca28880e69f7 100644 (file)
@@ -44,6 +44,7 @@ Optional properties:
   any consumer request.
 - regulator-pull-down: Enable pull down resistor when the regulator is disabled.
 - regulator-over-current-protection: Enable over current protection.
+- regulator-init-microvolt: Initial microvolt need to be set during registration
 
 Deprecated properties:
 - regulator-compatible: If a regulator chip contains multiple
index 5960d9b6b9dab80c1b923157551f9e1c11b1e978..d6473fb54c0d655ac3fd16488efa1344906b9558 100644 (file)
@@ -29,6 +29,7 @@ static void of_get_regulation_constraints(struct device_node *np,
                                        const struct regulator_desc *desc)
 {
        const __be32 *min_uV, *max_uV;
+       const __be32 *init_uV;
        struct regulation_constraints *constraints = &(*init_data)->constraints;
        struct regulator_state *suspend_state;
        struct device_node *suspend_np;
@@ -43,6 +44,9 @@ static void of_get_regulation_constraints(struct device_node *np,
        max_uV = of_get_property(np, "regulator-max-microvolt", NULL);
        if (max_uV)
                constraints->max_uV = be32_to_cpu(*max_uV);
+       init_uV = of_get_property(np, "regulator-init-microvolt", NULL);
+       if (init_uV)
+               constraints->init_uV = be32_to_cpu(*init_uV);
 
        /* Voltage change possible? */
        if (constraints->min_uV != constraints->max_uV)