drivers/gpu/drm/imx/dc/dc-de.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/imx/dc/dc-de.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/imx/dc/dc-de.c- Extension
.c- Size
- 4122 bytes
- Lines
- 178
- 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/component.hlinux/mod_devicetable.hlinux/module.hlinux/of_platform.hlinux/platform_device.hlinux/pm.hlinux/pm_runtime.hlinux/regmap.hdc-de.hdc-drv.h
Detected Declarations
function dc_dec_initfunction dc_de_bindfunction dc_de_post_bindfunction dc_de_probefunction dc_de_removefunction dc_de_runtime_resume
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright 2024 NXP
*/
#include <linux/component.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include "dc-de.h"
#include "dc-drv.h"
#define POLARITYCTRL 0xc
#define POLEN_HIGH BIT(2)
static const struct dc_subdev_info dc_de_info[] = {
{ .reg_start = 0x5618b400, .id = 0, },
{ .reg_start = 0x5618b420, .id = 1, },
};
static const struct regmap_range dc_de_regmap_ranges[] = {
regmap_reg_range(POLARITYCTRL, POLARITYCTRL),
};
static const struct regmap_access_table dc_de_regmap_access_table = {
.yes_ranges = dc_de_regmap_ranges,
.n_yes_ranges = ARRAY_SIZE(dc_de_regmap_ranges),
};
static const struct regmap_config dc_de_top_regmap_config = {
.name = "top",
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
.fast_io = true,
.wr_table = &dc_de_regmap_access_table,
.rd_table = &dc_de_regmap_access_table,
.max_register = POLARITYCTRL,
};
static inline void dc_dec_init(struct dc_de *de)
{
regmap_write_bits(de->reg_top, POLARITYCTRL, POLARITYCTRL, POLEN_HIGH);
}
static int dc_de_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_top;
void __iomem *base_top;
struct dc_de *de;
int ret, id;
de = devm_kzalloc(dev, sizeof(*de), GFP_KERNEL);
if (!de)
return -ENOMEM;
base_top = devm_platform_get_and_ioremap_resource(pdev, 0, &res_top);
if (IS_ERR(base_top))
return PTR_ERR(base_top);
de->reg_top = devm_regmap_init_mmio(dev, base_top,
&dc_de_top_regmap_config);
if (IS_ERR(de->reg_top))
return PTR_ERR(de->reg_top);
de->irq_shdload = platform_get_irq_byname(pdev, "shdload");
if (de->irq_shdload < 0)
return de->irq_shdload;
de->irq_framecomplete = platform_get_irq_byname(pdev, "framecomplete");
if (de->irq_framecomplete < 0)
return de->irq_framecomplete;
de->irq_seqcomplete = platform_get_irq_byname(pdev, "seqcomplete");
if (de->irq_seqcomplete < 0)
return de->irq_seqcomplete;
de->dev = dev;
dev_set_drvdata(dev, de);
ret = devm_pm_runtime_enable(dev);
if (ret)
Annotation
- Immediate include surface: `linux/component.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/of_platform.h`, `linux/platform_device.h`, `linux/pm.h`, `linux/pm_runtime.h`, `linux/regmap.h`.
- Detected declarations: `function dc_dec_init`, `function dc_de_bind`, `function dc_de_post_bind`, `function dc_de_probe`, `function dc_de_remove`, `function dc_de_runtime_resume`.
- 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.