summaryrefslogtreecommitdiff
path: root/include/power-domain.h
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2018-07-27 10:20:36 +0800
committerAnatolij Gustschin <agust@denx.de>2018-08-06 11:50:03 +0200
commit58d3de19bca074247bbd0126e727d0003a78c52e (patch)
tree274e1b22f409402df0977890fca109e0d4a745a5 /include/power-domain.h
parentbb694d4e898b1368ba96e01481dc0a79c491e77c (diff)
power-domain: add dummy functions when CONFIG_POWER_DOMAIN not defined
Add dummy functions when CONFIG_POWER_DOMAIN not defined. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'include/power-domain.h')
-rw-r--r--include/power-domain.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/power-domain.h b/include/power-domain.h
index aba8c0f65c4..a558fbbdb21 100644
--- a/include/power-domain.h
+++ b/include/power-domain.h
@@ -87,7 +87,15 @@ struct power_domain {
* @power_domain A pointer to a power domain struct to initialize.
* @return 0 if OK, or a negative error code.
*/
+#if CONFIG_IS_ENABLED(POWER_DOMAIN)
int power_domain_get(struct udevice *dev, struct power_domain *power_domain);
+#else
+static inline
+int power_domain_get(struct udevice *dev, struct power_domain *power_domain)
+{
+ return -ENOSYS;
+}
+#endif
/**
* power_domain_free - Free a previously requested power domain.
@@ -96,7 +104,14 @@ int power_domain_get(struct udevice *dev, struct power_domain *power_domain);
* requested by power_domain_get().
* @return 0 if OK, or a negative error code.
*/
+#if CONFIG_IS_ENABLED(POWER_DOMAIN)
int power_domain_free(struct power_domain *power_domain);
+#else
+static inline int power_domain_free(struct power_domain *power_domain)
+{
+ return -ENOSYS;
+}
+#endif
/**
* power_domain_on - Enable power to a power domain.
@@ -105,7 +120,14 @@ int power_domain_free(struct power_domain *power_domain);
* requested by power_domain_get().
* @return 0 if OK, or a negative error code.
*/
+#if CONFIG_IS_ENABLED(POWER_DOMAIN)
int power_domain_on(struct power_domain *power_domain);
+#else
+static inline int power_domain_on(struct power_domain *power_domain)
+{
+ return -ENOSYS;
+}
+#endif
/**
* power_domain_off - Disable power ot a power domain.
@@ -114,6 +136,13 @@ int power_domain_on(struct power_domain *power_domain);
* requested by power_domain_get().
* @return 0 if OK, or a negative error code.
*/
+#if CONFIG_IS_ENABLED(POWER_DOMAIN)
int power_domain_off(struct power_domain *power_domain);
+#else
+static inline int power_domain_off(struct power_domain *power_domain)
+{
+ return -ENOSYS;
+}
+#endif
#endif