Lines Matching +full:device +full:- +full:unique

1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2019-2020 Intel Corporation
5 * Please see Documentation/driver-api/auxiliary_bus.rst for more information.
11 #include <linux/device.h>
20 * responsible for the management of the memory used for the device object.
25 * it is done with the device. The release() function is then automatically
47 * device which unregisters the auxiliary device object(s).
51 * unregisters the auxiliary device.
55 * struct auxiliary_device - auxiliary device object.
56 * @dev: Device,
57 * The release and parent fields of the device structure must be filled
59 * @name: Match name found by the auxiliary device driver,
60 * @id: unique identitier if multiple devices of the same name are exported,
62 * An auxiliary_device represents a part of its parent device's functionality.
65 * id that combined with the match_name provide a unique name to register with
66 * the bus subsystem. For example, a driver registering an auxiliary device is
70 * Registering an auxiliary_device is a three-step process.
73 * sub-device desired. The name, id, dev.release, and dev.parent fields of
78 * "foo_mod.foo_dev", are registered onto the bus, they must have unique id
81 * unique, then the device_add fails and generates an error message.
84 * be populated with a non-NULL pointer to successfully register the
86 * auxiliary device must be free'ed. Because once the device is placed on the
91 * drivers device.
99 * call to auxiliary_device_add(), which sets the name of the device and adds
100 * the device to the bus.
102 * .. code-block:: c
111 * my_aux_dev->name = MY_DEVICE_NAME;
112 * my_aux_dev->id = my_unique_id_alloc(xxx);
113 * my_aux_dev->dev.release = my_aux_dev_release;
114 * my_aux_dev->dev.parent = my_dev;
129 * Unregistering an auxiliary_device is a two-step process to mirror the
133 * .. code-block:: c
135 * auxiliary_device_delete(my_dev->my_aux_dev);
136 * auxiliary_device_uninit(my_dev->my_aux_dev);
139 struct device dev;
145 * struct auxiliary_driver - Definition of an auxiliary bus driver
146 * @probe: Called when a matching device is added to the bus.
147 * @remove: Called when device is removed from the bus.
148 * @shutdown: Called at shut-down time to quiesce the device.
149 * @suspend: Called to put the device to sleep mode. Usually to a power state.
150 * @resume: Called to bring a device from sleep mode.
164 * .. code-block:: c
193 return dev_get_drvdata(&auxdev->dev); in auxiliary_get_drvdata()
198 dev_set_drvdata(&auxdev->dev, data); in auxiliary_set_drvdata()
201 static inline struct auxiliary_device *to_auxiliary_dev(struct device *dev) in to_auxiliary_dev()
217 put_device(&auxdev->dev); in auxiliary_device_uninit()
222 device_del(&auxdev->dev); in auxiliary_device_delete()
233 * module_auxiliary_driver() - Helper macro for registering an auxiliary driver
240 * .. code-block:: c
247 struct auxiliary_device *auxiliary_find_device(struct device *start,
249 int (*match)(struct device *dev, const void *data));