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 * @sysfs.irqs: irqs xarray contains irq indices which are used by the device,
66 * An auxiliary_device represents a part of its parent device's functionality.
69 * id that combined with the match_name provide a unique name to register with
70 * the bus subsystem. For example, a driver registering an auxiliary device is
74 * Registering an auxiliary_device is a three-step process.
77 * sub-device desired. The name, id, dev.release, and dev.parent fields of
82 * "foo_mod.foo_dev", are registered onto the bus, they must have unique id
85 * unique, then the device_add fails and generates an error message.
88 * be populated with a non-NULL pointer to successfully register the
90 * auxiliary device must be free'ed. Because once the device is placed on the
95 * drivers device.
103 * call to auxiliary_device_add(), which sets the name of the device and adds
104 * the device to the bus.
106 * .. code-block:: c
115 * my_aux_dev->name = MY_DEVICE_NAME;
116 * my_aux_dev->id = my_unique_id_alloc(xxx);
117 * my_aux_dev->dev.release = my_aux_dev_release;
118 * my_aux_dev->dev.parent = my_dev;
133 * Unregistering an auxiliary_device is a two-step process to mirror the
137 * .. code-block:: c
139 * auxiliary_device_delete(my_dev->my_aux_dev);
140 * auxiliary_device_uninit(my_dev->my_aux_dev);
143 struct device dev;
154 * struct auxiliary_driver - Definition of an auxiliary bus driver
155 * @probe: Called when a matching device is added to the bus.
156 * @remove: Called when device is removed from the bus.
157 * @shutdown: Called at shut-down time to quiesce the device.
158 * @suspend: Called to put the device to sleep mode. Usually to a power state.
159 * @resume: Called to bring a device from sleep mode.
173 * .. code-block:: c
202 return dev_get_drvdata(&auxdev->dev); in auxiliary_get_drvdata()
207 dev_set_drvdata(&auxdev->dev, data); in auxiliary_set_drvdata()
210 static inline struct auxiliary_device *to_auxiliary_dev(struct device *dev) in to_auxiliary_dev()
241 mutex_destroy(&auxdev->sysfs.lock); in auxiliary_device_uninit()
242 put_device(&auxdev->dev); in auxiliary_device_uninit()
247 device_del(&auxdev->dev); in auxiliary_device_delete()
258 * module_auxiliary_driver() - Helper macro for registering an auxiliary driver
265 * .. code-block:: c