drivers/gpu/drm/display/drm_dp_aux_bus.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/display/drm_dp_aux_bus.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/display/drm_dp_aux_bus.c- Extension
.c- Size
- 11153 bytes
- Lines
- 393
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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/export.hlinux/init.hlinux/kernel.hlinux/module.hlinux/of_device.hlinux/pm_domain.hlinux/pm_runtime.hdrm/display/drm_dp_aux_bus.hdrm/display/drm_dp_helper.h
Detected Declarations
struct dp_aux_ep_device_with_datafunction dp_aux_ep_matchfunction dp_aux_ep_probefunction dp_aux_ep_removefunction dp_aux_ep_shutdownfunction modalias_showfunction dp_aux_ep_dev_releasefunction dp_aux_ep_dev_modaliasfunction of_dp_aux_ep_destroyfunction of_dp_aux_depopulate_busfunction of_dp_aux_populate_busfunction of_dp_aux_depopulate_bus_voidfunction devm_of_dp_aux_populate_busfunction __dp_aux_dp_driver_registerfunction dp_aux_dp_driver_unregisterfunction dp_aux_bus_initfunction dp_aux_bus_exitmodule init dp_aux_bus_initexport of_dp_aux_depopulate_busexport of_dp_aux_populate_busexport devm_of_dp_aux_populate_busexport __dp_aux_dp_driver_registerexport dp_aux_dp_driver_unregister
Annotated Snippet
static int dp_aux_ep_match(struct device *dev, const struct device_driver *drv)
{
return !!of_match_device(drv->of_match_table, dev);
}
/**
* dp_aux_ep_probe() - The probe function for the dp_aux_bus.
* @dev: The device to probe.
*
* Calls through to the endpoint driver probe.
*
* Return: 0 if no error or negative error code.
*/
static int dp_aux_ep_probe(struct device *dev)
{
struct dp_aux_ep_driver *aux_ep_drv = to_dp_aux_ep_drv(dev->driver);
struct dp_aux_ep_device *aux_ep = to_dp_aux_ep_dev(dev);
struct dp_aux_ep_device_with_data *aux_ep_with_data =
container_of(aux_ep, struct dp_aux_ep_device_with_data, aux_ep);
int ret;
ret = dev_pm_domain_attach(dev, PD_FLAG_ATTACH_POWER_ON);
if (ret)
return dev_err_probe(dev, ret, "Failed to attach to PM Domain\n");
ret = aux_ep_drv->probe(aux_ep);
if (ret)
goto err_attached;
if (aux_ep_with_data->done_probing) {
ret = aux_ep_with_data->done_probing(aux_ep->aux);
if (ret) {
/*
* The done_probing() callback should not return
* -EPROBE_DEFER to us. If it does, we treat it as an
* error. Passing it on as-is would cause the _panel_
* to defer.
*/
if (ret == -EPROBE_DEFER) {
dev_err(dev,
"DP AUX done_probing() can't defer\n");
ret = -EINVAL;
}
goto err_probed;
}
}
return 0;
err_probed:
if (aux_ep_drv->remove)
aux_ep_drv->remove(aux_ep);
err_attached:
dev_pm_domain_detach(dev, true);
return ret;
}
/**
* dp_aux_ep_remove() - The remove function for the dp_aux_bus.
* @dev: The device to remove.
*
* Calls through to the endpoint driver remove.
*/
static void dp_aux_ep_remove(struct device *dev)
{
struct dp_aux_ep_driver *aux_ep_drv = to_dp_aux_ep_drv(dev->driver);
struct dp_aux_ep_device *aux_ep = to_dp_aux_ep_dev(dev);
if (aux_ep_drv->remove)
aux_ep_drv->remove(aux_ep);
dev_pm_domain_detach(dev, true);
}
/**
* dp_aux_ep_shutdown() - The shutdown function for the dp_aux_bus.
* @dev: The device to shutdown.
*
* Calls through to the endpoint driver shutdown.
*/
static void dp_aux_ep_shutdown(struct device *dev)
{
struct dp_aux_ep_driver *aux_ep_drv;
if (!dev->driver)
return;
aux_ep_drv = to_dp_aux_ep_drv(dev->driver);
if (aux_ep_drv->shutdown)
aux_ep_drv->shutdown(to_dp_aux_ep_dev(dev));
}
Annotation
- Immediate include surface: `linux/export.h`, `linux/init.h`, `linux/kernel.h`, `linux/module.h`, `linux/of_device.h`, `linux/pm_domain.h`, `linux/pm_runtime.h`, `drm/display/drm_dp_aux_bus.h`.
- Detected declarations: `struct dp_aux_ep_device_with_data`, `function dp_aux_ep_match`, `function dp_aux_ep_probe`, `function dp_aux_ep_remove`, `function dp_aux_ep_shutdown`, `function modalias_show`, `function dp_aux_ep_dev_release`, `function dp_aux_ep_dev_modalias`, `function of_dp_aux_ep_destroy`, `function of_dp_aux_depopulate_bus`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: pattern 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.