aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-06-17 12:56:39 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2009-09-22 08:32:36 -0400
commit40f9244f4da8976eeb6d5ed6313c635ba238a9d3 (patch)
treeced24007caae264ca2423a5b968fb13af230e413 /include/linux/regulator
parenta5d2abce4373810c0109c5939c0094ac16698625 (diff)
regulator: Allow consumer supplies to be set up with dev_name()
Follow the approach suggested by Russell King and implemented by him in the clkdev API and allow consumer device supply mapings to be set up using the dev_name() for the consumer instead of the struct device. In order to avoid making existing machines instabuggy and creating merge issues the use of struct device is still supported for the time being. This resolves problems working with buses such as I2C which make the struct device available late providing that the final device name is known, which is the case for most embedded systems with fixed setups. Consumers must still use the struct device when calling regulator_get(). Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'include/linux/regulator')
-rw-r--r--include/linux/regulator/machine.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index bac64fa390f2..9328090eca20 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -126,13 +126,18 @@ struct regulation_constraints {
126/** 126/**
127 * struct regulator_consumer_supply - supply -> device mapping 127 * struct regulator_consumer_supply - supply -> device mapping
128 * 128 *
129 * This maps a supply name to a device. 129 * This maps a supply name to a device. Only one of dev or dev_name
130 * can be specified. Use of dev_name allows support for buses which
131 * make struct device available late such as I2C and is the preferred
132 * form.
130 * 133 *
131 * @dev: Device structure for the consumer. 134 * @dev: Device structure for the consumer.
135 * @dev_name: Result of dev_name() for the consumer.
132 * @supply: Name for the supply. 136 * @supply: Name for the supply.
133 */ 137 */
134struct regulator_consumer_supply { 138struct regulator_consumer_supply {
135 struct device *dev; /* consumer */ 139 struct device *dev; /* consumer */
140 const char *dev_name; /* dev_name() for consumer */
136 const char *supply; /* consumer supply - e.g. "vcc" */ 141 const char *supply; /* consumer supply - e.g. "vcc" */
137}; 142};
138 143