]> git.sur5r.net Git - u-boot/blobdiff - include/dm/device.h
dm: core: Convert driver_bind() to use const
[u-boot] / include / dm / device.h
index 81afa8c6281f8f9c55dbd968bfd4b344f8cf872a..fafecceb1ab1137cabe99f0af5fafd050b119bf4 100644 (file)
@@ -12,6 +12,7 @@
 #define _DM_DEVICE_H
 
 #include <dm/uclass-id.h>
+#include <fdtdec.h>
 #include <linker_lists.h>
 #include <linux/list.h>
 
@@ -29,6 +30,9 @@ struct driver_info;
 /* DM is responsible for allocating and freeing parent_platdata */
 #define DM_FLAG_ALLOC_PARENT_PDATA     (1 << 3)
 
+/* Allocate driver private data on a DMA boundary */
+#define DM_FLAG_ALLOC_PRIV_DMA (1 << 4)
+
 /**
  * struct udevice - An instance of a driver
  *
@@ -66,7 +70,7 @@ struct driver_info;
  * when the device is probed and will be unique within the device's uclass.
  */
 struct udevice {
-       struct driver *driver;
+       const struct driver *driver;
        const char *name;
        void *platdata;
        void *parent_platdata;
@@ -236,6 +240,16 @@ void *dev_get_priv(struct udevice *dev);
  */
 struct udevice *dev_get_parent(struct udevice *child);
 
+/**
+ * dev_get_uclass_priv() - Get the private uclass data for a device
+ *
+ * This checks that dev is not NULL, but no other checks for now
+ *
+ * @dev                Device to check
+ * @return private uclass data for this device, or NULL if none
+ */
+void *dev_get_uclass_priv(struct udevice *dev);
+
 /**
  * dev_get_of_data() - get the device tree data used to bind a device
  *
@@ -351,4 +365,13 @@ int device_find_first_child(struct udevice *parent, struct udevice **devp);
  */
 int device_find_next_child(struct udevice **devp);
 
+/**
+ * dev_get_addr() - Get the reg property of a device
+ *
+ * @dev: Pointer to a device
+ *
+ * @return addr
+ */
+fdt_addr_t dev_get_addr(struct udevice *dev);
+
 #endif