aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini2019-10-16 18:10:31 -0400
committerTom Rini2019-10-16 18:10:31 -0400
commitc83b1bb923421e95e499b22b010d2f9f463c1226 (patch)
tree48860f46e83dc30d9a77fac61c979fb3625588d7 /include
parentd2a93a88631929169d3ef1c537430330404f96f7 (diff)
parentd11ef4d54cab0e740efbceb9c6b5697a41770eea (diff)
Merge tag 'dm-pull-15oct19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
binman enhancements: - Dropping some test Elf files and building them from source instead - Refactoring of x86 16-bit entries - Support for SPL symbols within sections - Handle the 'notes' sections and hidden symbols in recent binutils - Improved error reporting with a tool fails libfdt and documentation fixes vboot required-key test driver model power-domain controls patman Message-Id enhancement
Diffstat (limited to 'include')
-rw-r--r--include/dm/device.h7
-rw-r--r--include/dm/of.h2
-rw-r--r--include/power-domain.h34
3 files changed, 40 insertions, 3 deletions
diff --git a/include/dm/device.h b/include/dm/device.h
index defda0aebcb..d7ad9d6728b 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -61,6 +61,9 @@ struct driver_info;
*/
#define DM_FLAG_OS_PREPARE (1 << 10)
+/* DM does not enable/disable the power domains corresponding to this device */
+#define DM_FLAG_DEFAULT_PD_CTRL_OFF (1 << 11)
+
/*
* One or multiple of these flags are passed to device_remove() so that
* a selective device removal as specified by the remove-stage and the
@@ -945,8 +948,8 @@ static inline void *devm_kzalloc(struct udevice *dev, size_t size, gfp_t gfp)
return kzalloc(size, gfp);
}
-static inline void *devm_kmaloc_array(struct udevice *dev,
- size_t n, size_t size, gfp_t flags)
+static inline void *devm_kmalloc_array(struct udevice *dev,
+ size_t n, size_t size, gfp_t flags)
{
/* TODO: add kmalloc_array() to linux/compat.h */
if (size != 0 && n > SIZE_MAX / size)
diff --git a/include/dm/of.h b/include/dm/of.h
index 461e25aa19d..6bef73b441c 100644
--- a/include/dm/of.h
+++ b/include/dm/of.h
@@ -111,7 +111,7 @@ static inline const char *of_node_full_name(const struct device_node *np)
/* Default #address and #size cells */
#if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT)
-#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
+#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
#endif
diff --git a/include/power-domain.h b/include/power-domain.h
index ef15dc9f607..72ff2ff25ba 100644
--- a/include/power-domain.h
+++ b/include/power-domain.h
@@ -155,4 +155,38 @@ static inline int power_domain_off(struct power_domain *power_domain)
}
#endif
+/**
+ * dev_power_domain_on - Enable power domains for a device .
+ *
+ * @dev: The client device.
+ *
+ * @return 0 if OK, or a negative error code.
+ */
+#if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) && \
+ CONFIG_IS_ENABLED(POWER_DOMAIN)
+int dev_power_domain_on(struct udevice *dev);
+#else
+static inline int dev_power_domain_on(struct udevice *dev)
+{
+ return 0;
+}
+#endif
+
+/**
+ * dev_power_domain_off - Disable power domains for a device .
+ *
+ * @dev: The client device.
+ *
+ * @return 0 if OK, or a negative error code.
+ */
+#if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) && \
+ CONFIG_IS_ENABLED(POWER_DOMAIN)
+int dev_power_domain_off(struct udevice *dev);
+#else
+static inline int dev_power_domain_off(struct udevice *dev)
+{
+ return 0;
+}
+#endif
+
#endif