Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15849a7b authored by David Collins's avatar David Collins Committed by Fenglin Wu
Browse files

regulator: rpmh-regulator: add support for min dropout voltage



Add support for specifying the minimum dropout voltage between a
given rpmh-regulator device and its parent.

Change-Id: I81909845efb2c3d0d034779b6e845d734c6fb715
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent 1dbf92ac
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -163,6 +163,24 @@ Second Level Nodes - Regulator Interfaces
		    regulator.  Supported values are RPMH_REGULATOR_LEVEL_*
		    (i.e. 1 to ~513).

- qcom,min-dropout-voltage
	Usage:      optional; VRM regulators only
	Value type: <u32>
	Definition: Specifies the minimum voltage in microvolts that the parent
		    supply regulator must output above the output of this
		    regulator.  It is only meaningful if the property
		    <regulator-name>-parent-supply has been specified in the
		    first level node.

- qcom,min-dropout-voltage-level
	Usage:      optional; ARC regulators only
	Value type: <u32>
	Definition: Specifies the minimum voltage level difference that the
		    parent supply regulator must output above the output of this
		    regulator.  It is only meaningful if the property
		    <regulator-name>-parent-supply has been specified in the
		    first level node.

========
Examples
========
+11 −1
Original line number Diff line number Diff line
/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1245,6 +1245,11 @@ static int rpmh_regulator_load_default_parameters(struct rpmh_vreg *vreg)
				return -EINVAL;
			}
		}

		prop = "qcom,min-dropout-voltage-level";
		rc = of_property_read_u32(vreg->of_node, prop, &temp);
		if (!rc)
			vreg->rdesc.min_dropout_uV = temp;
	} else if (type == RPMH_REGULATOR_TYPE_VRM) {
		prop = "qcom,init-enable";
		rc = of_property_read_u32(vreg->of_node, prop, &temp);
@@ -1293,6 +1298,11 @@ static int rpmh_regulator_load_default_parameters(struct rpmh_vreg *vreg)
						RPMH_REGULATOR_REG_VRM_HEADROOM,
						temp / 1000);
		}

		prop = "qcom,min-dropout-voltage";
		rc = of_property_read_u32(vreg->of_node, prop, &temp);
		if (!rc)
			vreg->rdesc.min_dropout_uV = temp;
	}

	return 0;