summaryrefslogtreecommitdiff
path: root/include/power-domain.h
diff options
context:
space:
mode:
authorLokesh Vutla <lokeshvutla@ti.com>2018-08-27 15:57:44 +0530
committerTom Rini <trini@konsulko.com>2018-09-11 08:32:55 -0400
commit2618cf365770fbccd6e6281d10005ddc7e392087 (patch)
tree2c7967f6be1f488f9c2b8a5c9867cc4b32c67a66 /include/power-domain.h
parente585bef17f9cc22ff82398654e8dfed8e5f39100 (diff)
power domain: Add support for multiple powerdomains per device
There are cases where there are more than one power domain attached to the device inorder to get the device functional. So add support for enabling power domain based on the index. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Diffstat (limited to 'include/power-domain.h')
-rw-r--r--include/power-domain.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/power-domain.h b/include/power-domain.h
index a558fbbdb2..00996057b0 100644
--- a/include/power-domain.h
+++ b/include/power-domain.h
@@ -98,6 +98,27 @@ int power_domain_get(struct udevice *dev, struct power_domain *power_domain)
#endif
/**
+ * power_domain_get_by_index - Get the indexed power domain for a device.
+ *
+ * @dev: The client device.
+ * @power_domain: A pointer to a power domain struct to initialize.
+ * @index: Power domain index to be powered on.
+ *
+ * @return 0 if OK, or a negative error code.
+ */
+#if CONFIG_IS_ENABLED(POWER_DOMAIN)
+int power_domain_get_by_index(struct udevice *dev,
+ struct power_domain *power_domain, int index);
+#else
+static inline
+int power_domain_get_by_index(struct udevice *dev,
+ struct power_domain *power_domain, int index)
+{
+ return -ENOSYS;
+}
+#endif
+
+/**
* power_domain_free - Free a previously requested power domain.
*
* @power_domain: A power domain struct that was previously successfully