Przemyslaw Marczak | 08edd00 | 2015-04-20 20:07:42 +0200 | [diff] [blame] | 1 | Voltage/Current regulator |
| 2 | |
| 3 | Binding: |
| 4 | The regulator devices don't use the "compatible" property. The binding is done |
Felix Brack | e23c388 | 2017-11-27 09:14:16 +0100 | [diff] [blame] | 5 | by the prefix of regulator node's name, or, if this fails, by the prefix of the |
| 6 | regulator's "regulator-name" property. Usually the pmic I/O driver will provide |
Przemyslaw Marczak | 08edd00 | 2015-04-20 20:07:42 +0200 | [diff] [blame] | 7 | the array of 'struct pmic_child_info' with the prefixes and compatible drivers. |
| 8 | The bind is done by calling function: pmic_bind_childs(). |
| 9 | Example drivers: |
| 10 | pmic: drivers/power/pmic/max77686.c |
| 11 | regulator: drivers/power/regulator/max77686.c |
| 12 | |
| 13 | For the node name e.g.: "prefix[:alpha:]num { ... }": |
Felix Brack | 8fc9c3d | 2017-09-22 14:27:28 +0200 | [diff] [blame] | 14 | - the driver prefix should be: "prefix" - case sensitive |
Przemyslaw Marczak | 08edd00 | 2015-04-20 20:07:42 +0200 | [diff] [blame] | 15 | - the node name's "num" is set as "dev->driver_data" on bind |
| 16 | |
Felix Brack | 8fc9c3d | 2017-09-22 14:27:28 +0200 | [diff] [blame] | 17 | Example the prefix "ldo" will pass for: "ldo1", "ldo@1", "ldoreg@1, ... |
Przemyslaw Marczak | 08edd00 | 2015-04-20 20:07:42 +0200 | [diff] [blame] | 18 | |
Felix Brack | e23c388 | 2017-11-27 09:14:16 +0100 | [diff] [blame] | 19 | Binding by means of the node's name is preferred. However if the node names |
| 20 | would produce ambiguous prefixes (like "regulator@1" and "regualtor@11") and you |
| 21 | can't or do not want to change them then binding against the "regulator-name" |
| 22 | property is possible. The syntax for the prefix of the "regulator-name" property |
| 23 | is the same as the one for the regulator's node name. |
| 24 | Use 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 |
| 26 | named "BOOST_DRV". Using prefix "regualtor@1" for driver matching would load |
| 27 | the same driver for both regulators, hence the prefix is ambiguous. |
| 28 | |
Przemyslaw Marczak | 08edd00 | 2015-04-20 20:07:42 +0200 | [diff] [blame] | 29 | Optional properties: |
Felix Brack | e23c388 | 2017-11-27 09:14:16 +0100 | [diff] [blame] | 30 | - regulator-name: a string, required by the regulator uclass, used for driver |
| 31 | binding if binding by node's name prefix fails |
Przemyslaw Marczak | 08edd00 | 2015-04-20 20:07:42 +0200 | [diff] [blame] | 32 | - 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 |
Krzysztof Kozlowski | e2fa397 | 2019-03-06 19:37:54 +0100 | [diff] [blame] | 38 | - regulator-ramp-delay: ramp delay for regulator (in uV/us) |
Joseph Chen | bb51132 | 2019-09-26 15:43:52 +0800 | [diff] [blame] | 39 | - regulator-init-microvolt: a init allowed Voltage value |
| 40 | - regulator-state-(standby|mem|disk) |
| 41 | type: object |
| 42 | description: |
| 43 | sub-nodes for regulator state in Standby, Suspend-to-RAM, and |
| 44 | Suspend-to-DISK modes. Equivalent with standby, mem, and disk Linux |
| 45 | sleep states. |
| 46 | |
| 47 | properties: |
| 48 | regulator-on-in-suspend: |
| 49 | description: regulator should be on in suspend state. |
| 50 | type: boolean |
| 51 | |
| 52 | regulator-off-in-suspend: |
| 53 | description: regulator should be off in suspend state. |
| 54 | type: boolean |
| 55 | |
| 56 | regulator-suspend-microvolt: |
| 57 | description: the default voltage which regulator would be set in |
| 58 | suspend. This property is now deprecated, instead setting voltage |
| 59 | for suspend mode via the API which regulator driver provides is |
| 60 | recommended. |
Przemyslaw Marczak | 08edd00 | 2015-04-20 20:07:42 +0200 | [diff] [blame] | 61 | |
Peng Fan | b4cb9ce | 2015-08-07 16:43:43 +0800 | [diff] [blame] | 62 | Note |
| 63 | The "regulator-name" constraint is used for setting the device's uclass |
| 64 | platform data '.name' field. And the regulator device name is set from |
| 65 | it's node name. If "regulator-name" is not provided in dts, node name |
| 66 | is chosen for setting the device's uclass platform data '.name' field. |
| 67 | |
Przemyslaw Marczak | 08edd00 | 2015-04-20 20:07:42 +0200 | [diff] [blame] | 68 | Other kernel-style properties, are currently not used. |
| 69 | |
| 70 | Note: |
| 71 | For the regulator autoset from constraints, the framework expects that: |
| 72 | - regulator-min-microvolt is equal to regulator-max-microvolt |
| 73 | - regulator-min-microamp is equal to regulator-max-microamp |
| 74 | - regulator-always-on or regulator-boot-on is set |
| 75 | |
| 76 | Example: |
| 77 | ldo0 { |
Przemyslaw Marczak | 08edd00 | 2015-04-20 20:07:42 +0200 | [diff] [blame] | 78 | /* Optional */ |
Peng Fan | b4cb9ce | 2015-08-07 16:43:43 +0800 | [diff] [blame] | 79 | regulator-name = "VDDQ_EMMC_1.8V"; |
Przemyslaw Marczak | 08edd00 | 2015-04-20 20:07:42 +0200 | [diff] [blame] | 80 | regulator-min-microvolt = <1800000>; |
| 81 | regulator-max-microvolt = <1800000>; |
| 82 | regulator-min-microamp = <100000>; |
| 83 | regulator-max-microamp = <100000>; |
Joseph Chen | bb51132 | 2019-09-26 15:43:52 +0800 | [diff] [blame] | 84 | regulator-init-microvolt = <1800000>; |
Przemyslaw Marczak | 08edd00 | 2015-04-20 20:07:42 +0200 | [diff] [blame] | 85 | regulator-always-on; |
| 86 | regulator-boot-on; |
Krzysztof Kozlowski | e2fa397 | 2019-03-06 19:37:54 +0100 | [diff] [blame] | 87 | regulator-ramp-delay = <12000>; |
Joseph Chen | bb51132 | 2019-09-26 15:43:52 +0800 | [diff] [blame] | 88 | regulator-state-mem { |
| 89 | regulator-on-in-suspend; |
| 90 | regulator-suspend-microvolt = <1800000>; |
| 91 | }; |
Przemyslaw Marczak | 08edd00 | 2015-04-20 20:07:42 +0200 | [diff] [blame] | 92 | }; |