diff options
author | Tom Rini <trini@ti.com> | 2014-06-20 20:03:51 -0400 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-06-20 20:03:51 -0400 |
commit | 39b6d07fd7e692736cdb05a000b1c84ab43de4fb (patch) | |
tree | 72b3530f77de13dab378b5be9789edd952bc9e03 /include/dm | |
parent | 45f0ad9545578b4436fdf04ba25a10173bcb75ef (diff) | |
parent | 22ec136325fdfc805b1e48e5ac8e17f23b4e9fc6 (diff) | |
download | u-boot-imx-39b6d07fd7e692736cdb05a000b1c84ab43de4fb.zip u-boot-imx-39b6d07fd7e692736cdb05a000b1c84ab43de4fb.tar.gz u-boot-imx-39b6d07fd7e692736cdb05a000b1c84ab43de4fb.tar.bz2 |
Merge branch 'master' of git://git.denx.de/u-boot-dm
Diffstat (limited to 'include/dm')
-rw-r--r-- | include/dm/device-internal.h | 4 | ||||
-rw-r--r-- | include/dm/device.h | 8 | ||||
-rw-r--r-- | include/dm/lists.h | 20 | ||||
-rw-r--r-- | include/dm/root.h | 2 | ||||
-rw-r--r-- | include/dm/uclass.h | 10 |
5 files changed, 35 insertions, 9 deletions
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h index ea3df36..26e5cf5 100644 --- a/include/dm/device-internal.h +++ b/include/dm/device-internal.h @@ -84,4 +84,8 @@ int device_remove(struct udevice *dev); */ int device_unbind(struct udevice *dev); +/* Cast away any volatile pointer */ +#define DM_ROOT_NON_CONST (((gd_t *)gd)->dm_root) +#define DM_UCLASS_ROOT_NON_CONST (((gd_t *)gd)->uclass_root) + #endif diff --git a/include/dm/device.h b/include/dm/device.h index ec04982..ae75a3f 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -21,7 +21,7 @@ struct driver_info; #define DM_FLAG_ACTIVATED (1 << 0) /* DM is responsible for allocating and freeing platdata */ -#define DM_FLAG_ALLOC_PDATA (2 << 0) +#define DM_FLAG_ALLOC_PDATA (1 << 1) /** * struct udevice - An instance of a driver @@ -75,11 +75,11 @@ struct udevice { #define device_active(dev) ((dev)->flags & DM_FLAG_ACTIVATED) /** - * struct device_id - Lists the compatible strings supported by a driver + * struct udevice_id - Lists the compatible strings supported by a driver * @compatible: Compatible string * @data: Data for this compatible string */ -struct device_id { +struct udevice_id { const char *compatible; ulong data; }; @@ -121,7 +121,7 @@ struct device_id { struct driver { char *name; enum uclass_id id; - const struct device_id *of_match; + const struct udevice_id *of_match; int (*bind)(struct udevice *dev); int (*probe)(struct udevice *dev); int (*remove)(struct udevice *dev); diff --git a/include/dm/lists.h b/include/dm/lists.h index 7feba4b..49d87e6 100644 --- a/include/dm/lists.h +++ b/include/dm/lists.h @@ -32,8 +32,28 @@ struct driver *lists_driver_lookup_name(const char *name); */ struct uclass_driver *lists_uclass_lookup(enum uclass_id id); +/** + * lists_bind_drivers() - search for and bind all drivers to parent + * + * This searches the U_BOOT_DEVICE() structures and creates new devices for + * each one. The devices will have @parent as their parent. + * + * @parent: parent driver (root) + * @early_only: If true, bind only drivers with the DM_INIT_F flag. If false + * bind all drivers. + */ int lists_bind_drivers(struct udevice *parent); +/** + * lists_bind_fdt() - bind a device tree node + * + * This creates a new device bound to the given device tree node, with + * @parent as its parent. + * + * @parent: parent driver (root) + * @blob: device tree blob + * @offset: offset of this device tree node + */ int lists_bind_fdt(struct udevice *parent, const void *blob, int offset); #endif diff --git a/include/dm/root.h b/include/dm/root.h index 3018bc8..a4826a6 100644 --- a/include/dm/root.h +++ b/include/dm/root.h @@ -41,7 +41,7 @@ int dm_scan_platdata(void); int dm_scan_fdt(const void *blob); /** - * dm_init() - Initialize Driver Model structures + * dm_init() - Initialise Driver Model structures * * This function will initialize roots of driver tree and class tree. * This needs to be called before anything uses the DM diff --git a/include/dm/uclass.h b/include/dm/uclass.h index 931d9c0..afd9923 100644 --- a/include/dm/uclass.h +++ b/include/dm/uclass.h @@ -26,7 +26,7 @@ * @priv: Private data for this uclass * @uc_drv: The driver for the uclass itself, not to be confused with a * 'struct driver' - * dev_head: List of devices in this uclass (devices are attached to their + * @dev_head: List of devices in this uclass (devices are attached to their * uclass when their bind method is called) * @sibling_node: Next uclass in the linked list of uclasses */ @@ -96,12 +96,14 @@ int uclass_get(enum uclass_id key, struct uclass **ucp); /** * uclass_get_device() - Get a uclass device based on an ID and index * + * The device is probed to activate it ready for use. + * * id: ID to look up * @index: Device number within that uclass (0=first) - * @ucp: Returns pointer to uclass (there is only one per for each ID) + * @devp: Returns pointer to device (there is only one per for each ID) * @return 0 if OK, -ve on error */ -int uclass_get_device(enum uclass_id id, int index, struct udevice **ucp); +int uclass_get_device(enum uclass_id id, int index, struct udevice **devp); /** * uclass_first_device() - Get the first device in a uclass @@ -129,7 +131,7 @@ int uclass_next_device(struct udevice **devp); * * @pos: struct udevice * to hold the current device. Set to NULL when there * are no more devices. - * uc: uclass to scan + * @uc: uclass to scan */ #define uclass_foreach_dev(pos, uc) \ for (pos = list_entry((&(uc)->dev_head)->next, typeof(*pos), \ |