drivers/gpu/drm/imx/dc/dc-ic.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/imx/dc/dc-ic.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/imx/dc/dc-ic.c- Extension
.c- Size
- 7420 bytes
- Lines
- 283
- 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/clk.hlinux/interrupt.hlinux/irq.hlinux/irqchip/chained_irq.hlinux/irqdomain.hlinux/of.hlinux/of_irq.hlinux/platform_device.hlinux/pm_runtime.hlinux/regmap.h
Detected Declarations
struct dc_ic_datastruct dc_ic_entryfunction dc_ic_irq_handlerfunction dc_ic_probefunction dc_ic_removefunction dc_ic_runtime_suspendfunction dc_ic_runtime_resume
Annotated Snippet
struct dc_ic_data {
struct regmap *regs;
struct clk *clk_axi;
int irq[IRQ_COUNT];
struct irq_domain *domain;
};
struct dc_ic_entry {
struct dc_ic_data *data;
int irq;
};
static const struct regmap_range dc_ic_regmap_write_ranges[] = {
regmap_reg_range(USERINTERRUPTMASK(0), INTERRUPTCLEAR(1)),
regmap_reg_range(USERINTERRUPTENABLE(0), USERINTERRUPTCLEAR(1)),
};
static const struct regmap_access_table dc_ic_regmap_write_table = {
.yes_ranges = dc_ic_regmap_write_ranges,
.n_yes_ranges = ARRAY_SIZE(dc_ic_regmap_write_ranges),
};
static const struct regmap_range dc_ic_regmap_read_ranges[] = {
regmap_reg_range(USERINTERRUPTMASK(0), INTERRUPTENABLE(1)),
regmap_reg_range(INTERRUPTSTATUS(0), INTERRUPTSTATUS(1)),
regmap_reg_range(USERINTERRUPTENABLE(0), USERINTERRUPTENABLE(1)),
regmap_reg_range(USERINTERRUPTSTATUS(0), USERINTERRUPTSTATUS(1)),
};
static const struct regmap_access_table dc_ic_regmap_read_table = {
.yes_ranges = dc_ic_regmap_read_ranges,
.n_yes_ranges = ARRAY_SIZE(dc_ic_regmap_read_ranges),
};
static const struct regmap_range dc_ic_regmap_volatile_ranges[] = {
regmap_reg_range(INTERRUPTPRESET(0), INTERRUPTCLEAR(1)),
regmap_reg_range(USERINTERRUPTPRESET(0), USERINTERRUPTCLEAR(1)),
};
static const struct regmap_access_table dc_ic_regmap_volatile_table = {
.yes_ranges = dc_ic_regmap_volatile_ranges,
.n_yes_ranges = ARRAY_SIZE(dc_ic_regmap_volatile_ranges),
};
static const struct regmap_config dc_ic_regmap_config = {
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
.fast_io = true,
.wr_table = &dc_ic_regmap_write_table,
.rd_table = &dc_ic_regmap_read_table,
.volatile_table = &dc_ic_regmap_volatile_table,
.max_register = USERINTERRUPTSTATUS(1),
};
static void dc_ic_irq_handler(struct irq_desc *desc)
{
struct dc_ic_entry *entry = irq_desc_get_handler_data(desc);
struct dc_ic_data *data = entry->data;
unsigned int status, enable;
unsigned int virq;
chained_irq_enter(irq_desc_get_chip(desc), desc);
regmap_read(data->regs, USERINTERRUPTSTATUS(entry->irq / 32), &status);
regmap_read(data->regs, USERINTERRUPTENABLE(entry->irq / 32), &enable);
status &= enable;
if (status & BIT(entry->irq % 32)) {
virq = irq_find_mapping(data->domain, entry->irq);
if (virq)
generic_handle_irq(virq);
}
chained_irq_exit(irq_desc_get_chip(desc), desc);
}
static const unsigned long unused_irq[REG_NUM] = {0x00000000, 0xfffe0008};
static int dc_ic_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct irq_chip_generic *gc;
struct dc_ic_entry *entry;
struct irq_chip_type *ct;
struct dc_ic_data *data;
void __iomem *base;
int i, ret;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/interrupt.h`, `linux/irq.h`, `linux/irqchip/chained_irq.h`, `linux/irqdomain.h`, `linux/of.h`, `linux/of_irq.h`, `linux/platform_device.h`.
- Detected declarations: `struct dc_ic_data`, `struct dc_ic_entry`, `function dc_ic_irq_handler`, `function dc_ic_probe`, `function dc_ic_remove`, `function dc_ic_runtime_suspend`, `function dc_ic_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.