drivers/media/platform/ti/cal/cal.h
Source file repositories/reference/linux-study-clean/drivers/media/platform/ti/cal/cal.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/ti/cal/cal.h- Extension
.h- Size
- 8825 bytes
- Lines
- 342
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hlinux/io.hlinux/list.hlinux/mutex.hlinux/spinlock.hlinux/videodev2.hlinux/wait.hmedia/media-device.hmedia/v4l2-async.hmedia/v4l2-ctrls.hmedia/v4l2-dev.hmedia/v4l2-device.hmedia/v4l2-fwnode.hmedia/v4l2-subdev.hmedia/videobuf2-v4l2.h
Detected Declarations
struct devicestruct device_nodestruct resourcestruct regmapstruct regmap_fiedstruct cal_format_infostruct cal_bufferstruct cal_dmaqueuestruct cal_camerarx_datastruct cal_datastruct cal_camerarxstruct cal_devstruct cal_ctxenum cal_camerarx_fieldenum cal_dma_statefunction Layerfunction cal_rx_pad_is_sourcefunction cal_readfunction cal_writefunction cal_read_fieldfunction cal_write_fieldfunction cal_set_field
Annotated Snippet
struct cal_format_info {
u32 fourcc;
u32 code;
/* Bits per pixel */
u8 bpp;
bool meta;
};
/* buffer for one video frame */
struct cal_buffer {
/* common v4l buffer stuff -- must be first */
struct vb2_v4l2_buffer vb;
struct list_head list;
};
/**
* struct cal_dmaqueue - Queue of DMA buffers
*/
struct cal_dmaqueue {
/**
* @lock: Protects all fields in the cal_dmaqueue.
*/
spinlock_t lock;
/**
* @queue: Buffers queued to the driver and waiting for DMA processing.
* Buffers are added to the list by the vb2 .buffer_queue() operation,
* and move to @pending when they are scheduled for the next frame.
*/
struct list_head queue;
/**
* @pending: Buffer provided to the hardware to DMA the next frame.
* Will move to @active at the end of the current frame.
*/
struct cal_buffer *pending;
/**
* @active: Buffer being DMA'ed to for the current frame. Will be
* retired and given back to vb2 at the end of the current frame if
* a @pending buffer has been scheduled to replace it.
*/
struct cal_buffer *active;
/** @state: State of the DMA engine. */
enum cal_dma_state state;
/** @wait: Wait queue to signal a @state transition to CAL_DMA_STOPPED. */
struct wait_queue_head wait;
};
struct cal_camerarx_data {
struct {
unsigned int lsb;
unsigned int msb;
} fields[F_MAX_FIELDS];
unsigned int num_lanes;
};
struct cal_data {
const struct cal_camerarx_data *camerarx;
unsigned int num_csi2_phy;
unsigned int flags;
};
/*
* The Camera Adaptation Layer (CAL) module is paired with one or more complex
* I/O PHYs (CAMERARX). It contains multiple instances of CSI-2, processing and
* DMA contexts.
*
* The cal_dev structure represents the whole subsystem, including the CAL and
* the CAMERARX instances. Instances of struct cal_dev are named cal through the
* driver.
*
* The cal_camerarx structure represents one CAMERARX instance. Instances of
* cal_camerarx are named phy through the driver.
*
* The cal_ctx structure represents the combination of one CSI-2 context, one
* processing context and one DMA context. Instance of struct cal_ctx are named
* ctx through the driver.
*/
struct cal_camerarx {
void __iomem *base;
struct resource *res;
struct regmap_field *fields[F_MAX_FIELDS];
struct cal_dev *cal;
unsigned int instance;
struct v4l2_fwnode_endpoint endpoint;
struct device_node *source_ep_node;
struct device_node *source_node;
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/io.h`, `linux/list.h`, `linux/mutex.h`, `linux/spinlock.h`, `linux/videodev2.h`, `linux/wait.h`, `media/media-device.h`.
- Detected declarations: `struct device`, `struct device_node`, `struct resource`, `struct regmap`, `struct regmap_fied`, `struct cal_format_info`, `struct cal_buffer`, `struct cal_dmaqueue`, `struct cal_camerarx_data`, `struct cal_data`.
- Atlas domain: Driver Families / drivers/media.
- 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.