Lines Matching +full:bus +full:- +full:specific
1 // SPDX-License-Identifier: GPL-2.0
3 * bus.h - the bus-specific portions of the driver model
5 * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org>
6 * Copyright (c) 2004-2009 Greg Kroah-Hartman <gregkh@suse.de>
7 * Copyright (c) 2008-2009 Novell Inc.
8 * Copyright (c) 2012-2019 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 * Copyright (c) 2012-2019 Linux Foundation
11 * See Documentation/driver-api/driver-model/ for more information.
25 * struct bus_type - The bus type of the device
27 * @name: The name of the bus.
28 * @dev_name: Used for subsystems to enumerate devices like ("foo%u", dev->id).
30 * @bus_groups: Default attributes of the bus.
31 * @dev_groups: Default attributes of the devices on the bus.
32 * @drv_groups: Default attributes of the device drivers on the bus.
34 * is added for this bus. It should return a positive value if the
38 * -EPROBE_DEFER it will queue the device for deferred probing.
41 * @probe: Called when a new device or driver add to this bus, and callback
42 * the specific driver's probe to initial the matched device.
50 * @remove: Called when a device removed from this bus.
51 * @shutdown: Called at shut-down time to quiesce the device.
54 * @offline: Called to put the device offline for hot-removal. May fail.
56 * @suspend: Called when a device on this bus wants to go to sleep mode.
57 * @resume: Called to bring a device on this bus out of sleep mode.
59 * bus supports.
61 * this bus.
62 * @pm: Power management operations of this bus, callback the specific
63 * device driver's pm-ops.
64 * @iommu_ops: IOMMU specific operations for this bus, used to attach IOMMU
65 * driver implementations to a bus and allow the driver to do
66 * bus-specific setup
70 * @need_parent_lock: When probing or removing a device on this bus, the
73 * A bus is a channel between the processor and one or more devices. For the
74 * purposes of the device model, all devices are connected via a bus, even if
75 * it is an internal, virtual, "platform" bus. Buses can plug into each other.
78 * A bus is represented by the bus_type structure. It contains the name, the
79 * default attributes, the bus' methods, PM operations, and the driver core's
122 extern int __must_check bus_register(struct bus_type *bus);
124 extern void bus_unregister(struct bus_type *bus);
126 extern int __must_check bus_rescan_devices(struct bus_type *bus);
130 ssize_t (*show)(struct bus_type *bus, char *buf);
131 ssize_t (*store)(struct bus_type *bus, const char *buf, size_t count);
165 int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data,
167 struct device *bus_find_device(struct bus_type *bus, struct device *start,
171 * bus_find_device_by_name - device iterator for locating a particular device
172 * of a specific name.
173 * @bus: bus type
177 static inline struct device *bus_find_device_by_name(struct bus_type *bus, in bus_find_device_by_name() argument
181 return bus_find_device(bus, start, name, device_match_name); in bus_find_device_by_name()
187 * @bus: bus type
191 bus_find_device_by_of_node(struct bus_type *bus, const struct device_node *np) in bus_find_device_by_of_node() argument
193 return bus_find_device(bus, NULL, np, device_match_of_node); in bus_find_device_by_of_node()
199 * @bus: bus type
203 bus_find_device_by_fwnode(struct bus_type *bus, const struct fwnode_handle *fwnode) in bus_find_device_by_fwnode() argument
205 return bus_find_device(bus, NULL, fwnode, device_match_fwnode); in bus_find_device_by_fwnode()
211 * @bus: bus type
214 static inline struct device *bus_find_device_by_devt(struct bus_type *bus, in bus_find_device_by_devt() argument
217 return bus_find_device(bus, NULL, &devt, device_match_devt); in bus_find_device_by_devt()
221 * bus_find_next_device - Find the next device after a given device in a
222 * given bus.
223 * @bus: bus type
227 bus_find_next_device(struct bus_type *bus,struct device *cur) in bus_find_next_device() argument
229 return bus_find_device(bus, cur, NULL, device_match_any); in bus_find_next_device()
238 * @bus: bus type
242 bus_find_device_by_acpi_dev(struct bus_type *bus, const struct acpi_device *adev) in bus_find_device_by_acpi_dev() argument
244 return bus_find_device(bus, NULL, adev, device_match_acpi_dev); in bus_find_device_by_acpi_dev()
248 bus_find_device_by_acpi_dev(struct bus_type *bus, const void *adev) in bus_find_device_by_acpi_dev() argument
254 struct device *subsys_find_device_by_id(struct bus_type *bus, unsigned int id,
256 int bus_for_each_drv(struct bus_type *bus, struct device_driver *start,
258 void bus_sort_breadthfirst(struct bus_type *bus,
262 * Bus notifiers: Get notified of addition/removal of devices
269 extern int bus_register_notifier(struct bus_type *bus,
271 extern int bus_unregister_notifier(struct bus_type *bus,
290 extern struct kset *bus_get_kset(struct bus_type *bus);
291 extern struct klist *bus_get_device_klist(struct bus_type *bus);