drivers/gpu/drm/msm/dsi/dsi.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/dsi/dsi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/msm/dsi/dsi.c- Extension
.c- Size
- 5772 bytes
- Lines
- 271
- Domain
- Driver Families
- Bucket
- drivers/gpu
- 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
dsi.h
Detected Declarations
function Copyrightfunction msm_dsi_wide_bus_enabledfunction dsi_get_phyfunction dsi_destroyfunction dsi_bindfunction msm_dsi_is_master_dsifunction dsi_unbindfunction dsi_dev_attachfunction dsi_dev_detachfunction dsi_dev_probefunction dsi_dev_removefunction msm_dsi_registerfunction msm_dsi_unregisterfunction msm_dsi_modeset_initfunction msm_dsi_snapshot
Annotated Snippet
msm_dsi_is_master_dsi(msm_dsi)) {
struct drm_bridge *ext_bridge;
ext_bridge = devm_drm_of_get_bridge(&msm_dsi->pdev->dev,
msm_dsi->pdev->dev.of_node, 1, 0);
if (IS_ERR(ext_bridge))
return PTR_ERR(ext_bridge);
msm_dsi->next_bridge = ext_bridge;
}
priv->kms->dsi[msm_dsi->id] = msm_dsi;
return 0;
}
static void dsi_unbind(struct device *dev, struct device *master,
void *data)
{
struct msm_drm_private *priv = dev_get_drvdata(master);
struct msm_dsi *msm_dsi = dev_get_drvdata(dev);
msm_dsi_tx_buf_free(msm_dsi->host);
priv->kms->dsi[msm_dsi->id] = NULL;
}
static const struct component_ops dsi_ops = {
.bind = dsi_bind,
.unbind = dsi_unbind,
};
int dsi_dev_attach(struct platform_device *pdev)
{
return component_add(&pdev->dev, &dsi_ops);
}
void dsi_dev_detach(struct platform_device *pdev)
{
component_del(&pdev->dev, &dsi_ops);
}
static int dsi_dev_probe(struct platform_device *pdev)
{
struct msm_dsi *msm_dsi;
DBG("");
msm_dsi = dsi_init(pdev);
if (IS_ERR(msm_dsi)) {
/* Don't fail the bind if the dsi port is not connected */
if (PTR_ERR(msm_dsi) == -ENODEV)
return 0;
else
return PTR_ERR(msm_dsi);
}
return 0;
}
static void dsi_dev_remove(struct platform_device *pdev)
{
struct msm_dsi *msm_dsi = platform_get_drvdata(pdev);
DBG("");
dsi_destroy(msm_dsi);
}
static const struct of_device_id dt_match[] = {
{ .compatible = "qcom,mdss-dsi-ctrl" },
/* Deprecated, don't use */
{ .compatible = "qcom,dsi-ctrl-6g-qcm2290" },
{}
};
MODULE_DEVICE_TABLE(of, dt_match);
static const struct dev_pm_ops dsi_pm_ops = {
SET_RUNTIME_PM_OPS(msm_dsi_runtime_suspend, msm_dsi_runtime_resume, NULL)
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
pm_runtime_force_resume)
};
static struct platform_driver dsi_driver = {
.probe = dsi_dev_probe,
.remove = dsi_dev_remove,
.driver = {
.name = "msm_dsi",
.of_match_table = dt_match,
.pm = &dsi_pm_ops,
},
};
Annotation
- Immediate include surface: `dsi.h`.
- Detected declarations: `function Copyright`, `function msm_dsi_wide_bus_enabled`, `function dsi_get_phy`, `function dsi_destroy`, `function dsi_bind`, `function msm_dsi_is_master_dsi`, `function dsi_unbind`, `function dsi_dev_attach`, `function dsi_dev_detach`, `function dsi_dev_probe`.
- Atlas domain: Driver Families / drivers/gpu.
- 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.