drivers/media/pci/bt8xx/bttvp.h
Source file repositories/reference/linux-study-clean/drivers/media/pci/bt8xx/bttvp.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/bt8xx/bttvp.h- Extension
.h- Size
- 14065 bytes
- Lines
- 499
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/wait.hlinux/i2c.hlinux/i2c-algo-bit.hlinux/pci.hlinux/input.hlinux/mutex.hlinux/scatterlist.hlinux/device.hasm/io.hmedia/v4l2-common.hmedia/v4l2-ctrls.hmedia/v4l2-fh.hmedia/videobuf2-dma-sg.hmedia/tveeprom.hmedia/rc-core.hmedia/i2c/ir-kbd-i2c.hmedia/drv-intf/tea575x.hbt848.hbttv.hbtcx-risc.h
Detected Declarations
struct bttv_tvnormstruct bttv_formatstruct bttv_irstruct bttv_geometrystruct bttv_bufferstruct bttv_buffer_setstruct bttv_vbi_fmtstruct bttv_cropstruct bttv_pll_infostruct bttv_inputstruct bttv_suspend_statestruct bttv_tea575x_gpiostruct bttvfunction bttv_muxsel
Annotated Snippet
extern const struct bus_type bttv_sub_bus_type;
int bttv_sub_add_device(struct bttv_core *core, char *name);
int bttv_sub_del_devices(struct bttv_core *core);
/* ---------------------------------------------------------- */
/* bttv-input.c */
extern void init_bttv_i2c_ir(struct bttv *btv);
/* ---------------------------------------------------------- */
/* bttv-i2c.c */
extern int init_bttv_i2c(struct bttv *btv);
extern int fini_bttv_i2c(struct bttv *btv);
/* ---------------------------------------------------------- */
/* bttv-driver.c */
/* insmod options */
extern unsigned int bttv_verbose;
extern unsigned int bttv_debug;
extern unsigned int bttv_gpio;
int check_alloc_btres_lock(struct bttv *btv, int bit);
void free_btres_lock(struct bttv *btv, int bits);
extern void bttv_gpio_tracking(struct bttv *btv, char *comment);
#define dprintk(fmt, ...) \
do { \
if (bttv_debug >= 1) \
pr_debug(fmt, ##__VA_ARGS__); \
} while (0)
#define dprintk_cont(fmt, ...) \
do { \
if (bttv_debug >= 1) \
pr_cont(fmt, ##__VA_ARGS__); \
} while (0)
#define d2printk(fmt, ...) \
do { \
if (bttv_debug >= 2) \
printk(fmt, ##__VA_ARGS__); \
} while (0)
#define BTTV_MAX_FBUF 0x208000
#define BTTV_TIMEOUT msecs_to_jiffies(500) /* 0.5 seconds */
#define BTTV_FREE_IDLE msecs_to_jiffies(1000) /* one second */
struct bttv_pll_info {
unsigned int pll_ifreq; /* PLL input frequency */
unsigned int pll_ofreq; /* PLL output frequency */
unsigned int pll_crystal; /* Crystal used for input */
unsigned int pll_current; /* Currently programmed ofreq */
};
/* for gpio-connected remote control */
struct bttv_input {
struct input_dev *dev;
char name[32];
char phys[32];
u32 mask_keycode;
u32 mask_keydown;
};
struct bttv_suspend_state {
u32 gpio_enable;
u32 gpio_data;
int disabled;
int loop_irq;
struct bttv_buffer_set video;
struct bttv_buffer *vbi;
};
struct bttv_tea575x_gpio {
u8 data, clk, wren, most;
};
struct bttv {
struct bttv_core c;
/* pci device config */
unsigned short id;
unsigned char revision;
unsigned char __iomem *bt848_mmio; /* pointer to mmio */
/* card configuration info */
unsigned int cardid; /* pci subsystem id (bt878 based ones) */
unsigned int tuner_type; /* tuner chip type */
unsigned int tda9887_conf;
unsigned int svhs, dig;
unsigned int has_saa6588:1;
struct bttv_pll_info pll;
Annotation
- Immediate include surface: `linux/types.h`, `linux/wait.h`, `linux/i2c.h`, `linux/i2c-algo-bit.h`, `linux/pci.h`, `linux/input.h`, `linux/mutex.h`, `linux/scatterlist.h`.
- Detected declarations: `struct bttv_tvnorm`, `struct bttv_format`, `struct bttv_ir`, `struct bttv_geometry`, `struct bttv_buffer`, `struct bttv_buffer_set`, `struct bttv_vbi_fmt`, `struct bttv_crop`, `struct bttv_pll_info`, `struct bttv_input`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: pattern 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.