blob: 65b69c427899e582568538a942c2eb71a61b60bd [file] [log] [blame]
Przemyslaw Marczak08edd002015-04-20 20:07:42 +02001Voltage/Current regulator
2
3Binding:
4The regulator devices don't use the "compatible" property. The binding is done
Felix Bracke23c3882017-11-27 09:14:16 +01005by the prefix of regulator node's name, or, if this fails, by the prefix of the
6regulator's "regulator-name" property. Usually the pmic I/O driver will provide
Przemyslaw Marczak08edd002015-04-20 20:07:42 +02007the array of 'struct pmic_child_info' with the prefixes and compatible drivers.
8The bind is done by calling function: pmic_bind_childs().
9Example drivers:
10pmic: drivers/power/pmic/max77686.c
11regulator: drivers/power/regulator/max77686.c
12
13For the node name e.g.: "prefix[:alpha:]num { ... }":
Felix Brack8fc9c3d2017-09-22 14:27:28 +020014- the driver prefix should be: "prefix" - case sensitive
Przemyslaw Marczak08edd002015-04-20 20:07:42 +020015- the node name's "num" is set as "dev->driver_data" on bind
16
Felix Brack8fc9c3d2017-09-22 14:27:28 +020017Example the prefix "ldo" will pass for: "ldo1", "ldo@1", "ldoreg@1, ...
Przemyslaw Marczak08edd002015-04-20 20:07:42 +020018
Felix Bracke23c3882017-11-27 09:14:16 +010019Binding by means of the node's name is preferred. However if the node names
20would produce ambiguous prefixes (like "regulator@1" and "regualtor@11") and you
21can't or do not want to change them then binding against the "regulator-name"
22property is possible. The syntax for the prefix of the "regulator-name" property
23is the same as the one for the regulator's node name.
24Use case: a regulator named "regulator@1" to be bound to a driver named
25"LDO_DRV" and a regulator named "regualator@11" to be bound to an other driver
26named "BOOST_DRV". Using prefix "regualtor@1" for driver matching would load
27the same driver for both regulators, hence the prefix is ambiguous.
28
Przemyslaw Marczak08edd002015-04-20 20:07:42 +020029Optional properties:
Felix Bracke23c3882017-11-27 09:14:16 +010030- regulator-name: a string, required by the regulator uclass, used for driver
31 binding if binding by node's name prefix fails
Przemyslaw Marczak08edd002015-04-20 20:07:42 +020032- regulator-min-microvolt: a minimum allowed Voltage value
33- regulator-max-microvolt: a maximum allowed Voltage value
34- regulator-min-microamp: a minimum allowed Current value
35- regulator-max-microamp: a maximum allowed Current value
36- regulator-always-on: regulator should never be disabled
37- regulator-boot-on: enabled by bootloader/firmware
38
Peng Fanb4cb9ce2015-08-07 16:43:43 +080039Note
40The "regulator-name" constraint is used for setting the device's uclass
41platform data '.name' field. And the regulator device name is set from
42it's node name. If "regulator-name" is not provided in dts, node name
43is chosen for setting the device's uclass platform data '.name' field.
44
Przemyslaw Marczak08edd002015-04-20 20:07:42 +020045Other kernel-style properties, are currently not used.
46
47Note:
48For the regulator autoset from constraints, the framework expects that:
49- regulator-min-microvolt is equal to regulator-max-microvolt
50- regulator-min-microamp is equal to regulator-max-microamp
51- regulator-always-on or regulator-boot-on is set
52
53Example:
54ldo0 {
Przemyslaw Marczak08edd002015-04-20 20:07:42 +020055 /* Optional */
Peng Fanb4cb9ce2015-08-07 16:43:43 +080056 regulator-name = "VDDQ_EMMC_1.8V";
Przemyslaw Marczak08edd002015-04-20 20:07:42 +020057 regulator-min-microvolt = <1800000>;
58 regulator-max-microvolt = <1800000>;
59 regulator-min-microamp = <100000>;
60 regulator-max-microamp = <100000>;
61 regulator-always-on;
62 regulator-boot-on;
63};