drivers/staging/media/imx/imx-media-internal-sd.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/imx/imx-media-internal-sd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/imx/imx-media-internal-sd.c- Extension
.c- Size
- 6681 bytes
- Lines
- 307
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/platform_device.himx-media.h
Detected Declarations
struct internal_subdevstruct internal_linkstruct internal_padstruct internal_subdevfunction create_internal_linkfunction create_ipu_internal_linksfunction imx_media_register_ipu_internal_subdevsfunction imx_media_unregister_ipu_internal_subdevs
Annotated Snippet
struct internal_link {
int remote;
int local_pad;
int remote_pad;
};
struct internal_pad {
int num_links;
struct internal_link link[MAX_INTERNAL_LINKS];
};
struct internal_subdev {
u32 grp_id;
struct internal_pad pad[MAX_INTERNAL_PADS];
struct v4l2_subdev * (*sync_register)(struct v4l2_device *v4l2_dev,
struct device *ipu_dev,
struct ipu_soc *ipu,
u32 grp_id);
int (*sync_unregister)(struct v4l2_subdev *sd);
};
static const struct internal_subdev int_subdev[NUM_IPU_SUBDEVS] = {
[IPU_CSI0] = {
.grp_id = IMX_MEDIA_GRP_ID_IPU_CSI0,
.pad[CSI_SRC_PAD_DIRECT] = {
.num_links = 2,
.link = {
{
.local_pad = CSI_SRC_PAD_DIRECT,
.remote = IPU_IC_PRP,
.remote_pad = PRP_SINK_PAD,
}, {
.local_pad = CSI_SRC_PAD_DIRECT,
.remote = IPU_VDIC,
.remote_pad = VDIC_SINK_PAD_DIRECT,
},
},
},
},
[IPU_CSI1] = {
.grp_id = IMX_MEDIA_GRP_ID_IPU_CSI1,
.pad[CSI_SRC_PAD_DIRECT] = {
.num_links = 2,
.link = {
{
.local_pad = CSI_SRC_PAD_DIRECT,
.remote = IPU_IC_PRP,
.remote_pad = PRP_SINK_PAD,
}, {
.local_pad = CSI_SRC_PAD_DIRECT,
.remote = IPU_VDIC,
.remote_pad = VDIC_SINK_PAD_DIRECT,
},
},
},
},
[IPU_VDIC] = {
.grp_id = IMX_MEDIA_GRP_ID_IPU_VDIC,
.sync_register = imx_media_vdic_register,
.sync_unregister = imx_media_vdic_unregister,
.pad[VDIC_SRC_PAD_DIRECT] = {
.num_links = 1,
.link = {
{
.local_pad = VDIC_SRC_PAD_DIRECT,
.remote = IPU_IC_PRP,
.remote_pad = PRP_SINK_PAD,
},
},
},
},
[IPU_IC_PRP] = {
.grp_id = IMX_MEDIA_GRP_ID_IPU_IC_PRP,
.sync_register = imx_media_ic_register,
.sync_unregister = imx_media_ic_unregister,
.pad[PRP_SRC_PAD_PRPENC] = {
.num_links = 1,
.link = {
{
.local_pad = PRP_SRC_PAD_PRPENC,
.remote = IPU_IC_PRPENC,
.remote_pad = PRPENCVF_SINK_PAD,
},
},
},
.pad[PRP_SRC_PAD_PRPVF] = {
Annotation
- Immediate include surface: `linux/platform_device.h`, `imx-media.h`.
- Detected declarations: `struct internal_subdev`, `struct internal_link`, `struct internal_pad`, `struct internal_subdev`, `function create_internal_link`, `function create_ipu_internal_links`, `function imx_media_register_ipu_internal_subdevs`, `function imx_media_unregister_ipu_internal_subdevs`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.