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.

Dependency Surface

Detected Declarations

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

Implementation Notes