#ifndef _POWER_DOMAIN_H
#define _POWER_DOMAIN_H
+#include <linux/errno.h>
+
/**
* A power domain is a portion of an SoC or chip that is powered by a
* switchable source of power. In many cases, software has control over the
*
* @dev: The client device.
* @power_domain A pointer to a power domain struct to initialize.
- * @return 0 if OK, or a negative error code.
+ * 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);
* @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.
+ * Return: 0 if OK, or a negative error code.
*/
#if CONFIG_IS_ENABLED(POWER_DOMAIN)
int power_domain_get_by_index(struct udevice *dev,
}
#endif
+/**
+ * power_domain_get_by_name - Get the named power domain for a device.
+ *
+ * @dev: The client device.
+ * @power_domain: A pointer to a power domain struct to initialize.
+ * @name: Power domain name to be powered on.
+ *
+ * Return: 0 if OK, or a negative error code.
+ */
+#if CONFIG_IS_ENABLED(POWER_DOMAIN)
+int power_domain_get_by_name(struct udevice *dev,
+ struct power_domain *power_domain, const char *name);
+#else
+static inline
+int power_domain_get_by_name(struct udevice *dev,
+ struct power_domain *power_domain, const char *name)
+{
+ return -ENOSYS;
+}
+#endif
+
/**
* power_domain_free - Free a previously requested power domain.
*
* @power_domain: A power domain struct that was previously successfully
* requested by power_domain_get().
- * @return 0 if OK, or a negative error code.
+ * Return: 0 if OK, or a negative error code.
*/
#if CONFIG_IS_ENABLED(POWER_DOMAIN)
int power_domain_free(struct power_domain *power_domain);
*
* @power_domain: A power domain struct that was previously successfully
* requested by power_domain_get().
- * @return 0 if OK, or a negative error code.
+ * Return: 0 if OK, or a negative error code.
*/
#if CONFIG_IS_ENABLED(POWER_DOMAIN)
int power_domain_on(struct power_domain *power_domain);
*
* @power_domain: A power domain struct that was previously successfully
* requested by power_domain_get().
- * @return 0 if OK, or a negative error code.
+ * Return: 0 if OK, or a negative error code.
*/
#if CONFIG_IS_ENABLED(POWER_DOMAIN)
int power_domain_off(struct power_domain *power_domain);
*
* @dev: The client device.
*
- * @return 0 if OK, or a negative error code.
+ * Return: 0 if OK, or a negative error code.
*/
#if CONFIG_IS_ENABLED(OF_REAL) && CONFIG_IS_ENABLED(POWER_DOMAIN)
int dev_power_domain_on(struct udevice *dev);
*
* @dev: The client device.
*
- * @return 0 if OK, or a negative error code.
+ * Return: 0 if OK, or a negative error code.
*/
#if CONFIG_IS_ENABLED(OF_REAL) && CONFIG_IS_ENABLED(POWER_DOMAIN)
int dev_power_domain_off(struct udevice *dev);