drivers/media/platform/microchip/microchip-sama7g5-isc.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/microchip/microchip-sama7g5-isc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/microchip/microchip-sama7g5-isc.c- Extension
.c- Size
- 17308 bytes
- Lines
- 637
- Domain
- Driver Families
- Bucket
- drivers/media
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/clkdev.hlinux/clk-provider.hlinux/delay.hlinux/interrupt.hlinux/math64.hlinux/module.hlinux/of.hlinux/of_graph.hlinux/platform_device.hlinux/pm_runtime.hlinux/regmap.hlinux/videodev2.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-event.hmedia/v4l2-image-sizes.hmedia/v4l2-ioctl.hmedia/v4l2-fwnode.hmedia/v4l2-subdev.hmedia/videobuf2-dma-contig.hmicrochip-isc-regs.hmicrochip-isc.h
Detected Declarations
function isc_sama7g5_config_cscfunction isc_sama7g5_config_cbcfunction isc_sama7g5_config_ccfunction isc_sama7g5_config_ctrlsfunction isc_sama7g5_config_dpcfunction isc_sama7g5_config_gamfunction isc_sama7g5_config_rlpfunction isc_sama7g5_adapt_pipelinefunction xisc_parse_dtfunction for_each_endpoint_of_nodefunction microchip_xisc_probefunction list_for_each_entryfunction microchip_xisc_removefunction xisc_runtime_suspendfunction xisc_runtime_resume
Annotated Snippet
if (ret) {
of_node_put(epn);
dev_err(dev, "Could not parse the endpoint\n");
return -EINVAL;
}
subdev_entity = devm_kzalloc(dev, sizeof(*subdev_entity),
GFP_KERNEL);
if (!subdev_entity) {
of_node_put(epn);
return -ENOMEM;
}
subdev_entity->epn = epn;
flags = v4l2_epn.bus.parallel.flags;
if (flags & V4L2_MBUS_HSYNC_ACTIVE_LOW)
subdev_entity->pfe_cfg0 = ISC_PFE_CFG0_HPOL_LOW;
if (flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)
subdev_entity->pfe_cfg0 |= ISC_PFE_CFG0_VPOL_LOW;
if (flags & V4L2_MBUS_PCLK_SAMPLE_FALLING)
subdev_entity->pfe_cfg0 |= ISC_PFE_CFG0_PPOL_LOW;
if (v4l2_epn.bus_type == V4L2_MBUS_BT656)
subdev_entity->pfe_cfg0 |= ISC_PFE_CFG0_CCIR_CRC |
ISC_PFE_CFG0_CCIR656;
if (mipi_mode)
subdev_entity->pfe_cfg0 |= ISC_PFE_CFG0_MIPI;
list_add_tail(&subdev_entity->list, &isc->subdev_entities);
}
return 0;
}
static int microchip_xisc_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct isc_device *isc;
void __iomem *io_base;
struct isc_subdev_entity *subdev_entity;
int irq;
int ret;
u32 ver;
isc = devm_kzalloc(dev, sizeof(*isc), GFP_KERNEL);
if (!isc)
return -ENOMEM;
platform_set_drvdata(pdev, isc);
isc->dev = dev;
io_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(io_base))
return PTR_ERR(io_base);
isc->regmap = devm_regmap_init_mmio(dev, io_base, µchip_isc_regmap_config);
if (IS_ERR(isc->regmap)) {
ret = PTR_ERR(isc->regmap);
dev_err(dev, "failed to init register map: %d\n", ret);
return ret;
}
irq = platform_get_irq(pdev, 0);
if (irq < 0)
return irq;
ret = devm_request_irq(dev, irq, microchip_isc_interrupt, 0,
"microchip-sama7g5-xisc", isc);
if (ret < 0) {
dev_err(dev, "can't register ISR for IRQ %u (ret=%i)\n",
irq, ret);
return ret;
}
isc->gamma_table = isc_sama7g5_gamma_table;
isc->gamma_max = 0;
isc->max_width = ISC_SAMA7G5_MAX_SUPPORT_WIDTH;
isc->max_height = ISC_SAMA7G5_MAX_SUPPORT_HEIGHT;
isc->config_dpc = isc_sama7g5_config_dpc;
isc->config_csc = isc_sama7g5_config_csc;
isc->config_cbc = isc_sama7g5_config_cbc;
isc->config_cc = isc_sama7g5_config_cc;
isc->config_gam = isc_sama7g5_config_gam;
isc->config_rlp = isc_sama7g5_config_rlp;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/clkdev.h`, `linux/clk-provider.h`, `linux/delay.h`, `linux/interrupt.h`, `linux/math64.h`, `linux/module.h`, `linux/of.h`.
- Detected declarations: `function isc_sama7g5_config_csc`, `function isc_sama7g5_config_cbc`, `function isc_sama7g5_config_cc`, `function isc_sama7g5_config_ctrls`, `function isc_sama7g5_config_dpc`, `function isc_sama7g5_config_gam`, `function isc_sama7g5_config_rlp`, `function isc_sama7g5_adapt_pipeline`, `function xisc_parse_dt`, `function for_each_endpoint_of_node`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.