drivers/media/platform/amlogic/c3/isp/c3-isp-dev.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/amlogic/c3/isp/c3-isp-dev.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/amlogic/c3/isp/c3-isp-dev.c- Extension
.c- Size
- 9825 bytes
- Lines
- 422
- 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/device.hlinux/module.hlinux/mutex.hlinux/platform_device.hlinux/pm_runtime.hmedia/v4l2-common.hmedia/v4l2-device.hmedia/v4l2-fwnode.hmedia/v4l2-mc.hc3-isp-common.hc3-isp-regs.h
Detected Declarations
function Copyrightfunction c3_isp_writefunction c3_isp_update_bitsfunction c3_isp_runtime_suspendfunction c3_isp_runtime_resumefunction c3_isp_irq_handlerfunction c3_isp_notify_boundfunction c3_isp_notify_completefunction c3_isp_async_nf_registerfunction c3_isp_async_nf_unregisterfunction c3_isp_media_registerfunction c3_isp_media_unregisterfunction c3_isp_remove_linksfunction c3_isp_create_linksfunction c3_isp_videos_registerfunction c3_isp_videos_unregisterfunction c3_isp_get_clocksfunction c3_isp_probefunction c3_isp_remove
Annotated Snippet
if (ret) {
dev_err(isp->dev,
"Failed to link rsz %u and cap %u\n", i, i);
goto err_remove_links;
}
ret = media_create_pad_link(&isp->core.sd.entity,
C3_ISP_CORE_PAD_SOURCE_VIDEO_0 + i,
&isp->resizers[i].sd.entity,
C3_ISP_RSZ_PAD_SINK,
MEDIA_LNK_FL_ENABLED);
if (ret) {
dev_err(isp->dev,
"Failed to link core and rsz %u\n", i);
goto err_remove_links;
}
}
ret = media_create_pad_link(&isp->core.sd.entity,
C3_ISP_CORE_PAD_SOURCE_STATS,
&isp->stats.vdev.entity,
0, MEDIA_LNK_FL_ENABLED);
if (ret) {
dev_err(isp->dev, "Failed to link core and stats\n");
goto err_remove_links;
}
ret = media_create_pad_link(&isp->params.vdev.entity, 0,
&isp->core.sd.entity,
C3_ISP_CORE_PAD_SINK_PARAMS,
MEDIA_LNK_FL_ENABLED);
if (ret) {
dev_err(isp->dev, "Failed to link params and core\n");
goto err_remove_links;
}
return 0;
err_remove_links:
c3_isp_remove_links(isp);
return ret;
}
static int c3_isp_videos_register(struct c3_isp_device *isp)
{
int ret;
ret = c3_isp_captures_register(isp);
if (ret)
return ret;
ret = c3_isp_stats_register(isp);
if (ret)
goto err_captures_unregister;
ret = c3_isp_params_register(isp);
if (ret)
goto err_stats_unregister;
ret = c3_isp_create_links(isp);
if (ret)
goto err_params_unregister;
return 0;
err_params_unregister:
c3_isp_params_unregister(isp);
err_stats_unregister:
c3_isp_stats_unregister(isp);
err_captures_unregister:
c3_isp_captures_unregister(isp);
return ret;
}
static void c3_isp_videos_unregister(struct c3_isp_device *isp)
{
c3_isp_remove_links(isp);
c3_isp_params_unregister(isp);
c3_isp_stats_unregister(isp);
c3_isp_captures_unregister(isp);
}
static int c3_isp_get_clocks(struct c3_isp_device *isp)
{
const struct c3_isp_info *info = isp->info;
for (unsigned int i = 0; i < info->clock_num; i++)
isp->clks[i].id = info->clocks[i];
return devm_clk_bulk_get(isp->dev, info->clock_num, isp->clks);
Annotation
- Immediate include surface: `linux/clk.h`, `linux/device.h`, `linux/module.h`, `linux/mutex.h`, `linux/platform_device.h`, `linux/pm_runtime.h`, `media/v4l2-common.h`, `media/v4l2-device.h`.
- Detected declarations: `function Copyright`, `function c3_isp_write`, `function c3_isp_update_bits`, `function c3_isp_runtime_suspend`, `function c3_isp_runtime_resume`, `function c3_isp_irq_handler`, `function c3_isp_notify_bound`, `function c3_isp_notify_complete`, `function c3_isp_async_nf_register`, `function c3_isp_async_nf_unregister`.
- 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.