drivers/gpu/drm/imx/dc/dc-ed.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/imx/dc/dc-ed.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/imx/dc/dc-ed.c- Extension
.c- Size
- 7099 bytes
- Lines
- 289
- 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
linux/bitfield.hlinux/bits.hlinux/component.hlinux/mod_devicetable.hlinux/module.hlinux/platform_device.hlinux/regmap.hdc-drv.hdc-pe.h
Detected Declarations
function dc_ed_pec_enable_shdenfunction dc_ed_pec_poweronfunction dc_ed_pec_sync_mode_singlefunction dc_ed_pec_div_resetfunction dc_ed_pec_src_selfunction dc_ed_pec_sync_triggerfunction dc_ed_enable_shdenfunction dc_ed_kick_mode_externalfunction dc_ed_disable_perfcountmodefunction dc_ed_disable_gamma_applyfunction dc_ed_initfunction dc_ed_bindfunction dc_ed_probefunction dc_ed_remove
Annotated Snippet
if (src_sels[i] == src) {
regmap_write(ed->reg_pec, PIXENGCFG_DYNAMIC, src);
return;
}
}
}
void dc_ed_pec_sync_trigger(struct dc_ed *ed)
{
regmap_write(ed->reg_pec, PIXENGCFG_TRIGGER, SYNC_TRIGGER);
}
static inline void dc_ed_enable_shden(struct dc_ed *ed)
{
regmap_write_bits(ed->reg_cfg, STATICCONTROL, SHDEN, SHDEN);
}
static inline void dc_ed_kick_mode_external(struct dc_ed *ed)
{
regmap_write_bits(ed->reg_cfg, STATICCONTROL, KICK_MODE, EXTERNAL);
}
static inline void dc_ed_disable_perfcountmode(struct dc_ed *ed)
{
regmap_write_bits(ed->reg_cfg, STATICCONTROL, PERFCOUNTMODE, 0);
}
static inline void dc_ed_disable_gamma_apply(struct dc_ed *ed)
{
regmap_write_bits(ed->reg_cfg, CONTROL, GAMMAAPPLYENABLE, 0);
}
void dc_ed_init(struct dc_ed *ed)
{
dc_ed_pec_src_sel(ed, LINK_ID_NONE);
dc_ed_pec_enable_shden(ed);
dc_ed_pec_poweron(ed);
dc_ed_pec_sync_mode_single(ed);
dc_ed_pec_div_reset(ed);
dc_ed_enable_shden(ed);
dc_ed_disable_perfcountmode(ed);
dc_ed_kick_mode_external(ed);
dc_ed_disable_gamma_apply(ed);
}
static int dc_ed_bind(struct device *dev, struct device *master, void *data)
{
struct platform_device *pdev = to_platform_device(dev);
struct dc_drm_device *dc_drm = data;
struct resource *res_pec;
void __iomem *base_pec;
void __iomem *base_cfg;
struct dc_ed *ed;
int id;
ed = devm_kzalloc(dev, sizeof(*ed), GFP_KERNEL);
if (!ed)
return -ENOMEM;
base_pec = devm_platform_get_and_ioremap_resource(pdev, 0, &res_pec);
if (IS_ERR(base_pec))
return PTR_ERR(base_pec);
base_cfg = devm_platform_ioremap_resource_byname(pdev, "cfg");
if (IS_ERR(base_cfg))
return PTR_ERR(base_cfg);
ed->reg_pec = devm_regmap_init_mmio(dev, base_pec,
&dc_ed_pec_regmap_config);
if (IS_ERR(ed->reg_pec))
return PTR_ERR(ed->reg_pec);
ed->reg_cfg = devm_regmap_init_mmio(dev, base_cfg,
&dc_ed_cfg_regmap_config);
if (IS_ERR(ed->reg_cfg))
return PTR_ERR(ed->reg_cfg);
ed->irq_shdload = platform_get_irq_byname(pdev, "shdload");
if (ed->irq_shdload < 0)
return ed->irq_shdload;
ed->dev = dev;
id = dc_subdev_get_id(dc_ed_info, ARRAY_SIZE(dc_ed_info), res_pec);
if (id < 0) {
dev_err(dev, "failed to get instance number: %d\n", id);
return id;
}
switch (id) {
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/bits.h`, `linux/component.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/platform_device.h`, `linux/regmap.h`, `dc-drv.h`.
- Detected declarations: `function dc_ed_pec_enable_shden`, `function dc_ed_pec_poweron`, `function dc_ed_pec_sync_mode_single`, `function dc_ed_pec_div_reset`, `function dc_ed_pec_src_sel`, `function dc_ed_pec_sync_trigger`, `function dc_ed_enable_shden`, `function dc_ed_kick_mode_external`, `function dc_ed_disable_perfcountmode`, `function dc_ed_disable_gamma_apply`.
- 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.