drivers/media/platform/renesas/renesas-ceu.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/renesas/renesas-ceu.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/renesas/renesas-ceu.c- Extension
.c- Size
- 44302 bytes
- Lines
- 1730
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/delay.hlinux/device.hlinux/dma-mapping.hlinux/err.hlinux/errno.hlinux/interrupt.hlinux/io.hlinux/kernel.hlinux/mm.hlinux/module.hlinux/of.hlinux/of_graph.hlinux/platform_device.hlinux/pm_runtime.hlinux/slab.hlinux/time.hlinux/videodev2.hmedia/v4l2-async.hmedia/v4l2-common.hmedia/v4l2-ctrls.hmedia/v4l2-dev.hmedia/v4l2-device.hmedia/v4l2-event.hmedia/v4l2-fwnode.hmedia/v4l2-image-sizes.hmedia/v4l2-ioctl.hmedia/v4l2-mediabus.hmedia/videobuf2-dma-contig.hmedia/drv-intf/renesas-ceu.h
Detected Declarations
struct ceu_mbus_fmtstruct ceu_bufferstruct ceu_subdevstruct ceu_devicestruct ceu_fmtstruct ceu_datafunction ceu_fmt_mplanefunction ceu_writefunction ceu_readfunction ceu_soft_resetfunction ceu_hw_configfunction YUV420function ceu_capturefunction ceu_irqfunction ceu_update_plane_sizesfunction ceu_calc_plane_sizesfunction ceu_vb2_setupfunction ceu_vb2_queuefunction ceu_vb2_preparefunction ceu_start_streamingfunction ceu_stop_streamingfunction __ceu_try_fmtfunction ceu_try_fmtfunction ceu_set_fmtfunction ceu_set_default_fmtfunction ceu_init_mbus_fmtfunction ceu_runtime_resumefunction ceu_runtime_suspendfunction ceu_openfunction ceu_releasefunction ceu_querycapfunction ceu_enum_fmt_vid_capfunction ceu_try_fmt_vid_capfunction ceu_s_fmt_vid_capfunction ceu_g_fmt_vid_capfunction ceu_enum_inputfunction ceu_g_inputfunction ceu_s_inputfunction ceu_g_parmfunction ceu_s_parmfunction ceu_enum_framesizesfunction ceu_enum_frameintervalsfunction ceu_vdev_releasefunction ceu_notify_boundfunction ceu_notify_completefunction ceu_init_async_subdevsfunction ceu_parse_platform_datafunction ceu_parse_dt
Annotated Snippet
struct ceu_mbus_fmt {
u32 mbus_code;
u32 fmt_order;
u32 fmt_order_swap;
bool swapped;
u8 bps;
u8 bpp;
};
/*
* ceu_buffer - Link vb2 buffer to the list of available buffers.
*/
struct ceu_buffer {
struct vb2_v4l2_buffer vb;
struct list_head queue;
};
static inline struct ceu_buffer *vb2_to_ceu(struct vb2_v4l2_buffer *vbuf)
{
return container_of(vbuf, struct ceu_buffer, vb);
}
/*
* ceu_subdev - Wraps v4l2 sub-device and provides async subdevice.
*/
struct ceu_subdev {
struct v4l2_async_connection asd;
struct v4l2_subdev *v4l2_sd;
/* per-subdevice mbus configuration options */
unsigned int mbus_flags;
struct ceu_mbus_fmt mbus_fmt;
};
static struct ceu_subdev *to_ceu_subdev(struct v4l2_async_connection *asd)
{
return container_of(asd, struct ceu_subdev, asd);
}
/*
* ceu_device - CEU device instance
*/
struct ceu_device {
struct device *dev;
struct video_device vdev;
struct v4l2_device v4l2_dev;
/* subdevices descriptors */
struct ceu_subdev **subdevs;
/* the subdevice currently in use */
struct ceu_subdev *sd;
unsigned int sd_index;
unsigned int num_sd;
/* platform specific mask with all IRQ sources flagged */
u32 irq_mask;
/* currently configured field and pixel format */
enum v4l2_field field;
struct v4l2_pix_format_mplane v4l2_pix;
/* async subdev notification helpers */
struct v4l2_async_notifier notifier;
/* vb2 queue, capture buffer list and active buffer pointer */
struct vb2_queue vb2_vq;
struct list_head capture;
struct vb2_v4l2_buffer *active;
unsigned int sequence;
/* mlock - lock access to interface reset and vb2 queue */
struct mutex mlock;
/* lock - lock access to capture buffer queue and active buffer */
spinlock_t lock;
/* base - CEU memory base address */
void __iomem *base;
};
static inline struct ceu_device *v4l2_to_ceu(struct v4l2_device *v4l2_dev)
{
return container_of(v4l2_dev, struct ceu_device, v4l2_dev);
}
/* --- CEU memory output formats --- */
/*
* ceu_fmt - describe a memory output format supported by CEU interface.
*
Annotation
- Immediate include surface: `linux/delay.h`, `linux/device.h`, `linux/dma-mapping.h`, `linux/err.h`, `linux/errno.h`, `linux/interrupt.h`, `linux/io.h`, `linux/kernel.h`.
- Detected declarations: `struct ceu_mbus_fmt`, `struct ceu_buffer`, `struct ceu_subdev`, `struct ceu_device`, `struct ceu_fmt`, `struct ceu_data`, `function ceu_fmt_mplane`, `function ceu_write`, `function ceu_read`, `function ceu_soft_reset`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.