drivers/media/pci/tw686x/tw686x.h
Source file repositories/reference/linux-study-clean/drivers/media/pci/tw686x/tw686x.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/tw686x/tw686x.h- Extension
.h- Size
- 4434 bytes
- Lines
- 180
- 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/mutex.hlinux/pci.hlinux/timer.hlinux/videodev2.hmedia/v4l2-common.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-ioctl.hmedia/videobuf2-v4l2.hsound/pcm.htw686x-regs.h
Detected Declarations
struct tw686x_formatstruct tw686x_dma_descstruct tw686x_sg_descstruct tw686x_audio_bufstruct tw686x_v4l2_bufstruct tw686x_audio_channelstruct tw686x_video_channelstruct tw686x_dma_opsstruct tw686x_devfunction reg_readfunction reg_writefunction max_channelsfunction is_second_gen
Annotated Snippet
struct tw686x_format {
char *name;
unsigned int fourcc;
unsigned int depth;
unsigned int mode;
};
struct tw686x_dma_desc {
dma_addr_t phys;
void *virt;
unsigned int size;
};
struct tw686x_sg_desc {
/* 3 MSBits for flags, 13 LSBits for length */
__le32 flags_length;
__le32 phys;
};
struct tw686x_audio_buf {
dma_addr_t dma;
void *virt;
struct list_head list;
};
struct tw686x_v4l2_buf {
struct vb2_v4l2_buffer vb;
struct list_head list;
};
struct tw686x_audio_channel {
struct tw686x_dev *dev;
struct snd_pcm_substream *ss;
unsigned int ch;
struct tw686x_audio_buf *curr_bufs[2];
struct tw686x_dma_desc dma_descs[2];
dma_addr_t ptr;
struct tw686x_audio_buf buf[TW686X_AUDIO_PAGE_MAX];
struct list_head buf_list;
spinlock_t lock;
};
struct tw686x_video_channel {
struct tw686x_dev *dev;
struct vb2_queue vidq;
struct list_head vidq_queued;
struct video_device *device;
struct tw686x_v4l2_buf *curr_bufs[2];
struct tw686x_dma_desc dma_descs[2];
struct tw686x_sg_desc *sg_descs[2];
struct v4l2_ctrl_handler ctrl_handler;
const struct tw686x_format *format;
struct mutex vb_mutex;
spinlock_t qlock;
v4l2_std_id video_standard;
unsigned int width, height;
unsigned int h_halve, v_halve;
unsigned int ch;
unsigned int num;
unsigned int fps;
unsigned int input;
unsigned int sequence;
unsigned int pb;
bool no_signal;
};
struct tw686x_dma_ops {
int (*setup)(struct tw686x_dev *dev);
int (*alloc)(struct tw686x_video_channel *vc, unsigned int pb);
void (*free)(struct tw686x_video_channel *vc, unsigned int pb);
void (*buf_refill)(struct tw686x_video_channel *vc, unsigned int pb);
const struct vb2_mem_ops *mem_ops;
enum v4l2_field field;
u32 hw_dma_mode;
};
/* struct tw686x_dev - global device status */
struct tw686x_dev {
/*
* spinlock controlling access to the shared device registers
* (DMA enable/disable)
*/
spinlock_t lock;
struct v4l2_device v4l2_dev;
struct snd_card *snd_card;
Annotation
- Immediate include surface: `linux/mutex.h`, `linux/pci.h`, `linux/timer.h`, `linux/videodev2.h`, `media/v4l2-common.h`, `media/v4l2-ctrls.h`, `media/v4l2-device.h`, `media/v4l2-ioctl.h`.
- Detected declarations: `struct tw686x_format`, `struct tw686x_dma_desc`, `struct tw686x_sg_desc`, `struct tw686x_audio_buf`, `struct tw686x_v4l2_buf`, `struct tw686x_audio_channel`, `struct tw686x_video_channel`, `struct tw686x_dma_ops`, `struct tw686x_dev`, `function reg_read`.
- 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.