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]hPortuguese (Brazilian)}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget,/translations/pt_BR/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.}(hj hhhNhNubah}(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}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj)hhhhhK 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.chK5hj)hhubh)}(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.}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:15: ./drivers/base/auxiliary.chKhjDubj)}(hhh]h)}(h4embedded struct which hold all sysfs related fields,h]h4embedded struct which hold all sysfs related fields,}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1hhj_hK>hj`ubah}(h]h ]h"]h$]h&]uh1jhjDubeh}(h]h ]h"]h$]h&]uh1jhj_hK>hjubj)}(hN``sysfs.irqs`` irqs xarray contains irq indices which are used by the device, h](j)}(h``sysfs.irqs``h]j)}(hjh]h sysfs.irqs}(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?hj}ubj)}(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&]uh1jhj}ubeh}(h]h ]h"]h$]h&]uh1jhjhK?hjubj)}(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&]uh1jhjhK@hjubj)}(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.hhKAhj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj hK@hjubeh}(h]h ]h"]h$]h&]uh1jhj?ubeh}(h]h ] kernelindentah"]h$]h&]uh1j=hjhhhNhNubh)}(h**Description**h]jH)}(hj8h]h Description}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jGhj6ubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKDhjhhubh)}(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’.}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKAhjhhubh)}(h8Registering an auxiliary_device is a three-step process.h]h8Registering an auxiliary_device is a three-step process.}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKIhjhhubh)}(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.}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKKhjhhubh)}(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.}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKOhjhhubh)}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKVhjhhubh)}(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]hjhhubh)}(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.hhK`hjhhubh)}(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.hhKehjhhubjc)}(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&]hhƌforcelanguagej2highlight_args}uh1jbhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKihjhhubh)}(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.hhKhjhhubjc)}(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&]hhjjj2j}uh1jbhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:22: ./include/linux/auxiliary_bus.hhKhjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j"auxiliary_device_init (C function)c.auxiliary_device_inithNtauh1jhjhhhNhNubj)}(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&]uh1jhj hhha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chMubj)}(h h]h }(hj#hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhj"hMubj)}(hauxiliary_device_inith]j)}(hauxiliary_device_inith]hauxiliary_device_init}(hj5hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj1ubah}(h]h ](jjeh"]h$]h&]hhuh1jhj hhhj"hMubhdesc_parameterlist)}(h!(struct auxiliary_device *auxdev)h]hdesc_parameter)}(hstruct auxiliary_device *auxdevh](j)}(hjh]hstruct}(hjUhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjQubj)}(h h]h }(hjbhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjQubh)}(hhh]j)}(hauxiliary_deviceh]hauxiliary_device}(hjshhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjpubah}(h]h ]h"]h$]h&] refdomainj2reftype identifier reftargetjumodnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data]j ASTIdentifier)}jj7sbc.auxiliary_device_initasbuh1hhjQubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjQubhdesc_sig_punctuation)}(h*h]h*}(hjhhhNhNubah}(h]h ]pah"]h$]h&]uh1jhjQubj)}(hauxdevh]hauxdev}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjQubeh}(h]h ]h"]h$]h&]noemphhhuh1jOhjKubah}(h]h ]h"]h$]h&]hhuh1jIhj hhhj"hMubeh}(h]h ]h"]h$]h&]hhjuh1jjj hj hhhj"hMubah}(h]jah ](j jeh"]h$]h&]jj)jhuh1jhj"hMhjhhubj)}(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.chMhjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhj"hMubeh}(h]h ](j2functioneh"]h$]h&]j7j2j8jj9jj:j;j<uh1jhhhjhNhNubj>)}(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]jH)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jGhjubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chMhjubj)}(hhh]j)}(h<``struct auxiliary_device *auxdev`` auxiliary device struct 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.chMhjubj)}(hhh]h)}(hauxiliary device structh]hauxiliary device struct}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj:hMhj;ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj:hMhjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(h**Description**h]jH)}(hj`h]h Description}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1jGhj^ubah}(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.}(hjvhhhNhNubah}(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 }(hjhhhNhNubhemphasis)}(h*not*h]hnot}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh have been performed, and the caller will be responsible to free any memory allocated for the auxiliary_device in the error path directly.}(hjhhhNhNubeh}(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.chM hjubeh}(h]h ] kernelindentah"]h$]h&]uh1j=hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j#__auxiliary_device_add (C function)c.__auxiliary_device_addhNtauh1jhjhhhNhNubj)}(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 ]jah"]h$]h&]uh1jhjhhha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chM)ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhM)ubj)}(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&]hhuh1jhjhhhjhM)ubjJ)}(h6(struct auxiliary_device *auxdev, const char *modname)h](jP)}(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}(hj2hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj/ubah}(h]h ]h"]h$]h&] refdomainj2reftypej reftargetj4modnameN classnameNjj)}j]j)}jjsbc.__auxiliary_device_addasbuh1hhjubj)}(h h]h }(hjRhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]h*}(hj`hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hauxdevh]hauxdev}(hjmhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jOhj ubjP)}(hconst char *modnameh](j)}(hconsth]hconst}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hcharh]hchar}(hjhhhNhNubah}(h]h ]jah"]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&]noemphhhuh1jOhj ubeh}(h]h ]h"]h$]h&]hhuh1jIhjhhhjhM)ubeh}(h]h ]h"]h$]h&]hhjuh1jjj hjhhhjhM)ubah}(h]jah ](j jeh"]h$]h&]jj)jhuh1jhjhM)hjhhubj)}(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.chM)hjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhM)ubeh}(h]h ](j2functioneh"]h$]h&]j7j2j8j j9j j:j;j<uh1jhhhjhNhNubj>)}(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]jH)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jGhjubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chM-hjubj)}(hhh](j)}(hK``struct auxiliary_device *auxdev`` auxiliary bus device to add to the bus h](j)}(h#``struct auxiliary_device *auxdev``h]j)}(hj6h]hstruct auxiliary_device *auxdev}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj4ubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chM*hj0ubj)}(hhh]h)}(h&auxiliary bus device to add to the bush]h&auxiliary bus device to add to the bus}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjKhM*hjLubah}(h]h ]h"]h$]h&]uh1jhj0ubeh}(h]h ]h"]h$]h&]uh1jhjKhM*hj-ubj)}(hB``const char *modname`` name of the parent device's driver module h](j)}(h``const char *modname``h]j)}(hjoh]hconst char *modname}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjmubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chM+hjiubj)}(hhh]h)}(h)name of the parent device's driver moduleh]h+name of the parent device’s driver module}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM+hjubah}(h]h ]h"]h$]h&]uh1jhjiubeh}(h]h ]h"]h$]h&]uh1jhjhM+hj-ubeh}(h]h ]h"]h$]h&]uh1jhjubh)}(h**Description**h]jH)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jGhjubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:25: ./drivers/base/auxiliary.chM-hjubh)}(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.chM,hjubh)}(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.chM/hjubh)}(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.chM5hjubeh}(h]h ] kernelindentah"]h$]h&]uh1j=hjhhhNhNubh)}(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.}(hj hhhNhNubah}(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.}(hj2 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).}(hjA 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.}(hjP 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&]uh1hhjhhhhhKubeh}(h]auxiliary-device-creationah ]h"]auxiliary device creationah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hAuxiliary Driversh]hAuxiliary Drivers}(hjr hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjo hhhhhK$ubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jauxiliary_driver (C struct)c.auxiliary_driverhNtauh1jhjo 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&]hhjuh1jjj hj hhhj hKubah}(h]j ah ](j jeh"]h$]h&]jj)jhuh1jhj hKhj 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&]uh1jhj hhhj hKubeh}(h]h ](j2structeh"]h$]h&]j7j2j8j j9j j:j;j<uh1jhhhjo 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](jH)}(h**Definition**h]h Definition}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jGhj 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 ubjc)}(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&]hhuh1jbhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhj ubh)}(h **Members**h]jH)}(hj) h]hMembers}(hj+ hhhNhNubah}(h]h ]h"]h$]h&]uh1jGhj' ubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhj ubj)}(hhh](j)}(h=``probe`` Called when a matching device is added to the bus. h](j)}(h ``probe``h]j)}(hjH h]hprobe}(hjJ hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjF ubah}(h]h ]h"]h$]h&]uh1jhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhjB ubj)}(hhh]h)}(h2Called when a matching device is added to the bus.h]h2Called when a matching device is added to the bus.}(hja hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj] hKhj^ ubah}(h]h ]h"]h$]h&]uh1jhjB ubeh}(h]h ]h"]h$]h&]uh1jhj] hKhj? ubj)}(h7``remove`` Called when device is removed from the bus. h](j)}(h ``remove``h]j)}(hj h]hremove}(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 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&]uh1jhj{ ubeh}(h]h ]h"]h$]h&]uh1jhj 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&]uh1jhj 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&]uh1jhj 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.}(hjE hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjA hKhjB ubah}(h]h ]h"]h$]h&]uh1jhj& ubeh}(h]h ]h"]h$]h&]uh1jhjA hKhj? ubj)}(h``name`` Driver name. h](j)}(h``name``h]j)}(hje h]hname}(hjg hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjc 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 Driver name.h]h Driver name.}(hj~ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjz hKhj{ ubah}(h]h ]h"]h$]h&]uh1jhj_ ubeh}(h]h ]h"]h$]h&]uh1jhjz 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&]uh1jhj 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&]uh1jhj hKhj? ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ] kernelindentah"]h$]h&]uh1j=hjo hhhNhNubh)}(h**Description**h]jH)}(hj h]h Description}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jGhj ubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhjo 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.}(hj0 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhjo 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.hhKhjo hhubjc)}(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 };}hjN sbah}(h]h ]h"]h$]h&]hhjjj2j}uh1jbhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhKhjo hhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j!module_auxiliary_driver (C macro)c.module_auxiliary_driverhNtauh1jhjo hhhNhNubj)}(hhh](j)}(hmodule_auxiliary_driverh]j)}(hmodule_auxiliary_driverh]j)}(hmodule_auxiliary_driverh]j)}(hjq h]hmodule_auxiliary_driver}(hj{ hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjw ubah}(h]h ](jjeh"]h$]h&]hhuh1jhjs hhhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhMubah}(h]h ]h"]h$]h&]hhjuh1jjj hjo hhhj hMubah}(h]jj ah ](j jeh"]h$]h&]jj)jhuh1jhj hMhjl hhubj)}(hhh]h}(h]h ]h"]h$]h&]uh1jhjl hhhj hMubeh}(h]h ](j2macroeh"]h$]h&]j7j2j8j j9j j:j;j<uh1jhhhjo 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.hhMhjo 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 hMhjo 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]jH)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jGhj ubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhMhj ubj)}(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&]uh1jhj hMhj ubah}(h]h ]h"]h$]h&]uh1jhj ubh)}(h**Description**h]jH)}(hj> h]h Description}(hj@ hhhNhNubah}(h]h ]h"]h$]h&]uh1jGhj< 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()}(hjT hhhNhNubah}(h]h ]h"]h$]h&]uh1hhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhMhj ubjc)}(h module_auxiliary_driver(my_drv);h]h module_auxiliary_driver(my_drv);}hjc sbah}(h]h ]h"]h$]h&]hhjjj2j}uh1jbhf/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:38: ./include/linux/auxiliary_bus.hhMhj ubeh}(h]h ] kernelindentah"]h$]h&]uh1j=hjo hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j(__auxiliary_driver_register (C function)c.__auxiliary_driver_registerhNtauh1jhjo 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 ]jah"]h$]h&]uh1jhj hhha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chMTubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhj hMTubj)}(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 hMTubjJ)}(hL(struct auxiliary_driver *auxdrv, struct module *owner, const char *modname)h](jP)}(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&] refdomainj2reftypej reftargetj modnameN classnameNjj)}j]j)}jj sbc.__auxiliary_driver_registerasbuh1hhj ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hauxdrvh]hauxdrv}(hj)hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphhhuh1jOhj ubjP)}(hstruct module *ownerh](j)}(hjh]hstruct}(hjBhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj>ubj)}(h h]h }(hjOhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj>ubh)}(hhh]j)}(hmoduleh]hmodule}(hj`hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj]ubah}(h]h ]h"]h$]h&] refdomainj2reftypej reftargetjbmodnameN classnameNjj)}j]j c.__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)}(hownerh]howner}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj>ubeh}(h]h ]h"]h$]h&]noemphhhuh1jOhj ubjP)}(hconst char *modnameh](j)}(hjh]hconst}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hcharh]hchar}(hjhhhNhNubah}(h]h ]jah"]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&]noemphhhuh1jOhj ubeh}(h]h ]h"]h$]h&]hhuh1jIhj hhhj hMTubeh}(h]h ]h"]h$]h&]hhjuh1jjj hj hhhj hMTubah}(h]j ah ](j jeh"]h$]h&]jj)jhuh1jhj hMThj 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.chMThjhhubah}(h]h ]h"]h$]h&]uh1jhj hhhj hMTubeh}(h]h ](j2functioneh"]h$]h&]j7j2j8j8j9j8j:j;j<uh1jhhhjo 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]jH)}(hjBh]h Parameters}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1jGhj@ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chMXhj<ubj)}(hhh](j)}(h?``struct auxiliary_driver *auxdrv`` auxiliary_driver structure h](j)}(h#``struct auxiliary_driver *auxdrv``h]j)}(hjah]hstruct auxiliary_driver *auxdrv}(hjchhhNhNubah}(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.chMUhj[ubj)}(hhh]h)}(hauxiliary_driver structureh]hauxiliary_driver structure}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjvhMUhjwubah}(h]h ]h"]h$]h&]uh1jhj[ubeh}(h]h ]h"]h$]h&]uh1jhjvhMUhjXubj)}(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.chMVhjubj)}(hhh]h)}(howning module/driverh]howning module/driver}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMVhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMVhjXubj)}(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.chMWhjubj)}(hhh]h)}(h KBUILD_MODNAME for parent driverh]h KBUILD_MODNAME for parent driver}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMWhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMWhjXubeh}(h]h ]h"]h$]h&]uh1jhj<ubh)}(h**Description**h]jH)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jGhj ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chMYhj<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.}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chMXhj<ubeh}(h]h ] kernelindentah"]h$]h&]uh1j=hjo hhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j(auxiliary_driver_unregister (C function)c.auxiliary_driver_unregisterhNtauh1jhjo 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}(hjShhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjOhhha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chM{ubj)}(h h]h }(hjbhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjOhhhjahM{ubj)}(hauxiliary_driver_unregisterh]j)}(hauxiliary_driver_unregisterh]hauxiliary_driver_unregister}(hjthhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjpubah}(h]h ](jjeh"]h$]h&]hhuh1jhjOhhhjahM{ubjJ)}(h!(struct auxiliary_driver *auxdrv)h]jP)}(hstruct auxiliary_driver *auxdrvh](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(hauxiliary_driverh]hauxiliary_driver}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainj2reftypej reftargetjmodnameN classnameNjj)}j]j)}jjvsbc.auxiliary_driver_unregisterasbuh1hhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hauxdrvh]hauxdrv}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jOhjubah}(h]h ]h"]h$]h&]hhuh1jIhjOhhhjahM{ubeh}(h]h ]h"]h$]h&]hhjuh1jjj hjKhhhjahM{ubah}(h]jFah ](j jeh"]h$]h&]jj)jhuh1jhjahM{hjHhhubj)}(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.chM{hjhhubah}(h]h ]h"]h$]h&]uh1jhjHhhhjahM{ubeh}(h]h ](j2functioneh"]h$]h&]j7j2j8j+j9j+j:j;j<uh1jhhhjo hNhNubj>)}(hP**Parameters** ``struct auxiliary_driver *auxdrv`` auxiliary_driver structureh](h)}(h**Parameters**h]jH)}(hj5h]h Parameters}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1jGhj3ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chMhj/ubj)}(hhh]j)}(h>``struct auxiliary_driver *auxdrv`` auxiliary_driver structureh](j)}(h#``struct auxiliary_driver *auxdrv``h]j)}(hjTh]hstruct auxiliary_driver *auxdrv}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjRubah}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chMhjNubj)}(hhh]h)}(hauxiliary_driver structureh]hauxiliary_driver structure}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:41: ./drivers/base/auxiliary.chM|hjjubah}(h]h ]h"]h$]h&]uh1jhjNubeh}(h]h ]h"]h$]h&]uh1jhjihMhjKubah}(h]h ]h"]h$]h&]uh1jhj/ubeh}(h]h ] kernelindentah"]h$]h&]uh1j=hjo 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.chKahjhhubjc)}(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&]hhjjj2j}uh1jbha/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.chKrhjhhubjc)}(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&]hhjjj2j}uh1jbha/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:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/driver-api/auxiliary_bus:47: ./drivers/base/auxiliary.chKhjhhubjc)}(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&]hhjjj2j}uh1jbha/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.}(hj)hhhNhNubah}(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.}(hj8hhhNhNubah}(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](hՌid1eh ]h"]( auxiliary bus auxiliary_buseh$]h&]uh1hhhhhhhhKexpect_referenced_by_name}jUhsexpect_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_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourcehnj _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}(jUhjTjQjjjl ji jd ja jjjLjIu nametypes}(jUjTjjl jd jjLuh}(hhjQhjj)ji jjjjj jjja jjjo j j jj jo j j jFjKjIju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}jKsRparse_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&]levelKtypeINFOsourcehnjlineKuh1juba transformerN include_log] decorationNhhub.