drivers/media/platform/atmel/atmel-isi.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/atmel/atmel-isi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/atmel/atmel-isi.c- Extension
.c- Size
- 34517 bytes
- Lines
- 1372
- 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/clk.hlinux/completion.hlinux/delay.hlinux/fs.hlinux/init.hlinux/interrupt.hlinux/kernel.hlinux/module.hlinux/of_graph.hlinux/platform_device.hlinux/pm_runtime.hlinux/slab.hlinux/of.hlinux/videodev2.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-dev.hmedia/v4l2-ioctl.hmedia/v4l2-event.hmedia/v4l2-fwnode.hmedia/videobuf2-dma-contig.hmedia/v4l2-image-sizes.hatmel-isi.h
Detected Declarations
struct fbdstruct isi_dma_descstruct frame_bufferstruct isi_graph_entitystruct isi_formatstruct atmel_isifunction set_dma_ctrlfunction isi_writelfunction isi_readlfunction configure_geometryfunction atmel_isi_handle_streamingfunction isi_interruptfunction atmel_isi_wait_statusfunction queue_setupfunction buffer_initfunction buffer_preparefunction buffer_cleanupfunction start_dmafunction buffer_queuefunction start_streamingfunction stop_streamingfunction isi_g_fmt_vid_capfunction isi_try_fsefunction isi_try_fmtfunction isi_set_fmtfunction isi_s_fmt_vid_capfunction isi_try_fmt_vid_capfunction isi_enum_fmt_vid_capfunction isi_querycapfunction isi_enum_inputfunction isi_g_inputfunction isi_s_inputfunction isi_g_parmfunction isi_s_parmfunction isi_enum_framesizesfunction isi_enum_frameintervalsfunction isi_camera_set_bus_paramfunction atmel_isi_parse_dtfunction isi_openfunction isi_releasefunction isi_set_default_fmtfunction isi_formats_initfunction isi_graph_notify_completefunction isi_graph_notify_unbindfunction isi_graph_notify_boundfunction isi_graph_initfunction atmel_isi_probefunction atmel_isi_remove
Annotated Snippet
struct fbd {
/* Physical address of the frame buffer */
u32 fb_address;
/* DMA Control Register(only in HISI2) */
u32 dma_ctrl;
/* Physical address of the next fbd */
u32 next_fbd_address;
};
static void set_dma_ctrl(struct fbd *fb_desc, u32 ctrl)
{
fb_desc->dma_ctrl = ctrl;
}
struct isi_dma_desc {
struct list_head list;
struct fbd *p_fbd;
dma_addr_t fbd_phys;
};
/* Frame buffer data */
struct frame_buffer {
struct vb2_v4l2_buffer vb;
struct isi_dma_desc *p_dma_desc;
struct list_head list;
};
struct isi_graph_entity {
struct device_node *node;
struct v4l2_subdev *subdev;
};
/*
* struct isi_format - ISI media bus format information
* @fourcc: Fourcc code for this format
* @mbus_code: V4L2 media bus format code.
* @bpp: Bytes per pixel (when stored in memory)
* @swap: Byte swap configuration value
* @support: Indicates format supported by subdev
* @skip: Skip duplicate format supported by subdev
*/
struct isi_format {
u32 fourcc;
u32 mbus_code;
u8 bpp;
u32 swap;
};
struct atmel_isi {
/* Protects the access of variables shared with the ISR */
spinlock_t irqlock;
struct device *dev;
void __iomem *regs;
int sequence;
/* Allocate descriptors for dma buffer use */
struct fbd *p_fb_descriptors;
dma_addr_t fb_descriptors_phys;
struct list_head dma_desc_head;
struct isi_dma_desc dma_desc[VIDEO_MAX_FRAME];
bool enable_preview_path;
struct completion complete;
/* ISI peripheral clock */
struct clk *pclk;
unsigned int irq;
struct isi_platform_data pdata;
u16 width_flags; /* max 12 bits */
struct list_head video_buffer_list;
struct frame_buffer *active;
struct v4l2_device v4l2_dev;
struct video_device *vdev;
struct v4l2_async_notifier notifier;
struct isi_graph_entity entity;
struct v4l2_format fmt;
const struct isi_format **user_formats;
unsigned int num_user_formats;
const struct isi_format *current_fmt;
struct mutex lock;
struct vb2_queue queue;
};
Annotation
- Immediate include surface: `linux/clk.h`, `linux/completion.h`, `linux/delay.h`, `linux/fs.h`, `linux/init.h`, `linux/interrupt.h`, `linux/kernel.h`, `linux/module.h`.
- Detected declarations: `struct fbd`, `struct isi_dma_desc`, `struct frame_buffer`, `struct isi_graph_entity`, `struct isi_format`, `struct atmel_isi`, `function set_dma_ctrl`, `function isi_writel`, `function isi_readl`, `function configure_geometry`.
- 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.