diff options
author | Rajendra Nayak <rnayak@ti.com> | 2011-11-18 06:17:20 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-11-23 13:47:31 -0500 |
commit | 69511a452e6dc6b74fe4f3671a51b1b44b9c57e3 (patch) | |
tree | 486fe8a536a367c0e83f55a97103a1a527a7e2bf /include/linux/regulator/driver.h | |
parent | 2c043bcbf287dc69848054d5c02c55c20f7a7bc5 (diff) |
regulator: map consumer regulator based on device tree
Device nodes in DT can associate themselves with one or more
regulators/supply by providing a list of phandles (to regulator nodes)
and corresponding supply names.
For Example:
devicenode: node@0x0 {
...
...
vmmc-supply = <®ulator1>;
vpll-supply = <®ulator2>;
};
The driver would then do a regulator_get(dev, "vmmc"); to get
regulator1 and do a regulator_get(dev, "vpll"); to get
regulator2.
of_get_regulator() extracts the regulator node for a given
device, based on the supply name.
Use it to look up the regulator for a given consumer from device tree, during
a regulator_get(). If not found fallback and lookup through
the regulator_map_list instead.
Also, since the regulator dt nodes can use the same binding to
associate with a parent regulator/supply, allow the drivers to
specify a supply_name, which can then be used to lookup dt
to find the parent phandle.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/linux/regulator/driver.h')
-rw-r--r-- | include/linux/regulator/driver.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 8fbb6964bb7e..4214b9a9d1c9 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -154,6 +154,7 @@ enum regulator_type { | |||
154 | * this type. | 154 | * this type. |
155 | * | 155 | * |
156 | * @name: Identifying name for the regulator. | 156 | * @name: Identifying name for the regulator. |
157 | * @supply_name: Identifying the regulator supply | ||
157 | * @id: Numerical identifier for the regulator. | 158 | * @id: Numerical identifier for the regulator. |
158 | * @n_voltages: Number of selectors available for ops.list_voltage(). | 159 | * @n_voltages: Number of selectors available for ops.list_voltage(). |
159 | * @ops: Regulator operations table. | 160 | * @ops: Regulator operations table. |
@@ -163,6 +164,7 @@ enum regulator_type { | |||
163 | */ | 164 | */ |
164 | struct regulator_desc { | 165 | struct regulator_desc { |
165 | const char *name; | 166 | const char *name; |
167 | const char *supply_name; | ||
166 | int id; | 168 | int id; |
167 | unsigned n_voltages; | 169 | unsigned n_voltages; |
168 | struct regulator_ops *ops; | 170 | struct regulator_ops *ops; |