summaryrefslogtreecommitdiffstats
path: root/include/linux/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2015-02-08 11:16:22 +0800
committerMark Brown <broonie@kernel.org>2015-02-08 11:16:22 +0800
commitfca8e13f50e604436951ce59736046a79258ec20 (patch)
tree710bcf636a9ca0efafefffcae2009e3a3c107483 /include/linux/regulator
parenta9877b606ceb40e5b7e08b62d5f10c65b761dcff (diff)
parentf47531b1aa86e0bef898c1ff810f8486f469b111 (diff)
Merge remote-tracking branch 'regulator/topic/dt-cb' into regulator-next
Diffstat (limited to 'include/linux/regulator')
-rw-r--r--include/linux/regulator/driver.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 5f1e9ca4741..d4ad5b5a02b 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -21,6 +21,7 @@
struct regmap;
struct regulator_dev;
+struct regulator_config;
struct regulator_init_data;
struct regulator_enable_gpio;
@@ -205,6 +206,15 @@ enum regulator_type {
* @supply_name: Identifying the regulator supply
* @of_match: Name used to identify regulator in DT.
* @regulators_node: Name of node containing regulator definitions in DT.
+ * @of_parse_cb: Optional callback called only if of_match is present.
+ * Will be called for each regulator parsed from DT, during
+ * init_data parsing.
+ * The regulator_config passed as argument to the callback will
+ * be a copy of config passed to regulator_register, valid only
+ * for this particular call. Callback may freely change the
+ * config but it cannot store it for later usage.
+ * Callback should return 0 on success or negative ERRNO
+ * indicating failure.
* @id: Numerical identifier for the regulator.
* @ops: Regulator operations table.
* @irq: Interrupt number for the regulator.
@@ -251,6 +261,9 @@ struct regulator_desc {
const char *supply_name;
const char *of_match;
const char *regulators_node;
+ int (*of_parse_cb)(struct device_node *,
+ const struct regulator_desc *,
+ struct regulator_config *);
int id;
bool continuous_voltage_range;
unsigned n_voltages;