sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget,/translations/zh_CN/driver-api/auxiliary_busmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget,/translations/zh_TW/driver-api/auxiliary_busmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget,/translations/it_IT/driver-api/auxiliary_busmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget,/translations/ja_JP/driver-api/auxiliary_busmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget,/translations/ko_KR/driver-api/auxiliary_busmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget,/translations/sp_SP/driver-api/auxiliary_busmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h%SPDX-License-Identifier: GPL-2.0-onlyh]h%SPDX-License-Identifier: GPL-2.0-only}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhF/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus.rsthKubhtarget)}(h.. _auxiliary_bus:h]h}(h]h ]h"]h$]h&]refid auxiliary-busuh1hhKhhhhhhubhsection)}(hhh](htitle)}(h Auxiliary Bush]h Auxiliary Bus}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hXiIn some subsystems, the functionality of the core device (PCI/ACPI/other) is too complex for a single device to be managed by a monolithic driver (e.g. Sound Open Firmware), multiple devices might implement a common intersection of functionality (e.g. NICs + RDMA), or a driver may want to export an interface for another subsystem to drive (e.g. SIOV Physical Function export Virtual Function management). A split of the functionality into child- devices representing sub-domains of functionality makes it possible to compartmentalize, layer, and distribute domain-specific concerns via a Linux device-driver model.h]hXiIn some subsystems, the functionality of the core device (PCI/ACPI/other) is too complex for a single device to be managed by a monolithic driver (e.g. Sound Open Firmware), multiple devices might implement a common intersection of functionality (e.g. NICs + RDMA), or a driver may want to export an interface for another subsystem to drive (e.g. SIOV Physical Function export Virtual Function management). A split of the functionality into child- devices representing sub-domains of functionality makes it possible to compartmentalize, layer, and distribute domain-specific concerns via a Linux device-driver model.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:9: ./drivers/base/auxiliary.chKhhhhubh)}(hXAn example for this kind of requirement is the audio subsystem where a single IP is handling multiple entities such as HDMI, Soundwire, local devices such as mics/speakers etc. The split for the core's functionality can be arbitrary or be defined by the DSP firmware topology and include hooks for test/debug. This allows for the audio core device to be minimal and focused on hardware-specific control and communication.h]hXAn example for this kind of requirement is the audio subsystem where a single IP is handling multiple entities such as HDMI, Soundwire, local devices such as mics/speakers etc. The split for the core’s functionality can be arbitrary or be defined by the DSP firmware topology and include hooks for test/debug. This allows for the audio core device to be minimal and focused on hardware-specific control and communication.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:9: ./drivers/base/auxiliary.chKhhhhubh)}(hXsEach auxiliary_device represents a part of its parent functionality. The generic behavior can be extended and specialized as needed by encapsulating an auxiliary_device within other domain-specific structures and the use of .ops callbacks. Devices on the auxiliary bus do not share any structures and the use of a communication channel with the parent is domain-specific.h]hXsEach auxiliary_device represents a part of its parent functionality. The generic behavior can be extended and specialized as needed by encapsulating an auxiliary_device within other domain-specific structures and the use of .ops callbacks. Devices on the auxiliary bus do not share any structures and the use of a communication channel with the parent is domain-specific.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:9: ./drivers/base/auxiliary.chK&hhhhubh)}(hXNote that ops are intended as a way to augment instance behavior within a class of auxiliary devices, it is not the mechanism for exporting common infrastructure from the parent. Consider EXPORT_SYMBOL_NS() to convey infrastructure from the parent module to the auxiliary module(s).h]hXNote that ops are intended as a way to augment instance behavior within a class of auxiliary devices, it is not the mechanism for exporting common infrastructure from the parent. Consider EXPORT_SYMBOL_NS() to convey infrastructure from the parent module to the auxiliary module(s).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:9: ./drivers/base/auxiliary.chK,hhhhubh)}(hhh](h)}(h%When Should the Auxiliary Bus Be Usedh]h%When Should the Auxiliary Bus Be Used}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK ubh)}(hXThe auxiliary bus is to be used when a driver and one or more kernel modules, who share a common header file with the driver, need a mechanism to connect and provide access to a shared object allocated by the auxiliary_device's registering driver. The registering driver for the auxiliary_device(s) and the kernel module(s) registering auxiliary_drivers can be from the same subsystem, or from multiple subsystems.h]hXThe auxiliary bus is to be used when a driver and one or more kernel modules, who share a common header file with the driver, need a mechanism to connect and provide access to a shared object allocated by the auxiliary_device’s registering driver. The registering driver for the auxiliary_device(s) and the kernel module(s) registering auxiliary_drivers can be from the same subsystem, or from multiple subsystems.}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:15: ./drivers/base/auxiliary.chK5hjhhubh)}(htThe emphasis here is on a common generic interface that keeps subsystem customization out of the bus infrastructure.h]htThe emphasis here is on a common generic interface that keeps subsystem customization out of the bus infrastructure.}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:15: ./drivers/base/auxiliary.chKhj0ubj)}(hhh]h)}(h4embedded struct which hold all sysfs related fields,h]h4embedded struct which hold all sysfs related fields,}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjKhK>hjLubah}(h]h ]h"]h$]h&]uh1jhj0ubeh}(h]h ]h"]h$]h&]uh1j|hjKhK>hjyubj})}(hN``sysfs.irqs`` irqs xarray contains irq indices which are used by the device, h](j)}(h``sysfs.irqs``h]j)}(hjoh]h sysfs.irqs}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjmubah}(h]h ]h"]h$]h&]uh1jhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhK?hjiubj)}(hhh]h)}(h>irqs xarray contains irq indices which are used by the device,h]h>irqs xarray contains irq indices which are used by the device,}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK?hjubah}(h]h ]h"]h$]h&]uh1jhjiubeh}(h]h ]h"]h$]h&]uh1j|hjhK?hjyubj})}(h/``sysfs.lock`` Synchronize irq sysfs creation, h](j)}(h``sysfs.lock``h]j)}(hjh]h sysfs.lock}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhK@hjubj)}(hhh]h)}(hSynchronize irq sysfs creation,h]hSynchronize irq sysfs creation,}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK@hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j|hjhK@hjyubj})}(h9``sysfs.irq_dir_exists`` whether "irqs" directory exists,h](j)}(h``sysfs.irq_dir_exists``h]j)}(hjh]hsysfs.irq_dir_exists}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhK@hjubj)}(hhh]h)}(h whether "irqs" directory exists,h]h$whether “irqs” directory exists,}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKAhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j|hjhK@hjyubeh}(h]h ]h"]h$]h&]uh1jwhj+ubeh}(h]h ] kernelindentah"]h$]h&]uh1j)hjyhhhNhNubh)}(h**Description**h]j4)}(hj$h]h Description}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1j3hj"ubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKDhjyhhubh)}(hXAn auxiliary_device represents a part of its parent device's functionality. It is given a name that, combined with the registering drivers KBUILD_MODNAME, creates a match_name that is used for driver binding, and an id that combined with the match_name provide a unique name to register with the bus subsystem. For example, a driver registering an auxiliary device is named 'foo_mod.ko' and the subdevice is named 'foo_dev'. The match name is therefore 'foo_mod.foo_dev'.h]hXAn auxiliary_device represents a part of its parent device’s functionality. It is given a name that, combined with the registering drivers KBUILD_MODNAME, creates a match_name that is used for driver binding, and an id that combined with the match_name provide a unique name to register with the bus subsystem. For example, a driver registering an auxiliary device is named ‘foo_mod.ko’ and the subdevice is named ‘foo_dev’. The match name is therefore ‘foo_mod.foo_dev’.}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKBhjyhhubh)}(h8Registering an auxiliary_device is a three-step process.h]h8Registering an auxiliary_device is a three-step process.}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKJhjyhhubh)}(hFirst, a 'struct auxiliary_device' needs to be defined or allocated for each sub-device desired. The name, id, dev.release, and dev.parent fields of this structure must be filled in as follows.h]hFirst, a ‘struct auxiliary_device’ needs to be defined or allocated for each sub-device desired. The name, id, dev.release, and dev.parent fields of this structure must be filled in as follows.}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKLhjyhhubh)}(hXThe 'name' field is to be given a name that is recognized by the auxiliary driver. If two auxiliary_devices with the same match_name, eg "foo_mod.foo_dev", are registered onto the bus, they must have unique id values (e.g. "x" and "y") so that the registered devices names are "foo_mod.foo_dev.x" and "foo_mod.foo_dev.y". If match_name + id are not unique, then the device_add fails and generates an error message.h]hXThe ‘name’ field is to be given a name that is recognized by the auxiliary driver. If two auxiliary_devices with the same match_name, eg “foo_mod.foo_dev”, are registered onto the bus, they must have unique id values (e.g. “x” and “y”) so that the registered devices names are “foo_mod.foo_dev.x” and “foo_mod.foo_dev.y”. If match_name + id are not unique, then the device_add fails and generates an error message.}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKPhjyhhubh)}(hXzThe auxiliary_device.dev.type.release or auxiliary_device.dev.release must be populated with a non-NULL pointer to successfully register the auxiliary_device. This release call is where resources associated with the auxiliary device must be free'ed. Because once the device is placed on the bus the parent driver can not tell what other code may have a reference to this data.h]hX|The auxiliary_device.dev.type.release or auxiliary_device.dev.release must be populated with a non-NULL pointer to successfully register the auxiliary_device. This release call is where resources associated with the auxiliary device must be free’ed. Because once the device is placed on the bus the parent driver can not tell what other code may have a reference to this data.}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKWhjyhhubh)}(h\The auxiliary_device.dev.parent should be set. Typically to the registering drivers device.h]h\The auxiliary_device.dev.parent should be set. Typically to the registering drivers device.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhK^hjyhhubh)}(hSecond, call auxiliary_device_init(), which checks several aspects of the auxiliary_device struct and performs a device_initialize(). After this step completes, any error state must have a call to auxiliary_device_uninit() in its resolution path.h]hSecond, call auxiliary_device_init(), which checks several aspects of the auxiliary_device struct and performs a device_initialize(). After this step completes, any error state must have a call to auxiliary_device_uninit() in its resolution path.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKahjyhhubh)}(hThe third and final step in registering an auxiliary_device is to perform a call to auxiliary_device_add(), which sets the name of the device and adds the device to the bus.h]hThe third and final step in registering an auxiliary_device is to perform a call to auxiliary_device_add(), which sets the name of the device and adds the device to the bus.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKfhjyhhubjO)}(hX#define MY_DEVICE_NAME "foo_dev" ... struct auxiliary_device *my_aux_dev = my_aux_dev_alloc(xxx); // Step 1: my_aux_dev->name = MY_DEVICE_NAME; my_aux_dev->id = my_unique_id_alloc(xxx); my_aux_dev->dev.release = my_aux_dev_release; my_aux_dev->dev.parent = my_dev; // Step 2: if (auxiliary_device_init(my_aux_dev)) goto fail; // Step 3: if (auxiliary_device_add(my_aux_dev)) { auxiliary_device_uninit(my_aux_dev); goto fail; } ...h]hX#define MY_DEVICE_NAME "foo_dev" ... struct auxiliary_device *my_aux_dev = my_aux_dev_alloc(xxx); // Step 1: my_aux_dev->name = MY_DEVICE_NAME; my_aux_dev->id = my_unique_id_alloc(xxx); my_aux_dev->dev.release = my_aux_dev_release; my_aux_dev->dev.parent = my_dev; // Step 2: if (auxiliary_device_init(my_aux_dev)) goto fail; // Step 3: if (auxiliary_device_add(my_aux_dev)) { auxiliary_device_uninit(my_aux_dev); goto fail; } ...}hjsbah}(h]h ]h"]h$]h&]hhforcelanguagejhighlight_args}uh1jNhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKjhjyhhubh)}(hUnregistering an auxiliary_device is a two-step process to mirror the register process. First call auxiliary_device_delete(), then call auxiliary_device_uninit().h]hUnregistering an auxiliary_device is a two-step process to mirror the register process. First call auxiliary_device_delete(), then call auxiliary_device_uninit().}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKhjyhhubjO)}(hYauxiliary_device_delete(my_dev->my_aux_dev); auxiliary_device_uninit(my_dev->my_aux_dev);h]hYauxiliary_device_delete(my_dev->my_aux_dev); auxiliary_device_uninit(my_dev->my_aux_dev);}hjsbah}(h]h ]h"]h$]h&]hhjjjj}uh1jNhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKhjyhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j"auxiliary_device_init (C function)c.auxiliary_device_inithNtauh1jhjyhhhNhNubj)}(hhh](j)}(h;int auxiliary_device_init (struct auxiliary_device *auxdev)h]j)}(h:int auxiliary_device_init(struct auxiliary_device *auxdev)h](hdesc_sig_keyword_type)}(hinth]hint}(hjhhhNhNubah}(h]h ]ktah"]h$]h&]uh1jhjhhha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chMubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhMubj)}(hauxiliary_device_inith]j)}(hauxiliary_device_inith]hauxiliary_device_init}(hj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]hhuh1jhjhhhjhMubhdesc_parameterlist)}(h!(struct auxiliary_device *auxdev)h]hdesc_parameter)}(hstruct auxiliary_device *auxdevh](j)}(hjh]hstruct}(hjAhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj=ubj)}(h h]h }(hjNhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj=ubh)}(hhh]j)}(hauxiliary_deviceh]hauxiliary_device}(hj_hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj\ubah}(h]h ]h"]h$]h&] refdomainjreftype identifier reftargetjamodnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data]jz ASTIdentifier)}juj#sbc.auxiliary_device_initasbuh1hhj=ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj=ubhdesc_sig_punctuation)}(h*h]h*}(hjhhhNhNubah}(h]h ]pah"]h$]h&]uh1jhj=ubj)}(hauxdevh]hauxdev}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj=ubeh}(h]h ]h"]h$]h&]noemphhhuh1j;hj7ubah}(h]h ]h"]h$]h&]hhuh1j5hjhhhjhMubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjhhhjhMubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhjhMhjhhubj)}(hhh]h)}(h%check auxiliary_device and initializeh]h%check auxiliary_device and initialize}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chM hjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhMubeh}(h]h ](jfunctioneh"]h$]h&]j#jj$jj%jj&j'j(uh1jhhhjyhNhNubj*)}(hX**Parameters** ``struct auxiliary_device *auxdev`` auxiliary device struct **Description** This is the second step in the three-step process to register an auxiliary_device. When this function returns an error code, then the device_initialize will *not* have been performed, and the caller will be responsible to free any memory allocated for the auxiliary_device in the error path directly. It returns 0 on success. On success, the device_initialize has been performed. After this point any error unwinding will need to include a call to auxiliary_device_uninit(). In this post-initialize error scenario, a call to the device's .release callback will be triggered, and all memory clean-up is expected to be handled there.h](h)}(h**Parameters**h]j4)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j3hjubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chMhjubjx)}(hhh]j})}(h<``struct auxiliary_device *auxdev`` auxiliary device struct h](j)}(h#``struct auxiliary_device *auxdev``h]j)}(hjh]hstruct auxiliary_device *auxdev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chM hj ubj)}(hhh]h)}(hauxiliary device structh]hauxiliary device struct}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj&hM hj'ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j|hj&hM hjubah}(h]h ]h"]h$]h&]uh1jwhjubh)}(h**Description**h]j4)}(hjLh]h Description}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1j3hjJubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chMhjubh)}(hRThis is the second step in the three-step process to register an auxiliary_device.h]hRThis is the second step in the three-step process to register an auxiliary_device.}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chMhjubh)}(hWhen this function returns an error code, then the device_initialize will *not* have been performed, and the caller will be responsible to free any memory allocated for the auxiliary_device in the error path directly.h](hJWhen this function returns an error code, then the device_initialize will }(hjqhhhNhNubhemphasis)}(h*not*h]hnot}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1jyhjqubh have been performed, and the caller will be responsible to free any memory allocated for the auxiliary_device in the error path directly.}(hjqhhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chMhjubh)}(hXMIt returns 0 on success. On success, the device_initialize has been performed. After this point any error unwinding will need to include a call to auxiliary_device_uninit(). In this post-initialize error scenario, a call to the device's .release callback will be triggered, and all memory clean-up is expected to be handled there.h]hXOIt returns 0 on success. On success, the device_initialize has been performed. After this point any error unwinding will need to include a call to auxiliary_device_uninit(). In this post-initialize error scenario, a call to the device’s .release callback will be triggered, and all memory clean-up is expected to be handled there.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chMhjubeh}(h]h ] kernelindentah"]h$]h&]uh1j)hjyhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j#__auxiliary_device_add (C function)c.__auxiliary_device_addhNtauh1jhjyhhhNhNubj)}(hhh](j)}(hQint __auxiliary_device_add (struct auxiliary_device *auxdev, const char *modname)h]j)}(hPint __auxiliary_device_add(struct auxiliary_device *auxdev, const char *modname)h](j)}(hinth]hint}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjhhha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chMDubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhMDubj)}(h__auxiliary_device_addh]j)}(h__auxiliary_device_addh]h__auxiliary_device_add}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]hhuh1jhjhhhjhMDubj6)}(h6(struct auxiliary_device *auxdev, const char *modname)h](j<)}(hstruct auxiliary_device *auxdevh](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(hauxiliary_deviceh]hauxiliary_device}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypeju reftargetj modnameN classnameNjyj|)}j]j)}jujsbc.__auxiliary_device_addasbuh1hhjubj)}(h h]h }(hj>hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]h*}(hjLhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hauxdevh]hauxdev}(hjYhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1j;hjubj<)}(hconst char *modnameh](j)}(hconsth]hconst}(hjrhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjnubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjnubj)}(hcharh]hchar}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjnubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjnubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjnubj)}(hmodnameh]hmodname}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjnubeh}(h]h ]h"]h$]h&]noemphhhuh1j;hjubeh}(h]h ]h"]h$]h&]hhuh1j5hjhhhjhMDubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjhhhjhMDubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhjhMDhjhhubj)}(hhh]h)}(hadd an auxiliary bus deviceh]hadd an auxiliary bus device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chM2hjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhMDubeh}(h]h ](jfunctioneh"]h$]h&]j#jj$jj%jj&j'j(uh1jhhhjyhNhNubj*)}(hXF**Parameters** ``struct auxiliary_device *auxdev`` auxiliary bus device to add to the bus ``const char *modname`` name of the parent device's driver module **Description** This is the third step in the three-step process to register an auxiliary_device. This function must be called after a successful call to auxiliary_device_init(), which will perform the device_initialize. This means that if this returns an error code, then a call to auxiliary_device_uninit() must be performed so that the .release callback will be triggered to free the memory associated with the auxiliary_device. The expectation is that users will call the "auxiliary_device_add" macro so that the caller's KBUILD_MODNAME is automatically inserted for the modname parameter. Only if a user requires a custom name would this version be called directly.h](h)}(h**Parameters**h]j4)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j3hjubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chM6hjubjx)}(hhh](j})}(hK``struct auxiliary_device *auxdev`` auxiliary bus device to add to the bus h](j)}(h#``struct auxiliary_device *auxdev``h]j)}(hj"h]hstruct auxiliary_device *auxdev}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chM3hjubj)}(hhh]h)}(h&auxiliary bus device to add to the bush]h&auxiliary bus device to add to the bus}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7hM3hj8ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j|hj7hM3hjubj})}(hB``const char *modname`` name of the parent device's driver module h](j)}(h``const char *modname``h]j)}(hj[h]hconst char *modname}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjYubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chM4hjUubj)}(hhh]h)}(h)name of the parent device's driver moduleh]h+name of the parent device’s driver module}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhjphM4hjqubah}(h]h ]h"]h$]h&]uh1jhjUubeh}(h]h ]h"]h$]h&]uh1j|hjphM4hjubeh}(h]h ]h"]h$]h&]uh1jwhjubh)}(h**Description**h]j4)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j3hjubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chM6hjubh)}(hQThis is the third step in the three-step process to register an auxiliary_device.h]hQThis is the third step in the three-step process to register an auxiliary_device.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chM6hjubh)}(hXNThis function must be called after a successful call to auxiliary_device_init(), which will perform the device_initialize. This means that if this returns an error code, then a call to auxiliary_device_uninit() must be performed so that the .release callback will be triggered to free the memory associated with the auxiliary_device.h]hXNThis function must be called after a successful call to auxiliary_device_init(), which will perform the device_initialize. This means that if this returns an error code, then a call to auxiliary_device_uninit() must be performed so that the .release callback will be triggered to free the memory associated with the auxiliary_device.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chM9hjubh)}(hThe expectation is that users will call the "auxiliary_device_add" macro so that the caller's KBUILD_MODNAME is automatically inserted for the modname parameter. Only if a user requires a custom name would this version be called directly.h]hThe expectation is that users will call the “auxiliary_device_add” macro so that the caller’s KBUILD_MODNAME is automatically inserted for the modname parameter. Only if a user requires a custom name would this version be called directly.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chM?hjubeh}(h]h ] kernelindentah"]h$]h&]uh1j)hjyhhhNhNubh)}(hhh](h)}(h*Auxiliary Device Memory Model and Lifespanh]h*Auxiliary Device Memory Model and Lifespan}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hX#The registering driver is the entity that allocates memory for the auxiliary_device and registers it on the auxiliary bus. It is important to note that, as opposed to the platform bus, the registering driver is wholly responsible for the management of the memory used for the device object.h]hX#The registering driver is the entity that allocates memory for the auxiliary_device and registers it on the auxiliary bus. It is important to note that, as opposed to the platform bus, the registering driver is wholly responsible for the management of the memory used for the device object.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:31: ./include/linux/auxiliary_bus.hhKhjhhubh)}(hXqTo be clear the memory for the auxiliary_device is freed in the release() callback defined by the registering driver. The registering driver should only call auxiliary_device_delete() and then auxiliary_device_uninit() when it is done with the device. The release() function is then automatically called if and when other code releases their reference to the devices.h]hXqTo be clear the memory for the auxiliary_device is freed in the release() callback defined by the registering driver. The registering driver should only call auxiliary_device_delete() and then auxiliary_device_uninit() when it is done with the device. The release() function is then automatically called if and when other code releases their reference to the devices.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:31: ./include/linux/auxiliary_bus.hhKhjhhubh)}(hX,A parent object, defined in the shared header file, contains the auxiliary_device. It also contains a pointer to the shared object(s), which also is defined in the shared header. Both the parent object and the shared object(s) are allocated by the registering driver. This layout allows the auxiliary_driver's registering module to perform a container_of() call to go from the pointer to the auxiliary_device, that is passed during the call to the auxiliary_driver's probe function, up to the parent object, and then have access to the shared object(s).h]hX0A parent object, defined in the shared header file, contains the auxiliary_device. It also contains a pointer to the shared object(s), which also is defined in the shared header. Both the parent object and the shared object(s) are allocated by the registering driver. This layout allows the auxiliary_driver’s registering module to perform a container_of() call to go from the pointer to the auxiliary_device, that is passed during the call to the auxiliary_driver’s probe function, up to the parent object, and then have access to the shared object(s).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:31: ./include/linux/auxiliary_bus.hhKhjhhubh)}(hXThe memory for the shared object(s) must have a lifespan equal to, or greater than, the lifespan of the memory for the auxiliary_device. The auxiliary_driver should only consider that the shared object is valid as long as the auxiliary_device is still registered on the auxiliary bus. It is up to the registering driver to manage (e.g. free or keep available) the memory for the shared object beyond the life of the auxiliary_device.h]hXThe memory for the shared object(s) must have a lifespan equal to, or greater than, the lifespan of the memory for the auxiliary_device. The auxiliary_driver should only consider that the shared object is valid as long as the auxiliary_device is still registered on the auxiliary bus. It is up to the registering driver to manage (e.g. free or keep available) the memory for the shared object beyond the life of the auxiliary_device.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:31: ./include/linux/auxiliary_bus.hhK#hjhhubh)}(hXThe registering driver must unregister all auxiliary devices before its own driver.remove() is completed. An easy way to ensure this is to use the devm_add_action_or_reset() call to register a function against the parent device which unregisters the auxiliary device object(s).h]hXThe registering driver must unregister all auxiliary devices before its own driver.remove() is completed. An easy way to ensure this is to use the devm_add_action_or_reset() call to register a function against the parent device which unregisters the auxiliary device object(s).}(hj- hhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:31: ./include/linux/auxiliary_bus.hhK*hjhhubh)}(hFinally, any operations which operate on the auxiliary devices must continue to function (if only to return an error) after the registering driver unregisters the auxiliary device.h]hFinally, any operations which operate on the auxiliary devices must continue to function (if only to return an error) after the registering driver unregisters the auxiliary device.}(hj< hhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:31: ./include/linux/auxiliary_bus.hhK/hjhhubeh}(h]*auxiliary-device-memory-model-and-lifespanah ]h"]*auxiliary device memory model and lifespanah$]h&]uh1hhjyhhhhhKubeh}(h]auxiliary-device-creationah ]h"]auxiliary device creationah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hAuxiliary Driversh]hAuxiliary Drivers}(hj^ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj[ hhhhhK$ubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jauxiliary_driver (C struct)c.auxiliary_driverhNtauh1jhj[ hhhNhNubj)}(hhh](j)}(hauxiliary_driverh]j)}(hstruct auxiliary_driverh](j)}(hjh]hstruct}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhj hKubj)}(hauxiliary_driverh]j)}(hj h]hauxiliary_driver}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ](jjeh"]h$]h&]hhuh1jhj hhhj hKubeh}(h]h ]h"]h$]h&]hhjuh1jjjhj} hhhj hKubah}(h]jx ah ](jjeh"]h$]h&]jj)jhuh1jhj hKhjz hhubj)}(hhh]h)}(h%Definition of an auxiliary bus driverh]h%Definition of an auxiliary bus driver}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhj hhubah}(h]h ]h"]h$]h&]uh1jhjz hhhj hKubeh}(h]h ](jstructeh"]h$]h&]j#jj$j j%j j&j'j(uh1jhhhj[ hNhNubj*)}(hX**Definition**:: struct auxiliary_driver { int (*probe)(struct auxiliary_device *auxdev, const struct auxiliary_device_id *id); void (*remove)(struct auxiliary_device *auxdev); void (*shutdown)(struct auxiliary_device *auxdev); int (*suspend)(struct auxiliary_device *auxdev, pm_message_t state); int (*resume)(struct auxiliary_device *auxdev); const char *name; struct device_driver driver; const struct auxiliary_device_id *id_table; }; **Members** ``probe`` Called when a matching device is added to the bus. ``remove`` Called when device is removed from the bus. ``shutdown`` Called at shut-down time to quiesce the device. ``suspend`` Called to put the device to sleep mode. Usually to a power state. ``resume`` Called to bring a device from sleep mode. ``name`` Driver name. ``driver`` Core driver structure. ``id_table`` Table of devices this driver should match on the bus.h](h)}(h**Definition**::h](j4)}(h**Definition**h]h Definition}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j3hj ubh:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhj ubjO)}(hXstruct auxiliary_driver { int (*probe)(struct auxiliary_device *auxdev, const struct auxiliary_device_id *id); void (*remove)(struct auxiliary_device *auxdev); void (*shutdown)(struct auxiliary_device *auxdev); int (*suspend)(struct auxiliary_device *auxdev, pm_message_t state); int (*resume)(struct auxiliary_device *auxdev); const char *name; struct device_driver driver; const struct auxiliary_device_id *id_table; };h]hXstruct auxiliary_driver { int (*probe)(struct auxiliary_device *auxdev, const struct auxiliary_device_id *id); void (*remove)(struct auxiliary_device *auxdev); void (*shutdown)(struct auxiliary_device *auxdev); int (*suspend)(struct auxiliary_device *auxdev, pm_message_t state); int (*resume)(struct auxiliary_device *auxdev); const char *name; struct device_driver driver; const struct auxiliary_device_id *id_table; };}hj sbah}(h]h ]h"]h$]h&]hhuh1jNhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhj ubh)}(h **Members**h]j4)}(hj h]hMembers}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j3hj ubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhj ubjx)}(hhh](j})}(h=``probe`` Called when a matching device is added to the bus. h](j)}(h ``probe``h]j)}(hj4 h]hprobe}(hj6 hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj2 ubah}(h]h ]h"]h$]h&]uh1jhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhj. ubj)}(hhh]h)}(h2Called when a matching device is added to the bus.h]h2Called when a matching device is added to the bus.}(hjM hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjI hKhjJ ubah}(h]h ]h"]h$]h&]uh1jhj. ubeh}(h]h ]h"]h$]h&]uh1j|hjI hKhj+ ubj})}(h7``remove`` Called when device is removed from the bus. h](j)}(h ``remove``h]j)}(hjm h]hremove}(hjo hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjk ubah}(h]h ]h"]h$]h&]uh1jhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhjg ubj)}(hhh]h)}(h+Called when device is removed from the bus.h]h+Called when device is removed from the bus.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKhj ubah}(h]h ]h"]h$]h&]uh1jhjg ubeh}(h]h ]h"]h$]h&]uh1j|hj hKhj+ ubj})}(h=``shutdown`` Called at shut-down time to quiesce the device. h](j)}(h ``shutdown``h]j)}(hj h]hshutdown}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhj ubj)}(hhh]h)}(h/Called at shut-down time to quiesce the device.h]h/Called at shut-down time to quiesce the device.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j|hj hKhj+ ubj})}(hN``suspend`` Called to put the device to sleep mode. Usually to a power state. h](j)}(h ``suspend``h]j)}(hj h]hsuspend}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhj ubj)}(hhh]h)}(hACalled to put the device to sleep mode. Usually to a power state.h]hACalled to put the device to sleep mode. Usually to a power state.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j|hj hKhj+ ubj})}(h5``resume`` Called to bring a device from sleep mode. h](j)}(h ``resume``h]j)}(hj h]hresume}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhj ubj)}(hhh]h)}(h)Called to bring a device from sleep mode.h]h)Called to bring a device from sleep mode.}(hj1 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj- hKhj. ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j|hj- hKhj+ ubj})}(h``name`` Driver name. h](j)}(h``name``h]j)}(hjQ h]hname}(hjS hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjO ubah}(h]h ]h"]h$]h&]uh1jhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhjK ubj)}(hhh]h)}(h Driver name.h]h Driver name.}(hjj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjf hKhjg ubah}(h]h ]h"]h$]h&]uh1jhjK ubeh}(h]h ]h"]h$]h&]uh1j|hjf hKhj+ ubj})}(h"``driver`` Core driver structure. h](j)}(h ``driver``h]j)}(hj h]hdriver}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhj ubj)}(hhh]h)}(hCore driver structure.h]hCore driver structure.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j|hj hKhj+ ubj})}(hB``id_table`` Table of devices this driver should match on the bus.h](j)}(h ``id_table``h]j)}(hj h]hid_table}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhj ubj)}(hhh]h)}(h5Table of devices this driver should match on the bus.h]h5Table of devices this driver should match on the bus.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j|hj hKhj+ ubeh}(h]h ]h"]h$]h&]uh1jwhj ubeh}(h]h ] kernelindentah"]h$]h&]uh1j)hj[ hhhNhNubh)}(h**Description**h]j4)}(hj h]h Description}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j3hj ubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhj[ hhubh)}(hAuxiliary drivers follow the standard driver model convention, where discovery/enumeration is handled by the core, and drivers provide probe() and remove() methods. They support power management and shutdown notifications using the standard conventions.h]hAuxiliary drivers follow the standard driver model convention, where discovery/enumeration is handled by the core, and drivers provide probe() and remove() methods. They support power management and shutdown notifications using the standard conventions.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhj[ hhubh)}(hAuxiliary drivers register themselves with the bus by calling auxiliary_driver_register(). The id_table contains the match_names of auxiliary devices that a driver can bind with.h]hAuxiliary drivers register themselves with the bus by calling auxiliary_driver_register(). The id_table contains the match_names of auxiliary devices that a driver can bind with.}(hj+ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhj[ hhubjO)}(hXdstatic const struct auxiliary_device_id my_auxiliary_id_table[] = { { .name = "foo_mod.foo_dev" }, {}, }; MODULE_DEVICE_TABLE(auxiliary, my_auxiliary_id_table); struct auxiliary_driver my_drv = { .name = "myauxiliarydrv", .id_table = my_auxiliary_id_table, .probe = my_drv_probe, .remove = my_drv_remove };h]hXdstatic const struct auxiliary_device_id my_auxiliary_id_table[] = { { .name = "foo_mod.foo_dev" }, {}, }; MODULE_DEVICE_TABLE(auxiliary, my_auxiliary_id_table); struct auxiliary_driver my_drv = { .name = "myauxiliarydrv", .id_table = my_auxiliary_id_table, .probe = my_drv_probe, .remove = my_drv_remove };}hj: sbah}(h]h ]h"]h$]h&]hhjjjj}uh1jNhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhj[ hhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j!module_auxiliary_driver (C macro)c.module_auxiliary_driverhNtauh1jhj[ hhhNhNubj)}(hhh](j)}(hmodule_auxiliary_driverh]j)}(hmodule_auxiliary_driverh]j)}(hmodule_auxiliary_driverh]j)}(hj] h]hmodule_auxiliary_driver}(hjg hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjc ubah}(h]h ](jjeh"]h$]h&]hhuh1jhj_ hhhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhM ubah}(h]h ]h"]h$]h&]hhjuh1jjjhj[ hhhjz hM ubah}(h]jV ah ](jjeh"]h$]h&]jj)jhuh1jhjz hM hjX hhubj)}(hhh]h}(h]h ]h"]h$]h&]uh1jhjX hhhjz hM ubeh}(h]h ](jmacroeh"]h$]h&]j#jj$j j%j j&j'j(uh1jhhhj[ hNhNubh)}(h0``module_auxiliary_driver (__auxiliary_driver)``h]j)}(hj h]h,module_auxiliary_driver (__auxiliary_driver)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhMhj[ hhubh block_quote)}(h1Helper macro for registering an auxiliary driver h]h)}(h0Helper macro for registering an auxiliary driverh]h0Helper macro for registering an auxiliary driver}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhMhj ubah}(h]h ]h"]h$]h&]uh1j hj hMhj[ hhubj*)}(hXm**Parameters** ``__auxiliary_driver`` auxiliary driver struct **Description** Helper macro for auxiliary drivers which do not do anything special in module init/exit. This eliminates a lot of boilerplate. Each module may only use this macro once, and calling it replaces module_init() and module_exit() .. code-block:: c module_auxiliary_driver(my_drv);h](h)}(h**Parameters**h]j4)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j3hj ubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhMhj ubjx)}(hhh]j})}(h/``__auxiliary_driver`` auxiliary driver struct h](j)}(h``__auxiliary_driver``h]j)}(hj h]h__auxiliary_driver}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhMhj ubj)}(hhh]h)}(hauxiliary driver structh]hauxiliary driver struct}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j|hj hMhj ubah}(h]h ]h"]h$]h&]uh1jwhj ubh)}(h**Description**h]j4])}(hj* h]h Description}(hj, hhhNhNubah}(h]h ]h"]h$]h&]uh1j3hj( ubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhMhj ubh)}(hHelper macro for auxiliary drivers which do not do anything special in module init/exit. This eliminates a lot of boilerplate. Each module may only use this macro once, and calling it replaces module_init() and module_exit()h]hHelper macro for auxiliary drivers which do not do anything special in module init/exit. This eliminates a lot of boilerplate. Each module may only use this macro once, and calling it replaces module_init() and module_exit()}(hj@ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhMhj ubjO)}(h module_auxiliary_driver(my_drv);h]h module_auxiliary_driver(my_drv);}hjO sbah}(h]h ]h"]h$]h&]hhjjjj}uh1jNhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhM hj ubeh}(h]h ] kernelindentah"]h$]h&]uh1j)hj[ hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j(__auxiliary_driver_register (C function)c.__auxiliary_driver_registerhNtauh1jhj[ hhhNhNubj)}(hhh](j)}(hlint __auxiliary_driver_register (struct auxiliary_driver *auxdrv, struct module *owner, const char *modname)h]j)}(hkint __auxiliary_driver_register(struct auxiliary_driver *auxdrv, struct module *owner, const char *modname)h](j)}(hinth]hint}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj{ hhha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chMgubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj{ hhhj hMgubj)}(h__auxiliary_driver_registerh]j)}(h__auxiliary_driver_registerh]h__auxiliary_driver_register}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ](jjeh"]h$]h&]hhuh1jhj{ hhhj hMgubj6)}(hL(struct auxiliary_driver *auxdrv, struct module *owner, const char *modname)h](j<)}(hstruct auxiliary_driver *auxdrvh](j)}(hjh]hstruct}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubh)}(hhh]j)}(hauxiliary_driverh]hauxiliary_driver}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&] refdomainjreftypeju reftargetj modnameN classnameNjyj|)}j]j)}juj sbc.__auxiliary_driver_registerasbuh1hhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hauxdrvh]hauxdrv}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphhhuh1j;hj ubj<)}(hstruct module *ownerh](j)}(hjh]hstruct}(hj.hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*ubj)}(h h]h }(hj;hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*ubh)}(hhh]j)}(hmoduleh]hmodule}(hjLhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjIubah}(h]h ]h"]h$]h&] refdomainjreftypeju reftargetjNmodnameN classnameNjyj|)}j]j c.__auxiliary_driver_registerasbuh1hhj*ubj)}(h h]h }(hjjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*ubj)}(hjh]h*}(hjxhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*ubj)}(hownerh]howner}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj*ubeh}(h]h ]h"]h$]h&]noemphhhuh1j;hj ubj<)}(hconst char *modnameh](j)}(hjth]hconst}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hcharh]hchar}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hmodnameh]hmodname}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1j;hj ubeh}(h]h ]h"]h$]h&]hhuh1j5hj{ hhhj hMgubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjw hhhj hMgubah}(h]jr ah ](jjeh"]h$]h&]jj)jhuh1jhj hMghjt hhubj)}(hhh]h)}(h+register a driver for auxiliary bus devicesh]h+register a driver for auxiliary bus devices}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chM]hj hhubah}(h]h ]h"]h$]h&]uh1jhjt hhhj hMgubeh}(h]h ](jfunctioneh"]h$]h&]j#jj$j$j%j$j&j'j(uh1jhhhj[ hNhNubj*)}(hX**Parameters** ``struct auxiliary_driver *auxdrv`` auxiliary_driver structure ``struct module *owner`` owning module/driver ``const char *modname`` KBUILD_MODNAME for parent driver **Description** The expectation is that users will call the "auxiliary_driver_register" macro so that the caller's KBUILD_MODNAME is automatically inserted for the modname parameter. Only if a user requires a custom name would this version be called directly.h](h)}(h**Parameters**h]j4)}(hj.h]h Parameters}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1j3hj,ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chMahj(ubjx)}(hhh](j})}(h?``struct auxiliary_driver *auxdrv`` auxiliary_driver structure h](j)}(h#``struct auxiliary_driver *auxdrv``h]j)}(hjMh]hstruct auxiliary_driver *auxdrv}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjKubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chM^hjGubj)}(hhh]h)}(hauxiliary_driver structureh]hauxiliary_driver structure}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjbhM^hjcubah}(h]h ]h"]h$]h&]uh1jhjGubeh}(h]h ]h"]h$]h&]uh1j|hjbhM^hjDubj})}(h.``struct module *owner`` owning module/driver h](j)}(h``struct module *owner``h]j)}(hjh]hstruct module *owner}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chM_hjubj)}(hhh]h)}(howning module/driverh]howning module/driver}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM_hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j|hjhM_hjDubj})}(h9``const char *modname`` KBUILD_MODNAME for parent driver h](j)}(h``const char *modname``h]j)}(hjh]hconst char *modname}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chM`hjubj)}(hhh]h)}(h KBUILD_MODNAME for parent driverh]h KBUILD_MODNAME for parent driver}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM`hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j|hjhM`hjDubeh}(h]h ]h"]h$]h&]uh1jwhj(ubh)}(h**Description**h]j4)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j3hjubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chMbhj(ubh)}(hThe expectation is that users will call the "auxiliary_driver_register" macro so that the caller's KBUILD_MODNAME is automatically inserted for the modname parameter. Only if a user requires a custom name would this version be called directly.h]hThe expectation is that users will call the “auxiliary_driver_register” macro so that the caller’s KBUILD_MODNAME is automatically inserted for the modname parameter. Only if a user requires a custom name would this version be called directly.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chMbhj(ubeh}(h]h ] kernelindentah"]h$]h&]uh1j)hj[ hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j(auxiliary_driver_unregister (C function)c.auxiliary_driver_unregisterhNtauh1jhj[ hhhNhNubj)}(hhh](j)}(hBvoid auxiliary_driver_unregister (struct auxiliary_driver *auxdrv)h]j)}(hAvoid auxiliary_driver_unregister(struct auxiliary_driver *auxdrv)h](j)}(hvoidh]hvoid}(hj?hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj;hhha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chMubj)}(h h]h }(hjNhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj;hhhjMhMubj)}(hauxiliary_driver_unregisterh]j)}(hauxiliary_driver_unregisterh]hauxiliary_driver_unregister}(hj`hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj\ubah}(h]h ](jjeh"]h$]h&]hhuh1jhj;hhhjMhMubj6)}(h!(struct auxiliary_driver *auxdrv)h]j<)}(hstruct auxiliary_driver *auxdrvh](j)}(hjh]hstruct}(hj|hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjxubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjxubh)}(hhh]j)}(hauxiliary_driverh]hauxiliary_driver}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypeju reftargetjmodnameN classnameNjyj|)}j]j)}jujbsbc.auxiliary_driver_unregisterasbuh1hhjxubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjxubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjxubj)}(hauxdrvh]hauxdrv}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjxubeh}(h]h ]h"]h$]h&]noemphhhuh1j;hjtubah}(h]h ]h"]h$]h&]hhuh1j5hj;hhhjMhMubeh}(h]h ]h"]h$]h&]hhjuh1jjjhj7hhhjMhMubah}(h]j2ah ](jjeh"]h$]h&]jj)jhuh1jhjMhMhj4hhubj)}(hhh]h)}(hunregister a driverh]hunregister a driver}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chMhjhhubah}(h]h ]h"]h$]h&]uh1jhj4hhhjMhMubeh}(h]h ](jfunctioneh"]h$]h&]j#jj$jj%jj&j'j(uh1jhhhj[ hNhNubj*)}(hP**Parameters** ``struct auxiliary_driver *auxdrv`` auxiliary_driver structureh](h)}(h**Parameters**h]j4)}(hj!h]h Parameters}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1j3hjubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chMhjubjx)}(hhh]j})}(h>``struct auxiliary_driver *auxdrv`` auxiliary_driver structureh](j)}(h#``struct auxiliary_driver *auxdrv``h]j)}(hj@h]hstruct auxiliary_driver *auxdrv}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj>ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chMhj:ubj)}(hhh]h)}(hauxiliary_driver structureh]hauxiliary_driver structure}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chMhjVubah}(h]h ]h"]h$]h&]uh1jhj:ubeh}(h]h ]h"]h$]h&]uh1j|hjUhMhj7ubah}(h]h ]h"]h$]h&]uh1jwhjubeh}(h]h ] kernelindentah"]h$]h&]uh1j)hj[ hhhNhNubeh}(h]auxiliary-driversah ]h"]auxiliary driversah$]h&]uh1hhhhhhhhK$ubh)}(hhh](h)}(h Example Usageh]h Example Usage}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK-ubh)}(hXAuxiliary devices are created and registered by a subsystem-level core device that needs to break up its functionality into smaller fragments. One way to extend the scope of an auxiliary_device is to encapsulate it within a domain-specific structure defined by the parent device. This structure contains the auxiliary_device and any associated shared data/callbacks needed to establish the connection with the parent.h]hXAuxiliary devices are created and registered by a subsystem-level core device that needs to break up its functionality into smaller fragments. One way to extend the scope of an auxiliary_device is to encapsulate it within a domain-specific structure defined by the parent device. This structure contains the auxiliary_device and any associated shared data/callbacks needed to establish the connection with the parent.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:47: ./drivers/base/auxiliary.chKZhjhhubh)}(hAn example is:h]hAn example is:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:47: ./drivers/base/auxiliary.chKahjhhubjO)}(h struct foo { struct auxiliary_device auxdev; void (*connect)(struct auxiliary_device *auxdev); void (*disconnect)(struct auxiliary_device *auxdev); void *data; };h]h struct foo { struct auxiliary_device auxdev; void (*connect)(struct auxiliary_device *auxdev); void (*disconnect)(struct auxiliary_device *auxdev); void *data; };}hjsbah}(h]h ]h"]h$]h&]hhjjjj}uh1jNha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:47: ./drivers/base/auxiliary.chKchjhhubh)}(hXjThe parent device then registers the auxiliary_device by calling auxiliary_device_init(), and then auxiliary_device_add(), with the pointer to the auxdev member of the above structure. The parent provides a name for the auxiliary_device that, combined with the parent's KBUILD_MODNAME, creates a match_name that is be used for matching and binding with a driver.h]hXlThe parent device then registers the auxiliary_device by calling auxiliary_device_init(), and then auxiliary_device_add(), with the pointer to the auxdev member of the above structure. The parent provides a name for the auxiliary_device that, combined with the parent’s KBUILD_MODNAME, creates a match_name that is be used for matching and binding with a driver.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:47: ./drivers/base/auxiliary.chKlhjhhubh)}(hX7Whenever an auxiliary_driver is registered, based on the match_name, the auxiliary_driver's probe() is invoked for the matching devices. The auxiliary_driver can also be encapsulated inside custom drivers that make the core device's functionality extensible by adding additional domain-specific ops as follows:h]hX;Whenever an auxiliary_driver is registered, based on the match_name, the auxiliary_driver’s probe() is invoked for the matching devices. The auxiliary_driver can also be encapsulated inside custom drivers that make the core device’s functionality extensible by adding additional domain-specific ops as follows:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:47: ./drivers/base/auxiliary.chKrhjhhubjO)}(hstruct my_ops { void (*send)(struct auxiliary_device *auxdev); void (*receive)(struct auxiliary_device *auxdev); }; struct my_driver { struct auxiliary_driver auxiliary_drv; const struct my_ops ops; };h]hstruct my_ops { void (*send)(struct auxiliary_device *auxdev); void (*receive)(struct auxiliary_device *auxdev); }; struct my_driver { struct auxiliary_driver auxiliary_drv; const struct my_ops ops; };}hjsbah}(h]h ]h"]h$]h&]hhjjjj}uh1jNha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:47: ./drivers/base/auxiliary.chKxhjhhubh)}(h$An example of this type of usage is:h]h$An example of this type of usage is:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:47: ./drivers/base/auxiliary.chKhjhhubjO)}(hXconst struct auxiliary_device_id my_auxiliary_id_table[] = { { .name = "foo_mod.foo_dev" }, { }, }; const struct my_ops my_custom_ops = { .send = my_tx, .receive = my_rx, }; const struct my_driver my_drv = { .auxiliary_drv = { .name = "myauxiliarydrv", .id_table = my_auxiliary_id_table, .probe = my_probe, .remove = my_remove, .shutdown = my_shutdown, }, .ops = my_custom_ops, };h]hXconst struct auxiliary_device_id my_auxiliary_id_table[] = { { .name = "foo_mod.foo_dev" }, { }, }; const struct my_ops my_custom_ops = { .send = my_tx, .receive = my_rx, }; const struct my_driver my_drv = { .auxiliary_drv = { .name = "myauxiliarydrv", .id_table = my_auxiliary_id_table, .probe = my_probe, .remove = my_remove, .shutdown = my_shutdown, }, .ops = my_custom_ops, };}hjsbah}(h]h ]h"]h$]h&]hhjjjj}uh1jNha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:47: ./drivers/base/auxiliary.chKhjhhubh)}(hXHPlease note that such custom ops approach is valid, but it is hard to implement it right without global locks per-device to protect from auxiliary_drv removal during call to that ops. In addition, this implementation lacks proper module dependency, which causes to load/unload races between auxiliary parent and devices modules.h]hXHPlease note that such custom ops approach is valid, but it is hard to implement it right without global locks per-device to protect from auxiliary_drv removal during call to that ops. In addition, this implementation lacks proper module dependency, which causes to load/unload races between auxiliary parent and devices modules.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:47: ./drivers/base/auxiliary.chKhjhhubh)}(hThe most easiest way to provide these ops reliably without needing to have a lock is to EXPORT_SYMBOL*() them and rely on already existing modules infrastructure for validity and correct dependencies chains.h]hThe most easiest way to provide these ops reliably without needing to have a lock is to EXPORT_SYMBOL*() them and rely on already existing modules infrastructure for validity and correct dependencies chains.}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:47: ./drivers/base/auxiliary.chKhjhhubeh}(h] example-usageah ]h"] example usageah$]h&]uh1hhhhhhhhK-ubeh}(h](hid1eh ]h"]( auxiliary bus auxiliary_buseh$]h&]uh1hhhhhhhhKexpect_referenced_by_name}jAhsexpect_referenced_by_id}hhsubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjkerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}h]hasnameids}(jAhj@j=jvjsjX jU jP jM jjj8j5u nametypes}(jAj@jvjX jP jj8uh}(hhj=hjsjjU jyjjjjjjjM jjj[ jx j} jV j[ jr jw j2j7j5ju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}jyKsRparse_messages]transform_messages]hsystem_message)}(hhh]h)}(hhh]h3Hyperlink target "auxiliary-bus" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1juba transformerN include_log] decorationNhhub.