Lines Matching full:device
25 * struct bus_type - The bus type of the device
31 * @drv_groups: Default attributes of the device drivers on the bus.
32 * @match: Called, perhaps multiple times, whenever a new device or driver
34 * given device can be handled by the given driver and zero
36 * the driver supports the device is not possible. In case of
37 * -EPROBE_DEFER it will queue the device for deferred probing.
38 * @uevent: Called when a device is added, removed, or a few other things
40 * @probe: Called when a new device or driver add to this bus, and callback
41 * the specific driver's probe to initial the matched device.
42 * @sync_state: Called to sync device state to software state after all the
43 * state tracking consumers linked to this device (present at
45 * driver. If the device has no consumers, this function will
46 * be called at late_initcall_sync level. If the device has
49 * @remove: Called when a device removed from this bus.
50 * @shutdown: Called at shut-down time to quiesce the device.
52 * @online: Called to put the device back online (after offlining it).
53 * @offline: Called to put the device offline for hot-removal. May fail.
55 * @suspend: Called when a device on this bus wants to go to sleep mode.
56 * @resume: Called to bring a device on this bus out of sleep mode.
57 * @num_vf: Called to find out how many virtual functions a device on this
59 * @dma_configure: Called to setup DMA configuration on a device on
61 * @dma_cleanup: Called to cleanup DMA configuration on a device on
64 * device driver's pm-ops.
65 * @need_parent_lock: When probing or removing a device on this bus, the
66 * device core should lock the device's parent.
69 * purposes of the device model, all devices are connected via a bus, even if
71 * A USB controller is usually a PCI device, for example. The device model
84 int (*match)(struct device *dev, const struct device_driver *drv);
85 int (*uevent)(const struct device *dev, struct kobj_uevent_env *env);
86 int (*probe)(struct device *dev);
87 void (*sync_state)(struct device *dev);
88 void (*remove)(struct device *dev);
89 void (*shutdown)(struct device *dev);
91 int (*online)(struct device *dev);
92 int (*offline)(struct device *dev);
94 int (*suspend)(struct device *dev, pm_message_t state);
95 int (*resume)(struct device *dev);
97 int (*num_vf)(struct device *dev);
99 int (*dma_configure)(struct device *dev);
100 void (*dma_cleanup)(struct device *dev);
129 /* Matching function type for drivers/base APIs to find a specific device */
130 typedef int (*device_match_t)(struct device *dev, const void *data);
132 /* Generic device matching functions that all busses can use to match with */
133 int device_match_name(struct device *dev, const void *name);
134 int device_match_of_node(struct device *dev, const void *np);
135 int device_match_fwnode(struct device *dev, const void *fwnode);
136 int device_match_devt(struct device *dev, const void *pdevt);
137 int device_match_acpi_dev(struct device *dev, const void *adev);
138 int device_match_acpi_handle(struct device *dev, const void *handle);
139 int device_match_any(struct device *dev, const void *unused);
142 int bus_for_each_dev(const struct bus_type *bus, struct device *start, void *data,
143 int (*fn)(struct device *dev, void *data));
144 struct device *bus_find_device(const struct bus_type *bus, struct device *start,
147 * bus_find_device_by_name - device iterator for locating a particular device
150 * @start: Device to begin with
151 * @name: name of the device to match
153 static inline struct device *bus_find_device_by_name(const struct bus_type *bus, in bus_find_device_by_name()
154 struct device *start, in bus_find_device_by_name()
161 * bus_find_device_by_of_node : device iterator for locating a particular device
164 * @np: of_node of the device to match.
166 static inline struct device *
173 * bus_find_device_by_fwnode : device iterator for locating a particular device
176 * @fwnode: fwnode of the device to match.
178 static inline struct device *
185 * bus_find_device_by_devt : device iterator for locating a particular device
186 * matching the device type.
188 * @devt: device type of the device to match.
190 static inline struct device *bus_find_device_by_devt(const struct bus_type *bus, in bus_find_device_by_devt()
197 * bus_find_next_device - Find the next device after a given device in a
200 * @cur: device to begin the search with.
202 static inline struct device *
203 bus_find_next_device(const struct bus_type *bus,struct device *cur) in bus_find_next_device()
212 * bus_find_device_by_acpi_dev : device iterator for locating a particular device
213 * matching the ACPI COMPANION device.
215 * @adev: ACPI COMPANION device to match.
217 static inline struct device *
223 static inline struct device *
233 int (*compare)(const struct device *a,
234 const struct device *b));
248 * @BUS_NOTIFY_ADD_DEVICE: device is added to this bus
249 * @BUS_NOTIFY_DEL_DEVICE: device is about to be removed from this bus
250 * @BUS_NOTIFY_REMOVED_DEVICE: device is successfully removed from this bus
251 * @BUS_NOTIFY_BIND_DRIVER: a driver is about to be bound to this device on this bus
252 * @BUS_NOTIFY_BOUND_DRIVER: a driver is successfully bound to this device on this bus
253 * @BUS_NOTIFY_UNBIND_DRIVER: a driver is about to be unbound from this device on this bus
254 * @BUS_NOTIFY_UNBOUND_DRIVER: a driver is successfully unbound from this device on this bus
255 * @BUS_NOTIFY_DRIVER_NOT_BOUND: a driver failed to be bound to this device on this bus
259 * Note that bus notifiers are likely to be called with the device lock already
261 * you do with the device structure.
263 * All bus notifiers are called with the target struct device * as an argument.
277 struct device *bus_get_dev_root(const struct bus_type *bus);