Lines Matching defs:uclass

13 #include <dm/uclass-id.h>
18 * struct uclass - a U-Boot drive class, collecting together similar drivers
20 * A uclass provides an interface to a particular function, which is
21 * implemented by one or more drivers. Every driver belongs to a uclass even
22 * if it is the only driver in that uclass. An example uclass is GPIO, which
25 * PMIC IO lines, all made available in a unified way through the uclass.
27 * @priv_: Private data for this uclass (do not access outside driver model)
28 * @uc_drv: The driver for the uclass itself, not to be confused with a
30 * @dev_head: List of devices in this uclass (devices are attached to their
31 * uclass when their bind method is called)
32 * @sibling_node: Next uclass in the linked list of uclasses
34 struct uclass {
44 /* Members of this uclass sequence themselves with aliases */
47 /* Members of this uclass without aliases don't get a sequence number */
54 * struct uclass_driver - Driver for the uclass
59 * @name: Name of uclass driver
60 * @id: ID number of this uclass
61 * @post_bind: Called after a new device is bound to this uclass
62 * @pre_unbind: Called before a device is unbound from this uclass
66 * @child_post_bind: Called after a child is bound to a device in this uclass
67 * @child_pre_probe: Called before a child in this uclass is probed
68 * @child_post_probe: Called after a child in this uclass is probed
69 * @init: Called to set up the uclass
70 * @destroy: Called to destroy the uclass
72 * to be allocated in the uclass's ->priv pointer. If zero, then the uclass
75 * by the uclass. If required this will be automatically allocated if this
78 * owned by the uclass as 'dev->uclass_plat'. If the value is non-zero,
81 * uclass) can hold parent data for the device/uclass. This value is only
87 * @flags: Flags for this uclass ``(DM_UC_...)``
100 int (*init)(struct uclass *class);
101 int (*destroy)(struct uclass *class);
124 * DM_UCLASS_DRIVER_REF() - Get a reference to a uclass driver
139 * Return: struct uclass_driver * for the uclass driver
145 * uclass_get_priv() - Get the private data for a uclass
150 void *uclass_get_priv(const struct uclass *uc);
153 * uclass_get() - Get a uclass based on an ID, creating it if needed
155 * Every uclass is identified by an ID, a number from 0 to n-1 where n is
156 * the number of uclasses. This function allows looking up a uclass by its
160 * @ucp: Returns pointer to uclass (there is only one per ID)
165 int uclass_get(enum uclass_id key, struct uclass **ucp);
168 * uclass_get_name() - Get the name of a uclass driver
171 * Return: the name of the uclass driver for that ID, or NULL if none
176 * uclass_get_by_namelen() - Look up a uclass by its driver name
179 * @len: Length of @name (the uclass driver name must have the same length)
180 * Return: the associated uclass ID, or UCLASS_INVALID if not found
185 * uclass_get_by_name() - Look up a uclass by its driver name
188 * Return: the associated uclass ID, or UCLASS_INVALID if not found
193 * uclass_get_device() - Get a uclass device based on an ID and index
198 * @index: Device number within that uclass (0=first)
205 * uclass_get_device_by_name() - Get a uclass device by its name
207 * This searches the devices in the uclass for one with the exactly given name.
220 * uclass_get_device_by_seq() - Get a uclass device based on an ID and sequence
236 * uclass_get_device_by_of_offset() - Get a uclass device by device tree node
238 * This searches the devices in the uclass for one attached to the given
252 * uclass_get_device_by_ofnode() - Get a uclass device by device tree node
254 * This searches the devices in the uclass for one attached to the given
268 * uclass_get_device_by_of_path() - Get a uclass device by device tree path
270 * This searches the devices in the uclass for one attached to the
285 * uclass_get_device_by_phandle_id() - Get a uclass device by phandle id
287 * This searches the devices in the uclass for one with the given phandle id.
291 * @id: uclass ID to look up
303 * uclass_get_device_by_phandle() - Get a uclass device by phandle
305 * This searches the devices in the uclass for one with the given phandle.
309 * @id: uclass ID to look up
320 * uclass_get_device_by_driver() - Get a uclass device for a driver
322 * This searches the devices in the uclass for one that uses the given
337 * uclass_first_device() - Get the first device in a uclass
346 * @devp: Returns pointer to the first device in that uclass if no error
352 * uclass_next_device() - Get the next device in a uclass
361 * to the next device in the uclass if no error occurred, or NULL if there is
367 * uclass_first_device_err() - Get the first device in a uclass
373 * @devp: Returns pointer to the first device in that uclass, or NULL if none
379 * uclass_next_device_err() - Get the next device in a uclass
385 * to the next device in the uclass if no error occurred, or NULL if
392 * uclass_first_device_check() - Get the first device in a uclass
401 * @devp: Returns pointer to the first device in that uclass, or NULL if there
409 * uclass_next_device_check() - Get the next device in a uclass
418 * to the next device in the uclass if any
427 * This searches through the devices for a particular uclass looking for one
432 * @devp: Returns pointer to the first matching device in that uclass, if found
439 * uclass_probe_all() - Probe all devices based on an uclass ID
441 * This function probes all devices associated with a uclass by
444 * @id: uclass ID to look up
450 * uclass_id_count() - Count the number of devices in a uclass
452 * @id: uclass ID to look up
453 * Return: number of devices in that uclass (0 if none)
458 * uclass_id_foreach_dev() - iterate through devices of a given uclass ID
461 * a uclass ID in order from start to end.
463 * If for some reason the uclass cannot be found, this does nothing.
468 * @uc: temporary uclass variable (``struct uclass *``)
475 * uclass_foreach_dev() - iterate through devices of a given uclass
478 * a uclass in order from start to end.
482 * @uc: uclass to scan (`struct uclass *`)
488 * uclass_foreach_dev_safe() - safely iterate through devices of a given uclass
491 * a uclass in order from start to end. Inside the loop, it is safe to remove
497 * @uc: uclass to scan (`struct uclass *`)
503 * uclass_foreach_dev_probe() - iterate through devices of a given uclass ID
506 * a uclass in order from start to end. Devices are probed if necessary,