drivers/media/pci/saa7164/saa7164.h
Source file repositories/reference/linux-study-clean/drivers/media/pci/saa7164/saa7164.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/saa7164/saa7164.h- Extension
.h- Size
- 18069 bytes
- Lines
- 630
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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/pci.hlinux/i2c.hlinux/kdev_t.hlinux/mutex.hlinux/crc32.hlinux/kthread.hlinux/freezer.hmedia/tuner.hmedia/tveeprom.hmedia/dvb_demux.hmedia/dvb_frontend.hmedia/dvb_net.hmedia/dvbdev.hmedia/dmxdev.hmedia/v4l2-common.hmedia/v4l2-ioctl.hmedia/v4l2-device.hmedia/v4l2-ctrls.hmedia/v4l2-event.hsaa7164-reg.hsaa7164-types.h
Detected Declarations
struct saa7164_unitstruct saa7164_boardstruct saa7164_subidstruct saa7164_encoder_fhstruct saa7164_vbi_fhstruct saa7164_histogram_bucketstruct saa7164_histogramstruct saa7164_user_bufferstruct saa7164_fw_statusstruct saa7164_dvbstruct saa7164_i2cstruct saa7164_tvnormstruct saa7164_encoder_paramsstruct saa7164_vbi_paramsstruct saa7164_portstruct saa7164_bufferstruct saa7164_portstruct saa7164_devenum port_tenum saa7164_i2c_bus_nrenum saa7164_buffer_flagsenum saa7164_unit_type
Annotated Snippet
struct saa7164_unit {
enum saa7164_unit_type type;
u8 id;
char *name;
enum saa7164_i2c_bus_nr i2c_bus_nr;
u8 i2c_bus_addr;
u8 i2c_reg_len;
};
struct saa7164_board {
char *name;
enum port_t porta, portb, portc,
portd, porte, portf;
enum {
SAA7164_CHIP_UNDEFINED = 0,
SAA7164_CHIP_REV2,
SAA7164_CHIP_REV3,
} chiprev;
struct saa7164_unit unit[SAA7164_MAX_UNITS];
};
struct saa7164_subid {
u16 subvendor;
u16 subdevice;
u32 card;
};
struct saa7164_encoder_fh {
struct v4l2_fh fh;
struct saa7164_port *port;
atomic_t v4l_reading;
};
static inline struct saa7164_encoder_fh *to_saa7164_encoder_fh(struct file *filp)
{
return container_of(file_to_v4l2_fh(filp), struct saa7164_encoder_fh, fh);
}
struct saa7164_vbi_fh {
struct v4l2_fh fh;
struct saa7164_port *port;
atomic_t v4l_reading;
};
static inline struct saa7164_vbi_fh *to_saa7164_vbi_fh(struct file *filp)
{
return container_of(file_to_v4l2_fh(filp), struct saa7164_vbi_fh, fh);
}
struct saa7164_histogram_bucket {
u32 val;
u32 count;
u64 update_time;
};
struct saa7164_histogram {
char name[32];
struct saa7164_histogram_bucket counter1[64];
};
struct saa7164_user_buffer {
struct list_head list;
/* Attributes */
u8 *data;
u32 pos;
u32 actual_size;
u32 crc;
};
struct saa7164_fw_status {
/* RISC Core details */
u32 status;
u32 mode;
u32 spec;
u32 inst;
u32 cpuload;
u32 remainheap;
/* Firmware version */
u32 version;
u32 major;
u32 sub;
u32 rel;
u32 buildnr;
};
struct saa7164_dvb {
Annotation
- Immediate include surface: `linux/pci.h`, `linux/i2c.h`, `linux/kdev_t.h`, `linux/mutex.h`, `linux/crc32.h`, `linux/kthread.h`, `linux/freezer.h`, `media/tuner.h`.
- Detected declarations: `struct saa7164_unit`, `struct saa7164_board`, `struct saa7164_subid`, `struct saa7164_encoder_fh`, `struct saa7164_vbi_fh`, `struct saa7164_histogram_bucket`, `struct saa7164_histogram`, `struct saa7164_user_buffer`, `struct saa7164_fw_status`, `struct saa7164_dvb`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.