Lines Matching +full:pm +full:- +full:bus
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.
19 #include <linux/pm.h>
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
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.
63 * this bus.
64 * @pm: Power management operations of this bus, callback the specific
65 * device driver's pm-ops.
66 * @iommu_ops: IOMMU specific operations for this bus, used to attach IOMMU
67 * driver implementations to a bus and allow the driver to do
68 * bus-specific setup
72 * @need_parent_lock: When probing or removing a device on this bus, the
75 * A bus is a channel between the processor and one or more devices. For the
76 * purposes of the device model, all devices are connected via a bus, even if
77 * it is an internal, virtual, "platform" bus. Buses can plug into each other.
80 * A bus is represented by the bus_type structure. It contains the name, the
81 * default attributes, the bus' methods, PM operations, and the driver core's
110 const struct dev_pm_ops *pm; member
120 extern int __must_check bus_register(struct bus_type *bus);
122 extern void bus_unregister(struct bus_type *bus);
124 extern int __must_check bus_rescan_devices(struct bus_type *bus);
128 ssize_t (*show)(struct bus_type *bus, char *buf);
129 ssize_t (*store)(struct bus_type *bus, const char *buf, size_t count);
164 int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data,
166 struct device *bus_find_device(struct bus_type *bus, struct device *start,
170 * bus_find_device_by_name - device iterator for locating a particular device
172 * @bus: bus type
176 static inline struct device *bus_find_device_by_name(struct bus_type *bus, in bus_find_device_by_name() argument
180 return bus_find_device(bus, start, name, device_match_name); in bus_find_device_by_name()
186 * @bus: bus type
190 bus_find_device_by_of_node(struct bus_type *bus, const struct device_node *np) in bus_find_device_by_of_node() argument
192 return bus_find_device(bus, NULL, np, device_match_of_node); in bus_find_device_by_of_node()
198 * @bus: bus type
202 bus_find_device_by_fwnode(struct bus_type *bus, const struct fwnode_handle *fwnode) in bus_find_device_by_fwnode() argument
204 return bus_find_device(bus, NULL, fwnode, device_match_fwnode); in bus_find_device_by_fwnode()
210 * @bus: bus type
213 static inline struct device *bus_find_device_by_devt(struct bus_type *bus, in bus_find_device_by_devt() argument
216 return bus_find_device(bus, NULL, &devt, device_match_devt); in bus_find_device_by_devt()
220 * bus_find_next_device - Find the next device after a given device in a
221 * given bus.
222 * @bus: bus type
226 bus_find_next_device(struct bus_type *bus,struct device *cur) in bus_find_next_device() argument
228 return bus_find_device(bus, cur, NULL, device_match_any); in bus_find_next_device()
237 * @bus: bus type
241 bus_find_device_by_acpi_dev(struct bus_type *bus, const struct acpi_device *adev) in bus_find_device_by_acpi_dev() argument
243 return bus_find_device(bus, NULL, adev, device_match_acpi_dev); in bus_find_device_by_acpi_dev()
247 bus_find_device_by_acpi_dev(struct bus_type *bus, const void *adev) in bus_find_device_by_acpi_dev() argument
253 struct device *subsys_find_device_by_id(struct bus_type *bus, unsigned int id,
255 int bus_for_each_drv(struct bus_type *bus, struct device_driver *start,
257 void bus_sort_breadthfirst(struct bus_type *bus,
261 * Bus notifiers: Get notified of addition/removal of devices
268 extern int bus_register_notifier(struct bus_type *bus,
270 extern int bus_unregister_notifier(struct bus_type *bus,
289 extern struct kset *bus_get_kset(struct bus_type *bus);
290 extern struct klist *bus_get_device_klist(struct bus_type *bus);