drivers/phy/samsung/phy-exynos-dp-video.c
Source file repositories/reference/linux-study-clean/drivers/phy/samsung/phy-exynos-dp-video.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/phy/samsung/phy-exynos-dp-video.c- Extension
.c- Size
- 3339 bytes
- Lines
- 121
- Domain
- Driver Families
- Bucket
- drivers/phy
- 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/err.hlinux/io.hlinux/kernel.hlinux/module.hlinux/mfd/syscon.hlinux/of.hlinux/phy/phy.hlinux/platform_device.hlinux/regmap.hlinux/soc/samsung/exynos-regs-pmu.h
Detected Declarations
struct exynos_dp_video_phy_drvdatastruct exynos_dp_video_phyfunction exynos_dp_video_phy_power_onfunction exynos_dp_video_phy_power_offfunction exynos_dp_video_phy_probe
Annotated Snippet
struct exynos_dp_video_phy_drvdata {
u32 phy_ctrl_offset;
};
struct exynos_dp_video_phy {
struct regmap *regs;
const struct exynos_dp_video_phy_drvdata *drvdata;
};
static int exynos_dp_video_phy_power_on(struct phy *phy)
{
struct exynos_dp_video_phy *state = phy_get_drvdata(phy);
/* Disable power isolation on DP-PHY */
return regmap_update_bits(state->regs, state->drvdata->phy_ctrl_offset,
EXYNOS4_PHY_ENABLE, EXYNOS4_PHY_ENABLE);
}
static int exynos_dp_video_phy_power_off(struct phy *phy)
{
struct exynos_dp_video_phy *state = phy_get_drvdata(phy);
/* Enable power isolation on DP-PHY */
return regmap_update_bits(state->regs, state->drvdata->phy_ctrl_offset,
EXYNOS4_PHY_ENABLE, 0);
}
static const struct phy_ops exynos_dp_video_phy_ops = {
.power_on = exynos_dp_video_phy_power_on,
.power_off = exynos_dp_video_phy_power_off,
.owner = THIS_MODULE,
};
static const struct exynos_dp_video_phy_drvdata exynos5250_dp_video_phy = {
.phy_ctrl_offset = EXYNOS5_DPTX_PHY_CONTROL,
};
static const struct exynos_dp_video_phy_drvdata exynos5420_dp_video_phy = {
.phy_ctrl_offset = EXYNOS5420_DPTX_PHY_CONTROL,
};
static const struct of_device_id exynos_dp_video_phy_of_match[] = {
{
.compatible = "samsung,exynos5250-dp-video-phy",
.data = &exynos5250_dp_video_phy,
}, {
.compatible = "samsung,exynos5420-dp-video-phy",
.data = &exynos5420_dp_video_phy,
},
{ },
};
MODULE_DEVICE_TABLE(of, exynos_dp_video_phy_of_match);
static int exynos_dp_video_phy_probe(struct platform_device *pdev)
{
struct exynos_dp_video_phy *state;
struct device *dev = &pdev->dev;
struct phy_provider *phy_provider;
struct phy *phy;
state = devm_kzalloc(dev, sizeof(*state), GFP_KERNEL);
if (!state)
return -ENOMEM;
state->regs = syscon_node_to_regmap(dev->parent->of_node);
if (IS_ERR(state->regs))
/* Backwards compatible way */
state->regs = syscon_regmap_lookup_by_phandle(dev->of_node,
"samsung,pmu-syscon");
if (IS_ERR(state->regs)) {
dev_err(dev, "Failed to lookup PMU regmap\n");
return PTR_ERR(state->regs);
}
state->drvdata = of_device_get_match_data(dev);
phy = devm_phy_create(dev, NULL, &exynos_dp_video_phy_ops);
if (IS_ERR(phy)) {
dev_err(dev, "failed to create Display Port PHY\n");
return PTR_ERR(phy);
}
phy_set_drvdata(phy, state);
phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
return PTR_ERR_OR_ZERO(phy_provider);
}
static struct platform_driver exynos_dp_video_phy_driver = {
.probe = exynos_dp_video_phy_probe,
Annotation
- Immediate include surface: `linux/err.h`, `linux/io.h`, `linux/kernel.h`, `linux/module.h`, `linux/mfd/syscon.h`, `linux/of.h`, `linux/phy/phy.h`, `linux/platform_device.h`.
- Detected declarations: `struct exynos_dp_video_phy_drvdata`, `struct exynos_dp_video_phy`, `function exynos_dp_video_phy_power_on`, `function exynos_dp_video_phy_power_off`, `function exynos_dp_video_phy_probe`.
- Atlas domain: Driver Families / drivers/phy.
- 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.