drivers/gpu/drm/bridge/aux-hpd-bridge.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/bridge/aux-hpd-bridge.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/bridge/aux-hpd-bridge.c- Extension
.c- Size
- 5716 bytes
- Lines
- 212
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/auxiliary_bus.hlinux/export.hlinux/module.hlinux/of.hdrm/drm_bridge.hdrm/bridge/aux-bridge.h
Detected Declarations
struct drm_aux_hpd_bridge_datafunction drm_aux_hpd_bridge_releasefunction drm_aux_hpd_bridge_free_adevfunction drm_aux_hpd_bridge_del_adevfunction devm_drm_dp_hpd_bridge_addfunction drm_bridge_hpd_notifyfunction drm_aux_hpd_bridge_attachfunction drm_aux_hpd_bridge_probeexport devm_drm_dp_hpd_bridge_allocexport devm_drm_dp_hpd_bridge_addexport drm_dp_hpd_bridge_registerexport drm_aux_hpd_bridge_notify
Annotated Snippet
struct drm_aux_hpd_bridge_data {
struct drm_bridge bridge;
struct device *dev;
};
static void drm_aux_hpd_bridge_release(struct device *dev)
{
struct auxiliary_device *adev = to_auxiliary_dev(dev);
ida_free(&drm_aux_hpd_bridge_ida, adev->id);
of_node_put(adev->dev.platform_data);
of_node_put(adev->dev.of_node);
kfree(adev);
}
static void drm_aux_hpd_bridge_free_adev(void *_adev)
{
auxiliary_device_uninit(_adev);
}
/**
* devm_drm_dp_hpd_bridge_alloc - allocate a HPD DisplayPort bridge
* @parent: device instance providing this bridge
* @np: device node pointer corresponding to this bridge instance
*
* Creates a simple DRM bridge with the type set to
* DRM_MODE_CONNECTOR_DisplayPort, which terminates the bridge chain and is
* able to send the HPD events.
*
* Return: bridge auxiliary device pointer or an error pointer
*/
struct auxiliary_device *devm_drm_dp_hpd_bridge_alloc(struct device *parent, struct device_node *np)
{
struct auxiliary_device *adev;
int ret;
adev = kzalloc_obj(*adev);
if (!adev)
return ERR_PTR(-ENOMEM);
ret = ida_alloc(&drm_aux_hpd_bridge_ida, GFP_KERNEL);
if (ret < 0) {
kfree(adev);
return ERR_PTR(ret);
}
adev->id = ret;
adev->name = "dp_hpd_bridge";
adev->dev.parent = parent;
adev->dev.release = drm_aux_hpd_bridge_release;
adev->dev.platform_data = of_node_get(np);
device_set_of_node_from_dev(&adev->dev, parent);
ret = auxiliary_device_init(adev);
if (ret) {
of_node_put(adev->dev.platform_data);
of_node_put(adev->dev.of_node);
ida_free(&drm_aux_hpd_bridge_ida, adev->id);
kfree(adev);
return ERR_PTR(ret);
}
ret = devm_add_action_or_reset(parent, drm_aux_hpd_bridge_free_adev, adev);
if (ret)
return ERR_PTR(ret);
return adev;
}
EXPORT_SYMBOL_GPL(devm_drm_dp_hpd_bridge_alloc);
static void drm_aux_hpd_bridge_del_adev(void *_adev)
{
auxiliary_device_delete(_adev);
}
/**
* devm_drm_dp_hpd_bridge_add - register a HDP DisplayPort bridge
* @dev: struct device to tie registration lifetime to
* @adev: bridge auxiliary device to be registered
*
* Returns: zero on success or a negative errno
*/
int devm_drm_dp_hpd_bridge_add(struct device *dev, struct auxiliary_device *adev)
{
int ret;
ret = auxiliary_device_add(adev);
Annotation
- Immediate include surface: `linux/auxiliary_bus.h`, `linux/export.h`, `linux/module.h`, `linux/of.h`, `drm/drm_bridge.h`, `drm/bridge/aux-bridge.h`.
- Detected declarations: `struct drm_aux_hpd_bridge_data`, `function drm_aux_hpd_bridge_release`, `function drm_aux_hpd_bridge_free_adev`, `function drm_aux_hpd_bridge_del_adev`, `function devm_drm_dp_hpd_bridge_add`, `function drm_bridge_hpd_notify`, `function drm_aux_hpd_bridge_attach`, `function drm_aux_hpd_bridge_probe`, `export devm_drm_dp_hpd_bridge_alloc`, `export devm_drm_dp_hpd_bridge_add`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration 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.