drivers/greybus/control.c
Source file repositories/reference/linux-study-clean/drivers/greybus/control.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/greybus/control.c- Extension
.c- Size
- 14205 bytes
- Lines
- 585
- Domain
- Driver Families
- Bucket
- drivers/greybus
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/module.hlinux/slab.hlinux/greybus.h
Detected Declarations
function gb_control_get_versionfunction gb_control_get_bundle_versionfunction gb_control_get_bundle_versionsfunction list_for_each_entryfunction gb_control_get_manifest_size_operationfunction gb_control_get_manifest_operationfunction gb_control_connected_operationfunction gb_control_disconnected_operationfunction gb_control_disconnecting_operationfunction gb_control_mode_switch_operationfunction gb_control_bundle_pm_status_mapfunction gb_control_bundle_suspendfunction gb_control_bundle_resumefunction gb_control_bundle_deactivatefunction gb_control_bundle_activatefunction gb_control_interface_pm_status_mapfunction gb_control_interface_suspend_preparefunction gb_control_interface_deactivate_preparefunction gb_control_interface_hibernate_abortfunction vendor_string_showfunction product_string_showfunction gb_control_releasefunction gb_control_enablefunction gb_control_disablefunction gb_control_suspendfunction gb_control_resumefunction gb_control_addfunction gb_control_delfunction gb_control_putfunction gb_control_mode_switch_preparefunction gb_control_mode_switch_complete
Annotated Snippet
ret = device_add(&control->dev);
if (ret) {
dev_err(&control->dev,
"failed to register control device: %d\n",
ret);
return ret;
}
return 0;
}
void gb_control_del(struct gb_control *control)
{
if (device_is_registered(&control->dev))
device_del(&control->dev);
}
struct gb_control *gb_control_get(struct gb_control *control)
{
get_device(&control->dev);
return control;
}
void gb_control_put(struct gb_control *control)
{
put_device(&control->dev);
}
void gb_control_mode_switch_prepare(struct gb_control *control)
{
gb_connection_mode_switch_prepare(control->connection);
}
void gb_control_mode_switch_complete(struct gb_control *control)
{
gb_connection_mode_switch_complete(control->connection);
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/slab.h`, `linux/greybus.h`.
- Detected declarations: `function gb_control_get_version`, `function gb_control_get_bundle_version`, `function gb_control_get_bundle_versions`, `function list_for_each_entry`, `function gb_control_get_manifest_size_operation`, `function gb_control_get_manifest_operation`, `function gb_control_connected_operation`, `function gb_control_disconnected_operation`, `function gb_control_disconnecting_operation`, `function gb_control_mode_switch_operation`.
- Atlas domain: Driver Families / drivers/greybus.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.