summaryrefslogtreecommitdiff
path: root/drivers/regulator/internal.h
diff options
context:
space:
mode:
authorMaciej Purski <m.purski@samsung.com>2018-04-23 17:33:39 +0300
committerMark Brown <broonie@kernel.org>2018-05-17 10:05:48 +0300
commita085a31af566254fb8f7721911c828c8fa797894 (patch)
tree138f241b458d6ddf3b1e80d2765e16df1fcba36f /drivers/regulator/internal.h
parentf98618b34542706eddc3b66abc271f1c8d8c4a05 (diff)
downloadlinux-a085a31af566254fb8f7721911c828c8fa797894.tar.xz
regulator: core: Parse coupled regulators properties
On Odroid XU3/4 and other Exynos5422 based boards there is a case, that different devices on the board are supplied by different regulators with non-fixed voltages. If one of these devices temporarily requires higher voltage, there might occur a situation that the spread between devices' voltages is so high, that there is a risk of changing 'high' and 'low' states on the interconnection between devices powered by those regulators. Add new structure "coupling_desc" to regulator_dev, which contains pointers to all coupled regulators including the owner of the structure, number of coupled regulators and counter of currently resolved regulators. Add of_functions to parse all data needed in regulator coupling. Provide method to check DTS data consistency. Check if each coupled regulator's max_spread is equal and if their lists of regulators match. Signed-off-by: Maciej Purski <m.purski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/internal.h')
-rw-r--r--drivers/regulator/internal.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/regulator/internal.h b/drivers/regulator/internal.h
index 24fde1e08f3a..943926a156f2 100644
--- a/drivers/regulator/internal.h
+++ b/drivers/regulator/internal.h
@@ -62,6 +62,14 @@ struct regulator_init_data *regulator_of_get_init_data(struct device *dev,
const struct regulator_desc *desc,
struct regulator_config *config,
struct device_node **node);
+
+struct regulator_dev *of_parse_coupled_regulator(struct regulator_dev *rdev,
+ int index);
+
+int of_get_n_coupled(struct regulator_dev *rdev);
+
+bool of_check_coupling_data(struct regulator_dev *rdev);
+
#else
static inline struct regulator_dev *
of_find_regulator_by_node(struct device_node *np)
@@ -77,8 +85,25 @@ regulator_of_get_init_data(struct device *dev,
{
return NULL;
}
-#endif
+static inline struct regulator_dev *
+of_parse_coupled_regulator(struct regulator_dev *rdev,
+ int index)
+{
+ return NULL;
+}
+
+static inline int of_get_n_coupled(struct regulator_dev *rdev)
+{
+ return 0;
+}
+
+static inline bool of_check_coupling_data(struct regulator_dev *rdev)
+{
+ return false;
+}
+
+#endif
enum regulator_get_type {
NORMAL_GET,
EXCLUSIVE_GET,
@@ -88,5 +113,4 @@ enum regulator_get_type {
struct regulator *_regulator_get(struct device *dev, const char *id,
enum regulator_get_type get_type);
-
#endif